News for hackers. Stuff that matters.
Re:MoonScript - A programmer friendly language that compiles... by gmac on Thursday August 11, 2011 @03:17AM (#2871831)
Almost all the examples look like pure CoffeeScript (so I find it strange that this isn't mentioned/namechecked anywhere on the site).

Edit: happily, an attribution has now been added at the bottom, as noted in child comments.

Re:MoonScript - A programmer friendly language that compiles... by leafo on Thursday August 11, 2011 @03:44AM (#2871899)
Hi, I'm the author. You're right about the resemblance to CoffeeScript. I added some recognition at the bottom. Thanks for pointing it out, I just got the site up within the last hour so there are still finishing touches to be made.
Re:MoonScript - A programmer friendly language that compiles... by candeira on Thursday August 11, 2011 @08:46PM (#2875486)
I am curious about why didn't you just implement the CoffeeScript syntax outright? Learning just one syntax would make it easier for people wanting to deploy to JavaScript and to Lua.

Imagine that C on the PDP-11 had a slightly different syntax from C on x86, and the syntax were different from that on C on ARM, etc.

Re:MoonScript - A programmer friendly language that compiles... by evanlong on Thursday August 11, 2011 @03:49AM (#2871904)
Are you the same leafo that founded apedick.com? You are my hero.
Re:MoonScript - A programmer friendly language that compiles... by bakineggs on Thursday August 11, 2011 @05:31PM (#2874906)
It always seemed like you were a fan of leaf's ape dick. :P
Re:MoonScript - A programmer friendly language that compiles... by Cushman on Thursday August 11, 2011 @03:24AM (#2871849)
Wow, yeah. I wouldn't complain personally, since I love CoffeeScript syntax, but it is pretty odd that it's not mentioned at all. Edit: As seen above, it's mentioned now, so I'm happy :)

It's still a little irritating that they've changed things that CS handles quite elegantly to be less expressive, presumably just out of a desire to be different. I understand changes to the syntax are necessary for various reasons, but something like ! for argumentless function calls instead of () just seems like needless divergence. Was that extra character really killing you? Is the confusion with other meanings of ! really worth it?

Re:MoonScript - A programmer friendly language that compiles... by ColinWright on Thursday August 11, 2011 @03:43AM (#2871897)
At the bottom of the page (which you can get to by clicking on "About") it says:

    About

    The syntax of MoonScript has been heavily inspired
    by syntax CoffeeScript.
Re:MoonScript - A programmer friendly language that compiles... by clyfe on Thursday August 11, 2011 @03:20AM (#2871839)
Indeed. It also saddens me that it does not stick to CS conventions - lots of extra cruft ( the ! for zero-arity method invocation -- instead # for comments etc )
Re:MoonScript - A programmer friendly language that compiles... by ColinWright on Thursday August 11, 2011 @04:28AM (#2871988)
Are you actually claiming that "#" is a computer science convention for comments? It's not used in C, C++, Fortran, Lua, or many other languages. For example, comments in OCaml are ( * ... * ) (I've put extra spaces to thwart HN's formatting.

Language using "--" for comments include Lua and Haskell.

You've made me curious - what languages to you use/know that make you think "#" is a "CS convention" for comments?

EDIT: Found a reference:

http://en.wikipedia.org/wiki/Comparison_of_programming_langu...

Further edit: In response to the clarification that CS meant CoffeeScript and not Computer Science (nor the riot control gas), the point, I guess, then follows other commentators, who observe that Lua, to which this compiles, uses "--".

Re:MoonScript - A programmer friendly language that compiles... by Cushman on Thursday August 11, 2011 @05:31AM (#2872108)
But you're after the right point— the languages are bash, Perl, Python, Ruby. It's a scripting language convention, hence why CoffeeScript adopted it over JavaScript's `//`, hence the confusion as to why MoonScript didn't.
Re:MoonScript - A programmer friendly language that compiles... by clyfe on Thursday August 11, 2011 @04:56AM (#2872052)
by CS I mean CoffeeScript, sorry about ambiguity
Re:MoonScript - A programmer friendly language that compiles... by squarecog on Thursday August 11, 2011 @04:39AM (#2872016)
CoffeeScript. CS. JavaScript. JS.
Re:MoonScript - A programmer friendly language that compiles... by Cushman on Thursday August 11, 2011 @03:34AM (#2871880)
Just in case anyone else misread this— the comment symbol in MoonScript is literally `--`.
Re:MoonScript - A programmer friendly language that compiles... by stephth on Thursday August 11, 2011 @03:59AM (#2871929)
-- is the Lua syntax for comments. I'm curious about why the author kept it.
Re:MoonScript - A programmer friendly language that compiles... by jacques_chester on Thursday August 11, 2011 @04:13AM (#2871951)
... because it works fine?