Live data from Hacker News

MoonScript, a programmer friendly language that compiles to Lua

moonscript.org

141–150 of 171 posts

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

#141

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…

Many languages allow for assignment and instantiation on the same statement... I deal with this all the time in ruby and my editor simply highlights vars which aren't used later (quickly leading me to figure out if I had a typo)

As for your traffic example: in many circumstances removing lines and signs makes the roads safer (as reported by the guardian). People pay more attention because of increased uncertainty, and aren't driving (or coding) on autopilot. https://www.theguardian.com/commentisfree/2016/feb/04/remova...

Paying attention is precisely what we're paid to do.

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

#142

Earlier quoted context omitted.

Arrays starting at 1 and being closed intervals is mostly just worse than starting at 0 and being half-open intervals. Here's an expression to take an integer b and "mod it" into an interval from a to c, given the normal convention from C++ or Python or whatever where intervals are [a, c): (b-a)%(c-a)+a And here it is in the lua convention where intervals are [a,c]: (b-a)%(c-a+1)+a This is a generalization of what yo…

Yes there are many algorithms that are naturally 0 indexed. But there are also many that are naturally 1 indexed! This is somewhat unscientific, but I once went through the first quarter of an algorithms textbook. And counted how many were naturally one based or zero based. And on most it didn't matter, but there were slightly more one based ones.

[deleted]

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

#143
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?

For a 8 year old, Löve might be a bit hard.

At our weekly CoderDojo in Zurich, we're using love2d (and processing) as the next step for the kids that over 10 years and who are comfortable with typing.

Both just work!

https://www.meetup.com/Coder-Dojo-Zurich/

Your welcome to join with your kids or as a mentor if you happen to be not too far away...

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

#144
post #16

Earlier quoted context omitted.

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

Agreed. Coffeescript was excellent lipstick for the pig that is javascript.

Not particularly a fan, that analogy is solid. To me, a pig in lipstick seems somewhat more disturbing than one without.

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

#145
post #101
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…

The font you are using looks broken to me. (Win 10, Firefox) At 100% scaling, every "i" clearly looks like a "1". It reads "MoonScr1pt" for me: https://i.imgur.com/Ti12E5I.png If I zoom in or out in the browser the i looks ok again.

Exactly the same issue for me too. My configuration is Win 8.1 and the Firefox 53. I should add that only the font used to represent code has this issue. Other fonts are okay.

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

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

Hi, I made the far back side of MoonScript named ACPUL 5 years ago. I built it from the ground: high performance VM and expression based CPU assembly. It's growth up from small new language to high end gamedev mobile OS.

Images: http://acpul.tumblr.com/

Code sample: https://github.com/d08ble/acpul-demo/tree/master/dota

Video: https://www.youtube.com/watch?v=CAcv12eBqcc

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

#147
post #94

Earlier quoted context omitted.

Can you give us some examples of one-based algorithms? I've done a lot of programming in one-based languages, and now avoid such languages as much as possible (sometimes have no choice) because nothing seems to naturally fit into that.

This is unlikely something you'll use in practice, but I just read about it so it came to mind. A Braun tree is a binary tree that represents a flexible array (indexable everywhere and extendable at both ends). The gist of it is that you take your array index and read it as a binary string that tells you how to go down the tree. If your index is 1, then you're at the right place and you stop. Then you go left/right d…

Binary heaps are more commonly known and nicer to work with in 1-based arrays for the same reason. If arrays are 1-based, a binary heap's node's children are at 2n and 2n+1, and the node's parent is at n/2.

You shouldn't need a branch in a 0-based Braun tree though. (n-1)/2 should be correct all the time.

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

#148
post #53

Earlier quoted context omitted.

The reason is that the _ENV feature added in 5.2 would significantly slow down LuaJIT if it were supported. It's possible that Luac and LuaJIT will re-converge when Lua 6.0 is released, but arguments about this between Mike Pall amd Roberto Ierusalimschy have been unproductive so far. Until then, LuaJIT compiles Lua 5.1 with support for a few 5.2 and 5.3 features, particularly goto.

You have any references to these arguments between the two gods?

Totally not a concrete link, sorry, but - in a video from one of Lua conferences, I've seen Roberto mention in some polite yet clear way that talks with Mike which they had had always come to a standstill on something - at least that's how I recall it. On the other hand, since 2015, Mike was looking to pass luajit development on to someone else - so with this, situation could possibly change in the end. But I'm not sure what's the current status of this search; I seem to recall CloudFlare was reported to be in talks, but I don't know how it all ended - or if it's still unresolved.

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

#149
post #137

Earlier quoted context omitted.

fixing the gaps in Lua. Moonscript's [...] default local Roberto Ierusalimschy, the creator of Lua, believes that "Local by default is wrong." [1]. I don't necessarily agree that local-by-default is inherently wrong, but every implementation of local-by-default that I've seen has had flaws. It looks like MoonScript is no different - its scoping rules seem to suffer from the same "madness" as CoffeeScript [2]. [1] htt…

Honestly, it seems like implicit variable declaration is a bad idea. Some minimal keyword to indicate "this is a new variable in this scope" seems necessary for sane scoping. It nicely prevents a class of bugs of "oops I made a typo in that assignment and created a new variable" gets caught.

Indeed. Is "let x = y+y" so bad? I wonder how much of the resistance owes to longer words like "local"/"define", or ugly abbrevs like "mut"/"var".

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

#150

Earlier quoted context omitted.

Agreed. Coffeescript was excellent lipstick for the pig that is javascript.

Not particularly a fan, that analogy is solid. To me, a pig in lipstick seems somewhat more disturbing than one without.

I was riffing on an old expression of putting lipstick on a pig.

https://en.wikipedia.org/wiki/Lipstick_on_a_pig

Post reply on HN