you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 2 insightful - 2 fun2 insightful - 1 fun3 insightful - 2 fun -  (4 children)

I thought C was good for libraries. Is it about the scalability or reliability? Libraries are expected to have more extreme workloads? To be compatible with more platforms?

[–]fschmidt[S] 3 insightful - 2 fun3 insightful - 1 fun4 insightful - 2 fun -  (3 children)

Just depends how low level you are going. For something like SMTP, Java is perfect.

I believe that each tool should be optimized for one domain. Java is great for implementing typical libraries which you can see in my goodjava library. Luan is too slow for this stuff and I keep Luan too high level to be good for libraries. Luan is optimized for applications programming, like for implementing something like SaidIt. Luan is written in Java, so is completely portable. Luan is based on Lua which is written in C, but Luan is twice as fast as Lua.

[–][deleted] 1 insightful - 1 fun1 insightful - 0 fun2 insightful - 1 fun -  (2 children)

Thanks for explaining. It makes perfect sense. I love cruising down easy street in high level scripting languages.

[–]fschmidt[S] 2 insightful - 1 fun2 insightful - 0 fun3 insightful - 1 fun -  (1 child)

Yes, below is the high level mail interface for Luan. But note that it is still a thin layer.

local Mail = require "luan:mail/Mail.luan"

Mail.sender{
    host = "smtpcorp.com"
    username = "smtp@luan.software"
    password = "luanhost"
    port = 2525
}.send{
    From = "smtp@luan.software"
    To = "fschmidt@gmail.com"
    Subject = "test"
    body = [[
testing
1
2
3
]]
}

and

local Mail = require "luan:mail/Mail.luan"

Mail.sender{
    host = "smtpcorp.com"
    username = "smtp@luan.software"
    password = "luanhost"
    port = 2525
}.send{
    From = "smtp@luan.software"
    To = "fschmidt@gmail.com"
    Subject = "test attachment"
    body = {
        {
            body = "see attachment"
        }
        {
            ["Content-Disposition"] = [[attachment; filename="test.txt"]]
            body = [[
testing
1
2
3
]]
        }
    }
}

[–][deleted] 1 insightful - 1 fun1 insightful - 0 fun2 insightful - 1 fun -  (0 children)

She's a beauty. You totally remind me of these guys: https://suckless.org/philosophy/