News for hackers. Stuff that matters.
Re:Lell.js – FRP, State Model, No Boilerplate, Built on Rx by davexunit on Friday January 15, 2016 @08:53PM (#10913802)

    render() {
      var person = model.person
      return <div>
      <span>{person.name}</span> - {person.power_level}
      <button onClick={this.tapIncreasePowerLevel} />
      </div>
    }
Can we stop this JSX stuff? It's insane.
Re:Lell.js – FRP, State Model, No Boilerplate, Built on Rx by natrius on Friday January 15, 2016 @09:44PM (#10913980)
React is a different way of building user interfaces. Instead of finding the right UI element to update, you write functions that generate a description of the entire UI from the state, then the library calculates the differences to update the changed elements.

As a result, old advice about separating code from templates does not apply. Combining code and templates is the right thing to do in React, and JSX is far more pleasant to read and write than the native function call syntax, which is still available if you really don't like JSX.

If you haven't tried it, you should.

Re:Lell.js – FRP, State Model, No Boilerplate, Built on Rx by davexunit on Friday January 15, 2016 @10:34PM (#10914109)
You are assuming a lot. I know how to write purely functional template code using the virtual DOM in JavaScript, or something like SXML in Scheme. You can do this without using a terrible mashup of XML and JavaScript.

> JSX is far more pleasant to read and write than the native function call syntax

No, it isn't. XML is both hard to read and write. It's for machines, not humans. Besides that, mixing two languages with two very different syntactic structures together is a recipe for disaster. And besides that, you now need an additional compilation step because it's not plain JavaScript. What works much better is something like Mithril's templating API, which is concise and pure JavaScript.

Re:Lell.js – FRP, State Model, No Boilerplate, Built on Rx by natrius on Friday January 15, 2016 @10:59PM (#10914177)
Okay. Most people prefer reading and writing JSX, and haven't found it to be "insane" or a "disaster." I'm glad you found a library you prefer!
Re:Lell.js – FRP, State Model, No Boilerplate, Built on Rx by leeoniya on Friday January 15, 2016 @09:50PM (#10913996)
it has nothing to do with jsx. all vdom libraries do this. redraw-the-world is done much faster than React by numerous libraries, including mine (see other comment in this thread). Inferno is a lib that will probably replace React while maintaining jsx compatibility, check it out btw.

jsx is just more natural for designers but i agree with the gp that the benefits can be obtained with plain declarative js and avoid all the tooling required for jsx.

Re:Lell.js – FRP, State Model, No Boilerplate, Built on Rx by natrius on Friday January 15, 2016 @09:59PM (#10914019)
> all vdom libraries do this.

Most developers have never used a virtual-dom library, especially those that find JSX offensive. Your sales pitch for your library is coming off pretty aggressive, and it's a bit off topic. No one is talking about render speed.

Re:Lell.js – FRP, State Model, No Boilerplate, Built on Rx by leeoniya on Friday January 15, 2016 @10:05PM (#10914029)
well, if the topic is how great jsx is, it's on topic for me cause the lib was written specifically to scratch that itch :)
Re:Lell.js – FRP, State Model, No Boilerplate, Built on Rx by _pmf_ on Saturday January 16, 2016 @05:43AM (#10914953)
> As a result, old advice about separating code from templates does not apply. Combining code and templates is the right thing to do in React

That's a very accurate observation and it's a very strong argument against React.

Re:Lell.js – FRP, State Model, No Boilerplate, Built on Rx by mateuszf on Saturday January 16, 2016 @06:20AM (#10915010)
It's not against. React code is a part of view layer. Therefore it is kind of template code with amazing full programming language power instead of standard limited approaches.
Re:Lell.js – FRP, State Model, No Boilerplate, Built on Rx by _pmf_ on Saturday January 16, 2016 @05:40AM (#10914949)
> Can we stop this JSX stuff? It's insane.

It's like they saw "code is data" and reversed it (rock star developers do not believe in formal logic theory).

The result is a language with all the beauty of 2001's PHP and the modernistic pretentiousness of pseudo-functional JS. Calling it React is just adding insult to injury by taking a huge crap of the solid Rx research in .NET that actually brings something new to the table.

Re:Lell.js – FRP, State Model, No Boilerplate, Built on Rx by iheartmemcache on Saturday January 16, 2016 @07:44AM (#10915130)
Cleaning up the messes that rockstar developers produce is why I can live such a comfortable life. Until they start trying to present at POPL or ICFP (at which point they'd get laughed straight out of the committee hall of peer reviewers) I really can't hate on them too much.

The PhD's at Microsoft Research-Cambridge, Bart deSmet (MS-guys, I can't believe you pulled him off language development for Cortana) and the rest of the Rx team must be vomiting at what came out of their mathematically sound (often wholly proven within F*[3]) Rx work, but at the same time praising whatever deity that their name isn't attached to it. At least they're adhering to the interface signature of IObserver<T>.

Digression -- but anyone who is interested in the duality (not in the mathematical sense of 'duals) between LINQ operators and monadic operators, watch this talk with de Smet[1]. It's brilliant in it's ability to reduce all of LINQ to 5 [or less, .SelectMany() is to LINQ as NAND is to gate logic; it's later proven that 3 operators are all that are required, no surprise there, Kleisli triple anyone?] and shows with great elegance the isomorphism between monadic Haskell and LINQ. (And why RX falls so naturally out of .NET as a result.)

[1] https://channel9.msdn.com/Shows/Going+Deep/Bart-De-Smet-MinL... [2] http://community.bartdesmet.net/blogs/bart/archive/2010/01/0... [3] https://fstar-lang.org/ - to be formally presented at POPL '16. I'd offer commentary but it wouldn't do justice - any PL nerds should give that a read immediately, assuming they haven't already. MSR is without a doubt the Bell Labs of our generation.

Re:Lell.js – FRP, State Model, No Boilerplate, Built on Rx by davexunit on Saturday January 16, 2016 @09:18AM (#10915306)
>It's like they saw "code is data" and reversed it (rock star developers do not believe in formal logic theory).

Yes, you've expressed my point better than I could. Other commenters have thought that I dislike JSX because I like separate, string-based templating languages, but I think those are terrible! I hate JSX from a language design standpoint. Writing HTML templates as functional code in your language of choice is a big win, but inventing a new language "with all the beauty of 2001's PHP and the modernistic pretentiousness of pseudo-functional JS" is a big lose.

Re:Lell.js – FRP, State Model, No Boilerplate, Built on Rx by obilgic on Friday January 15, 2016 @08:56PM (#10913813)
Sorry, but won't stop anytime soon, because it's insanely productive.
Re:Lell.js – FRP, State Model, No Boilerplate, Built on Rx by orvr on Sunday January 17, 2016 @05:08PM (#10921321)
No, it's the only way to stay sane. Look at the embeded language in angular, or every crazy templating lib around. It is far better to embed html into the host language than the other way around.

http://franz.com/support/documentation/current/doc/aserve/ht...

http://weitz.de/cl-who/

Re:Lell.js – FRP, State Model, No Boilerplate, Built on Rx by lsdafjklsd on Friday January 15, 2016 @11:02PM (#10914188)
It seems that moving html into javascript versus moving javascript into html has been the winning choice. Like the clojurescript counter parts, I want to write code.
Re:Lell.js – FRP, State Model, No Boilerplate, Built on Rx by leeoniya on Friday January 15, 2016 @09:36PM (#10913953)
shameless plug: try domvm [1], it's js/JSONML all the way down, extremely fast [2] (see others [3]), 8k min, isomorphic with zero dependencies. you can mix imperative and declarative views and compose them with maximum flexibility and api exposure.

[1] https://github.com/leeoniya/domvm

[2] http://mathieuancelin.github.io/js-repaint-perfs/domvm/index...

[3] http://mathieuancelin.github.io/js-repaint-perfs/

Re:Lell.js – FRP, State Model, No Boilerplate, Built on Rx by Ronsenshi on Saturday January 16, 2016 @04:28AM (#10914840)
It's really not. I've been a big opponent to JSX for quite a while, but after actually working with it and dealing with TDD on the frontend I believe it is far better approach than what Angular does for example.
Re:Lell.js – FRP, State Model, No Boilerplate, Built on Rx by mateuszf on Friday January 15, 2016 @09:14PM (#10913870)
It's actually the opposite - awesome.
Re:Lell.js – FRP, State Model, No Boilerplate, Built on Rx by anarchy8 on Friday January 15, 2016 @09:00PM (#10913825)
The React community has overwhelmingly adopted JSX.
Re:Lell.js – FRP, State Model, No Boilerplate, Built on Rx by jetako on Friday January 15, 2016 @09:07PM (#10913847)
Why is it insane?