News for hackers. Stuff that matters.
Re:Angular 2 versus React by qwertyuiop924 on Monday January 04, 2016 @04:26PM (#10838772)
I love mitril so much. It would be soooo much better with a lisp syntax, though.
Re:Angular 2 versus React by aidenn0 on Tuesday January 05, 2016 @10:27PM (#10848263)
I wrote a parenscript wrapper for it.

[edit] No time tonight to make it pretty and publish it, but here it is[1]. Usage is identical to my parenscriptx[2] (a React tool I wrote that I based this off of).

1: https://gist.github.com/jasom/4ab84354fda405a8f67a

2: https://github.com/jasom/parenscriptx

Re:Angular 2 versus React by qwertyuiop924 on Wednesday January 06, 2016 @10:12AM (#10850866)
I was thinking more along the lines of lispyscript[1]. It's not as good as SPOCK[2], or clojurescript[3], but there's less overhead than clojurescript, and SPOCK is known to stretch your javascript implementation in odd ways.

1: http://lispyscript.com/

2: http://wiki.call-cc.org/eggref/4/spock

3: https://github.com/clojure/clojurescript

Re:Angular 2 versus React by aidenn0 on Wednesday January 06, 2016 @01:25PM (#10852407)
parenscript is quite low overhead; it's approximately lispyscript with common-lisp macros instead of whatever lispyscript has (it looks like some kind of pattern-matching style; there's only one macro example on the lispyscript documentation and the link to an article about more details is dead). In any event if you know lispyscript you can probably translate my code; it took me only a couple of hours to write the initial react version, and another 45 minutes or so to translate to mithril.
Re:Angular 2 versus React by lhorie on Wednesday January 06, 2016 @10:27AM (#10850964)
eslisp[1] might be up your alley

[1](https://github.com/anko/eslisp)

Re:Angular 2 versus React by qwertyuiop924 on Wednesday January 06, 2016 @10:38AM (#10851027)
Thanks for the pointer, Leo.

Also, thank you for the mithril blog. It is amazing.

Everybody else, if you haven't read the mithril blog[1], YOU SHOULD BE READING THE MITHRIL BLOG. Even if you never plan to use mithril, you'll probably learn something interesting.

1: https://lhorie.github.io/mithril-blog/

Re:Angular 2 versus React by SomeCallMeTim on Tuesday January 05, 2016 @12:49AM (#10841487)
I can't tell if you're joking.

I personally despise Lisp syntax.

Re:Angular 2 versus React by qwertyuiop924 on Tuesday January 05, 2016 @05:39PM (#10846656)
...Well then, you probably wouldn't like Mithril.

Typically, Mithril uses raw JS lists, function calls, and objects to create its vdom, which you have to directly manipulate. Like using react without JSX. With a lisp syntax, you might write the end of an expression as )))))), as opposed to in JS, where you might write )])]}); or something similar.

Re:Angular 2 versus React by SomeCallMeTim on Tuesday January 05, 2016 @07:45PM (#10847419)
I've actually been considering trying Mithril.

But it's not strictly parenthesis that bother me. You're right in that )]}) is actually far more annoying. I try not to nest that deep in JS if I can help it.

Arrow functions reduce the pain. Not passing array literals in function calls helps as well. Angular seems like the big culprit that injects [] into the middle of an argument list, for me anyway, and using that syntax is optional.

Re:Angular 2 versus React by qwertyuiop924 on Wednesday January 06, 2016 @10:05AM (#10850821)
Well, mithril requires a LOT of array literals and object literals in your function calls. http://mithril.js.org/getting-started.html shows todomvc in mithril. That template would be much more compact, uniform, and readable with a lispy syntax.
Re:Angular 2 versus React by SomeCallMeTim on Wednesday January 06, 2016 @04:09PM (#10853796)
I see. You're right, that is somewhat ugly.

I've actually considered the idea of hacking a JSX compiler to spit out Mithril output.

If you're going to mix mark-up in your JavaScript, may as well do it with "real" mark-up instead of some imitation language. I'm still on the fence about whether I like mixing mark-up and code, but I'm leaning more toward at this point.

Re:Angular 2 versus React by lhorie on Wednesday January 06, 2016 @07:35PM (#10855093)
That actually already exists: https://github.com/insin/msx
Re:Angular 2 versus React by SomeCallMeTim on Friday January 08, 2016 @02:20PM (#10867452)
Awesome! Thanks for the link.

It did seem like an obvious thing to do. I probably would have searched for and found this before doing any actual work on JSX, but I'm glad to know it exists already. :)

Re:Angular 2 versus React by qwertyuiop924 on Thursday January 07, 2016 @08:30AM (#10857752)
Lisp syntax and idioms make mixing markup with code really elegant and simple. That's why I want to write mithril with lisp syntax.