Live data from Hacker News

Ijk – Transforms arrays into virtual DOM trees

github.com

21–30 of 49 posts

Re: Ijk – Transforms arrays into virtual DOM trees

#22
post #20

Also https://github.com/Jador/react-hyperscript-helpers/blob/mast... which is even more terse

We have something like this for hyperapp (https://github.com/hyperapp/html). The aim of this variant was to experiment to see wether it is feasible to rid of view dependencies (either `h` or precompiled tags like `h1` etc.)

Re: Ijk – Transforms arrays into virtual DOM trees

#24

Looks awesome. Makes me wish I still used LiveScript because of the \string syntax and other features that would go great with ijk. You refer to h but what is it? I searched around but obviously something called h is hard to find.

Search for "hyperscript" :)

Re: Ijk – Transforms arrays into virtual DOM trees

#25

Looks awesome. Makes me wish I still used LiveScript because of the \string syntax and other features that would go great with ijk. You refer to h but what is it? I searched around but obviously something called h is hard to find.

See https://github.com/hyperhype/hyperscript

Re: Ijk – Transforms arrays into virtual DOM trees

#26
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.

> Where are the lispers to talk about how much better sexps are?

Well... there is the OP...

Re: Ijk – Transforms arrays into virtual DOM trees

#28
What makes Hiccup so nice in the Clojure world is that Paredit can be used here which is the tool you're already using to manipulate data structures.

For example, with Paredit, you can create an element and then move it prev/next/up/down a tree with muscle memory you're already using for the rest of your code.

When I re-entered the Javascript world, I tried arrays-for-html but realized it's unbearable without manipulation tooling. I think something like JSX makes more sense at that point since I find you're more likely to already be using an HTML manipulation tool like Emmet which is more pleasant than hand-editing array structures.

Re: Ijk – Transforms arrays into virtual DOM trees

#29

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…

IMHO the quirkiness of JS is not the main reason for JS hate, neither is the experiments being done with it. People hate JS because they have to use JS. Clojure, C#, Go or any other language would have the same destiny if they were the only language which worked on browsers.

Re: Ijk – Transforms arrays into virtual DOM trees

#30

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.

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.)

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...

Post reply on HN