News for hackers. Stuff that matters.
Re:Show HN: 入(rù-lang) – Clojurized JavaScript by berdario on Saturday June 20, 2015 @07:59AM (#9749746)
Same idea, but a bit more mature: https://github.com/lantiga/ki

Edit: Actually, it's completely different... I was too fast to judge upon reading: a new language built with mori+sweetjs for easier javascript interop

But it might still be of interest to people here

Re:Show HN: 入(rù-lang) – Clojurized JavaScript by S4M on Saturday June 20, 2015 @07:22AM (#9749678)
I would feel uncomfortable to use the quotest to define something, like:

    fact 'defn arity func'
I think it would cause problems to have a good syntax hihlighting in the text editor.
Re:Show HN: 入(rù-lang) – Clojurized JavaScript by klibertp on Saturday June 20, 2015 @07:51AM (#9749731)
This is not a definition; it's a string with the description of what is being tested. Analogous to this code:

  it("contains spec with an expectation", function() {
    expect(true).toBe(true);
  });
Re:Show HN: 入(rù-lang) – Clojurized JavaScript by S4M on Saturday June 20, 2015 @08:31AM (#9749806)
After re-reading the post it looks more like the helper in the lisp functions declarations.

   (defn fact (n)
       "factorial calculation"
       ...)
Re:Show HN: 入(rù-lang) – Clojurized JavaScript by klibertp on Saturday June 20, 2015 @11:06AM (#9750127)
NOTE: It's the first time I see the code.

Actually, `fact`, `should`, etc. seem to be macros, as provided here:

https://github.com/jcouyang/ru/blob/master/macro/ruspec.sjs#...

And following lines. It is a bit of syntactic sweetness over a preexisting testing framework. And I'm not convinced that they should be macros.

Unless sweet.js does something really original, macros are generally not first-class. You can't pass macros directly as parameters to functions, for example. I'd rather use macros to allow for nicer function call and attribute access syntax, in general, instead of special casing tests.

After taking a closer look at the language, I have some doubts. As of right now the language seems to be a random set of features that the author found cool implemented as Sweet.js macros, with the rest of JavaScript syntax unchanged. It would be a library in a Lisp world, even in Racket I don't think this level of functionality would be enough to justify writing a #lang.

At least two of the implemented features shouldn't be macros: into and fact/should because they then become second-class objects. You can't, for example, use `into` as an argument to `map`. Shorter lambdas are fine, personally I feel that the `=>` syntax native to JS is enough for this - but that's a matter of preference.

All in all, it looks like a very early attempt and there's still much to implement and improve. Have fun with this, OP! :-)

Re:Show HN: 入(rù-lang) – Clojurized JavaScript by ff7c11 on Saturday June 20, 2015 @03:42PM (#9750837)
What do I use this for? - confused out of touch javascript dev
Re:Show HN: 入(rù-lang) – Clojurized JavaScript by devty on Saturday June 20, 2015 @01:10PM (#9750439)
nice execution of an interesting idea!

i see removing the parens as an effort to rid the 'lispy' feel to the language, but how do you go about lexical scoping without parens like clojurscript or indentation like coffeescript? For example,

  fact 'init variables and return expr' {
    should let(a=1,b=2){a+b} => 3;
  }
to what point will the let bindings be valid?
Re:Show HN: 入(rù-lang) – Clojurized JavaScript by lgas on Saturday June 20, 2015 @02:40PM (#9750680)
Presumably until the closing curly brace.