Live data from Hacker News

MoonScript, a programmer friendly language that compiles to Lua

moonscript.org

61–70 of 171 posts

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

#61
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…

Woah, thanks so much for itch.io - I'm a big fan of indie games and your site is amazing.

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

#63
post #7

I understand that people love programming in classes, but I really want something like a stripped-down ES6. In particular, I want: 1. Lists and objects/dicts only; objects have no prototypes at all; objects have no first-class methods, but they can have functions as member variables, and those functions can close over other data in the object 2. All function and variable declaration is anonymous (as a consequence of…

Moonscript uses local by default (compiles to Lua). Here is your code in Moonscript: foo = { x: {1, 2, 3}, y: (a, b, c) -> sum = a + b + c sum * sum }

Yeah, now just strip away all the other stuff and we'll be good.

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

#64

Lapis + MoonScript + OpenResty looks like a lot of fun, so I was just starting to get a local environment running for it and immediately ran into the Lua 5.1 and 5.2+ divergence. For someone who has just been a casual observer of the Lua ecosystem over the years, can someone talk about the community's feelings towards that divergence? The OpenResty docs basically state it's not worth the effort to support anything bu…

This is my problem as well. I just installed 5.3 on my system but it looks like nobody really supports 5.3. There really is no clear guidance on what to do - do I just not use the latest version of the language?

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

#65
I was on a team that used Lua in production on tens of thousands of machines running 24/7. The Lua interpreter was the weak link in the system, requiring at least daily restarts. Squashed so many bugs over the years, and still found more and more all the time. What I'm saying is, the Lua interpreter itself is flawed and I can't imagine using it as a runtime if I had the chance to avoid it. That said, the language was fun and fast and got the job done. The interpreter could use some work.

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

#66

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.

Can't agree with that. Having used both Lua and Moonscript quite a bit I think Moonscript is what most dynamic scripting languages should be. Simple, succinct and does what you need for a scripting language.

I really enjoy using it.

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

#67

I was on a team that used Lua in production on tens of thousands of machines running 24/7. The Lua interpreter was the weak link in the system, requiring at least daily restarts. Squashed so many bugs over the years, and still found more and more all the time. What I'm saying is, the Lua interpreter itself is flawed and I can't imagine using it as a runtime if I had the chance to avoid it. That said, the language was…

Ever used luaJIT?

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

#69
post #59

"Moonscript is like CoffeeScript for Lua" That's a very succinct description and from skimming the examples, quite apt. But what I want is Typescript for Lua, specifically to use with Redis. That way I can define interfaces for my keys/values and have static checks on their usage.

Typed Lua might be worth checking out: https://github.com/andremm/typedlua (disclaimer: I haven't used it yet)

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

#70

Lapis + MoonScript + OpenResty looks like a lot of fun, so I was just starting to get a local environment running for it and immediately ran into the Lua 5.1 and 5.2+ divergence. For someone who has just been a casual observer of the Lua ecosystem over the years, can someone talk about the community's feelings towards that divergence? The OpenResty docs basically state it's not worth the effort to support anything bu…

For many libraries, it's pretty easy to write code that works across all the versions. For many differences it's not too difficult to implement code for maximum compatibility: http://leafo.net/guides/setfenv-in-lua52-and-above.html

For me personally, the advantages of luajit currently outweigh the desire to upgrade to newer versions of the language.

Regarding Lua 5.1 being old, I haven't really found it to be an issue.. Lua isn't like most scripting languages, it doesn't come with a huge standard library. It's effectively just the language and some primitives. So it ages quite well as is.

Post reply on HN