News for hackers. Stuff that matters.
Re:MoonScript - A programmer friendly language that compiles... by nknight on Thursday August 11, 2011 @03:22AM (#2871845)
Some of this is a definite improvement over Lua, but I'm getting really tired of some of these cute little syntaxes showing up everywhere, like '->' and '=>' for creating functions, and what's with this:

! operator can be used to call a function with no arguments

Seriously?

I feel like people are coming up with these things just to be "different". Programming language syntax is a UI, and needs to be treated like one -- you don't make major changes to basic UI paradigms without convincing reason.

Edit: Maybe more to the point, you don't add random buttons to a UI that do non-obvious things. Language syntax should be self-evident and quickly readable, and shouldn't require careful parsing of individual characters.

Re:MoonScript - A programmer friendly language that compiles... by thurn on Thursday August 11, 2011 @04:13AM (#2871953)
What's the fun of that? Playing with new syntax ideas is the whole point of language creation.
Re:MoonScript - A programmer friendly language that compiles... by gjm11 on Thursday August 11, 2011 @05:48AM (#2872142)
For some languages and some creators, perhaps. Personally, I think playing with new semantics ideas is more interesting.
Re:MoonScript - A programmer friendly language that compiles... by nknight on Thursday August 11, 2011 @04:46AM (#2872029)
If this were somebody's toy or research language, I wouldn't be complaining, but when a language is clearly being marketed as something people would want to use in the real world, I expect it to be based on real evidence and real experience, not just somebody playing around.
Re:MoonScript - A programmer friendly language that compiles... by squarecog on Thursday August 11, 2011 @05:23AM (#2872090)
Where did you get that this is being marketed for production? Did you just assume that because the site looks nice?

Handy tip: languages that are marketed for use in the real world tend to advertise actual uses in the real world.

Re:MoonScript - A programmer friendly language that compiles... by stephth on Thursday August 11, 2011 @05:35AM (#2872117)
Why wouldn't this be used for production? It compiles to human readable Lua.
Re:MoonScript - A programmer friendly language that compiles... by anonymoushn on Thursday August 11, 2011 @05:46AM (#2872137)
I'm not sure that copy and pasting class.lua for every class definition makes for human readable Lua.
Re:MoonScript - A programmer friendly language that compiles... by stephth on Thursday August 11, 2011 @04:29PM (#2874621)
It's human readable as far generated code goes. It's not always practical to read (specially with classes), but you can if you have to. It's one of the philosophies behind CoffeeScript. As you can see its translation of OOP is verbose too, but readable [1], and the verbosity of the generated code is balanced by the power added on the CoffeeScript side.

My point/question was: it doesn't add a runtime or new libraries/routines, you can read the generated code if something goes wrong, so why wouldn't it be ok to use in production?

[1] http://jashkenas.github.com/coffee-script/#classes

Re:MoonScript - A programmer friendly language that compiles... by nknight on Thursday August 11, 2011 @05:56AM (#2872153)
"Nice" is relative, I think the site is a colorblind monstrosity (it actually looks better when I invert the colors!), but someone clearly put some effort into it, as well as the reference manual, and there is no indication given anywhere that it should be treated as anything other than a serious entry into the world of production programming languages.

On the contrary, at the very top of the page, albeit in extremely poor contrast, it says "A programmer friendly language". That certainly implies the author considers it to be good for something other than "playing with new syntax".