News for hackers. Stuff that matters.
Re:Ijk – Transforms arrays into virtual DOM trees by ivanceras on Tuesday January 23, 2018 @06:47AM (#16212790)
Improve it a little bit more by by removing the single quote by turning the html tags into functions that accepts 2 arrays: the attributes and the child elements, by this time you will come across with elm in which expressing the html document tree fits perfectly in the language syntax and semantics.
Re:Ijk – Transforms arrays into virtual DOM trees by lukejacksonn on Tuesday January 23, 2018 @07:07AM (#16212906)
We already have something similar to this at hyperapp.. it is https://github.com/hyperapp/html. But yes, as mentioned by @masklinn, the drawback is you then have to define every element and then import all those definitions. With ijk you can write dependency free views (no import of h or h1, h2, etc.)
Re:Ijk – Transforms arrays into virtual DOM trees by gberger on Tuesday January 23, 2018 @08:51AM (#16213509)
Not necessarily, you could have `h.h1` and `h.span` and `h.myCustomElement` just by using Proxies from Ecmascript 6

https://makandracards.com/makandra/44070-javascript-hash-obj...

Re:Ijk – Transforms arrays into virtual DOM trees by couchand on Tuesday January 23, 2018 @09:46AM (#16213904)
> you can write dependency free views

Well, explicit-dependency-free, but there's still an implicit dependency on the tag names. Granted, those are just standard HTML, but something is lost by not checking them at compile time. OTOH, you could write a linter for that...

Re:Ijk – Transforms arrays into virtual DOM trees by masklinn on Tuesday January 23, 2018 @06:51AM (#16212814)
The annoyance with that is you have to pre-define every element.

That's high-value in a language like Elm because you can refine element-generating functions (e.g. not allow children elements for empty elements), it's not really useful in a dynamically typed language.