Live data from Hacker News

Ijk – Transforms arrays into virtual DOM trees

github.com

1–10 of 49 posts

Re: Ijk – Transforms arrays into virtual DOM trees

#2
Reminiscent of Breve.

https://github.com/cwells/breve

I don't see a huge advantage over hyperscript (hyperapp and mithril both use it), but that is a ridiculously small codebase.

The JS hate is kind of funny around here, because when you dig into stuff like this, you realize that JS is very lispy in ways (it's easy to build up trees of HTML dynamically). In the mid aughts on r/programming people would rant and rave about the kind of stuff Smalltalk's Seaside could do. Now that's possible, most of the disadvantages have been worked out, and people hate it.

Can't win, can you?

Re: Ijk – Transforms arrays into virtual DOM trees

#3

Reminiscent of Breve. https://github.com/cwells/breve I don't see a huge advantage over hyperscript (hyperapp and mithril both use it), but that is a ridiculously small codebase. The JS hate is kind of funny around here, because when you dig into stuff like this, you realize that JS is very lispy in ways (it's easy to build up trees of HTML dynamically). In the mid aughts on r/programming people would rant and rave a…

also hiccup in clojureland, https://github.com/weavejester/hiccup which has an abandoned looking python port: https://github.com/pascience/pyhiccup

Thanks, I hadn't seen Breve! I was looking for exactly this a while ago.

Re: Ijk – Transforms arrays into virtual DOM trees

#4
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

#5

Reminiscent of Breve. https://github.com/cwells/breve I don't see a huge advantage over hyperscript (hyperapp and mithril both use it), but that is a ridiculously small codebase. The JS hate is kind of funny around here, because when you dig into stuff like this, you realize that JS is very lispy in ways (it's easy to build up trees of HTML dynamically). In the mid aughts on r/programming people would rant and rave a…

It's basically hiccup (https://github.com/weavejester/hiccup).

Re: Ijk – Transforms arrays into virtual DOM trees

#6

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.

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.

Re: Ijk – Transforms arrays into virtual DOM trees

#8
post #7

I like the syntax, but I have to say that I prefer JSX. The real advantage of JSX is that it's very similar to HTML and developers have been reading, mentally modeling and reasoning about HTML -> DOM translation for decades.

That's the disadvantage, too: you gotta use html! Where are the lispers to talk about how much better sexps are?

Even with decades of knowledge, I think you'll find that devs can transition to the non-html model really, really quickly, and then it's nice because everything is a single uniform language.

Re: Ijk – Transforms arrays into virtual DOM trees

#10
post #7

I like the syntax, but I have to say that I prefer JSX. The real advantage of JSX is that it's very similar to HTML and developers have been reading, mentally modeling and reasoning about HTML -> DOM translation for decades.

I like to write my apps with one language where possible. I find the switch in context to much of an overhead.. but I am aware this is personal preference. Use what makes you happy :) it all gets compiled to vdom trees anyway!
Post reply on HN