Live data from Hacker News

MoonScript, a programmer friendly language that compiles to Lua

moonscript.org

41–50 of 171 posts

Re: MoonScript, a programmer friendly language that compiles to Lua

#41
post #15

Hey all, I made MoonScript about 6 years ago. I used it to build a ton of opensource stuff in addition to the company I founded. I use it every day and I'm very happy with how it's turned out. I regret not updating the language more frequently, but I've been busy building a bunch of stuff in it. The biggest open source project is a web framework for Open Resty: https://github.com/leafo/lapis It's used for the followi…

I was just looking at love2d, I don't know much about it. My son is 8 and is very bored with Scratch. A once over the documentation makes me think love2d might be a good fit for a next step from Scratch. How is the love2d community and is it active?

Processing may also be a good choice.

Re: MoonScript, a programmer friendly language that compiles to Lua

#42
post #15

Hey all, I made MoonScript about 6 years ago. I used it to build a ton of opensource stuff in addition to the company I founded. I use it every day and I'm very happy with how it's turned out. I regret not updating the language more frequently, but I've been busy building a bunch of stuff in it. The biggest open source project is a web framework for Open Resty: https://github.com/leafo/lapis It's used for the followi…

Are you aware that TIC-80 supports moonscript? It's one of the better PICO-8 "clones" out there. https://nesbox.itch.io/tic https://github.com/nesbox/tic.computer/wiki#cartridge-metada...

Is that open source? I'm wondering if it uses SDL or a similar library - binaries look pretty small.

Re: MoonScript, a programmer friendly language that compiles to Lua

#43

Adding superlatives to your stuff is, to me, just noise. e.g: "fast", "simple", "friendly", "lightweight". I would rather provide conclusive proof, like some side to side comparison of features to illustrate how idiomatic MoonScript is supposedly friendlier than Lua. Personally I think the changes are not necessarily in the right direction: For example, what if you have a typo in a variable identifier when assigning…

I see it as a toy language. The only person I think would find it useful is leafo himself since he can edit it however he wants. But everyone else should stay away from it. Plain Lua is so much better.

Re: MoonScript, a programmer friendly language that compiles to Lua

#44

Adding superlatives to your stuff is, to me, just noise. e.g: "fast", "simple", "friendly", "lightweight". I would rather provide conclusive proof, like some side to side comparison of features to illustrate how idiomatic MoonScript is supposedly friendlier than Lua. Personally I think the changes are not necessarily in the right direction: For example, what if you have a typo in a variable identifier when assigning…

I see it as a toy language. The only person I think would find it useful is leafo himself since he can edit it however he wants. But everyone else should stay away from it. Plain Lua is so much better.

It's a general purpose language, you never know who will use it and how.

Re: MoonScript, a programmer friendly language that compiles to Lua

#45
post #37

Earlier quoted context omitted.

This is basically Lua, excluding type annotations. Lua's form of OOP is very strange in that methods aren't bound to a parent context, but instead take the object as a value. For example, `object:method()` is the same as `object.method(object)`, and `function object:method()` is the same as `function object.method(self)` - the only difference being calling the function via `object:method()` is a bit more optimized. T…

I forgot to emphasize that I'm particular about syntax. I amended my comment accordingly. I also don't like the global-by-default bit, but maybe my ideal language could be a syntax layer atop Lua?

Metatables are your friend.

    -- LuaJIT
    
    local oldG = _G
    local newG = setmetatable({}, {
        __index = oldG,
    })
    setmetatable(oldG, {
        __index = function(t, k)
            return rawget(newG, k)
        end,
        __newindex = function()
            error('attempt to assign global variable')
        end,
    })
    _G = newG
If you want to assign a global variable, `x = 5` will error but `_G.x = 5` won't.

Re: MoonScript, a programmer friendly language that compiles to Lua

#46
post #16
post #4

Earlier quoted context omitted.

Thankfully, GitHub starting gutting Coffee from Atom a long time ago. There's still too much in there though.

While I understand the move to es6 or whatever we're calling it now, a part of me really misses coffeescript. I found it to be very elegant

I agree - I love coffeescript's syntax. It feels like comparing python to java-esk syntax (I mean without the type checking, etc)

Re: MoonScript, a programmer friendly language that compiles to Lua

#48
post #15

Hey all, I made MoonScript about 6 years ago. I used it to build a ton of opensource stuff in addition to the company I founded. I use it every day and I'm very happy with how it's turned out. I regret not updating the language more frequently, but I've been busy building a bunch of stuff in it. The biggest open source project is a web framework for Open Resty: https://github.com/leafo/lapis It's used for the followi…

Dude, this is neat. Itch.io is a great site, I've bought a few things through it. I like how your HN profile page mentions only MoonScript and not itch.io, though, in that the former is an open source project and the latter is a company :)

He's a very modest dude, so I make sure to advertise for him on HN whenever the chance arises.

I've been following him since the early days of itch.io and the progress he's made with it is astounding.

Re: MoonScript, a programmer friendly language that compiles to Lua

#49
post #15

Hey all, I made MoonScript about 6 years ago. I used it to build a ton of opensource stuff in addition to the company I founded. I use it every day and I'm very happy with how it's turned out. I regret not updating the language more frequently, but I've been busy building a bunch of stuff in it. The biggest open source project is a web framework for Open Resty: https://github.com/leafo/lapis It's used for the followi…

I was just looking at love2d, I don't know much about it. My son is 8 and is very bored with Scratch. A once over the documentation makes me think love2d might be a good fit for a next step from Scratch. How is the love2d community and is it active?

I learned lua and love2d last year and found them ... lovely! Hadn't done any graphics programming in about 20 years, and thoroughly enjoyed the process. What was really great was the ability to target multiple platforms. I even wrote an SVG library @ https://github.com/globalcitizen/svglover and a roguelike @ https://github.com/globalcitizen/zomia for the 2016 Annual Roguelike Release Party (ARRP).

Re: MoonScript, a programmer friendly language that compiles to Lua

#50
post #25

Earlier quoted context omitted.

> Then, when you remove parenthesis, it's the same as removing a lane delimiter. As someone that vastly prefers parenthesis, no, it's not. The block is just bounded by syntactic structure, not by delimiter. It's like replacing lane delimiters with rippled road texture. The delimiter is different and in my opinion inferior, but it's not gone, it's just replaced by some other indicator.

Except that that whitespace is not used only for that purpose, it could mean also something else, right? We trade an unambiguous set of characters --the parentheses-- by whitespace, and make it context sensitive. How is that now more readable? As someone who has had to match these whitespace based parenthesis I can tell you it's not more readable. It's more like someone determined that parenthesis were not visually p…

> Except that that whitespace is not used only for that purpose, it could mean also something else, right

It's not just whitespace, it's the specific formatting of whitespace. It's just a character, like any other, only defined by it's lack of distinguishing characters. Instead of whitespace, block continuations could be defined by pipes, or angle brackets, or any number of things. They chose wihtespace.

> We trade an unambiguous set of characters --the parentheses-- by whitespace, and make it context sensitive.

Parenthesis are often context sensitive in languages. It's very common for them to handle both code block and object/dict/hash definition. Languages often use '+' for both numeric addition and string concatenation (which in my eyes is often more problematic and less justified than whitespace as a block defining element).

> How is that now more readable? As someone who has had to match these whitespace based parenthesis I can tell you it's not more readable.

"Readable" is subjective. Unless you have experience with it, you would probably find APL more than unreadable, likely impenetrable. Experience can vastly change what one find easy to understand, and easier to learn doesn't necessarily mean better in all respects.

> It's more like someone determined that parenthesis were not visually palatable and decided to remove them.

Or, it actually is that some people prefer it, even if you and I do not, and that's what it is, a preference implemented in the languages they decided to make. It is, to me, subjectively worse, but the key word there is subjectively. There are trade-offs between the benefits and detriments of that style, but we shouldn't fall into the trap of assuming we can make objective claims as to the quality of the choices of languages that prefer structured whitespace as a syntactic element when it's obvious a large percentage of people find it beneficial.

In the end, unless you're being forced to use this language, I'm not sure why it matters what choice they made with regard to this. If you don't like the choices made by this language, don't use it, and your actions will speak for themselves. If enough people feel that way, the language will die out or change. If enough people do like it how it is, it will continue, as it should, because there's no reason we should restrict other people's choices when it comes down to what is by large an aesthetic choice.

Post reply on HN