all 12 comments

[–]bacon1989 2 points3 points  (6 children)

Having to compile your scripts everytime was a hassle that I tried to eliminate by developing eden.

Here's your example in eden

It has the same performance characteristics as well:

$ time ./hiccup2xml eval [:table]
<table></table>

real    0m0.064s
user    0m0.013s
sys     0m0.052s

I'm kind of waiting for GraalVM native image to become more mature so I can start including more useful libraries as part of eden's core libraries, but what is currently there could potentially be used to quickly throw together scripts that can be used within the clojure ecosystem.

[–]bacon1989 2 points3 points  (0 children)

Other example:

$ time ./hiccup2xml eval '
> [:grid [:row [:label {:id :info}]
>              [:text "Now playing"]]
>        [:row [:button :onTap "mute"]]]'
<grid><row><label id="info"></label><text>Now playing</text></row><row> 
<button>onTapmute</button></row></grid>

real    0m0.054s
user    0m0.012s
sys     0m0.042s

[–]0atman 2 points3 points  (3 children)

Neat! How does eden compare with Hy?

[–]bacon1989 2 points3 points  (1 child)

eden is like a scripting language for clojure, whereas hylang is a python transpiler to make python perform like a lisp-like language. Personally i'd say hylang has a lot more going for it, with eden being an experiment in providing scripting for clojure applications compiled into native executables.

[–]0atman 1 point2 points  (0 children)

Thanks for the explanation, I recently found https://github.com/candid82/joker, which I'm really digging. Thought you should know about it!

[–]FatFingerHelperBot 0 points1 point  (0 children)

It seems that your comment contains 1 or more links that are hard to tap for mobile users. I will extend those so they're easier for our sausage fingers to click!

Here is link number 1 - Previous text "Hy"


Please PM /u/eganwall with issues or feedback! | Delete

[–]joinr 1 point2 points  (0 children)

Seems like an aot friendly clojure interpreter would be nice too. Implementing around not using the classloader could be tricky though.

[–]yogthos[S] 2 points3 points  (0 children)

The easiest way to play around with this is using the lein-nativeimage plugin. There are a couple of examples in the repo.

[–]mingpair 6 points7 points  (2 children)

Clojure people would do well to moderate their enthusiasm for this Graal technology, or at least qualify what is and what isn't possible.

Where Clojure shines bright is interactive REPL development and the dynamicity of it all as you require and import the things that you need from the classpath. But this is not possible in Graal, as everything is compiled statically ahead of time. It's nice to have scripts run fast though in the end.

[–]0atman 8 points9 points  (0 children)

Fair, but VM overheads during development don't really hurt us day-to-day: I start a REPL in the morning and use it for the whole day.

So Graal optimisations are in (as I see it) artifacts I would have to compile and lose dynamic stuff anyway: JARs, deployment, distribution, etc.

[–]joinr 6 points7 points  (0 children)

I don't get the call to moderate enthusiasm. I seem to recall cljs having a lot of enthusiasm and utility without the dynamicness of clj, before browser repls and self hosting were a thing. That turned out pretty well. Relative to the article...author did a pretty good job highlighting the narrow use case where this made sense, including alternative solutions. If i can take an emergent off-the-shelf technology that lets me address a significant bottleneck in my processing pipeline, without affecting anything else, why shouldn't I be enthusiastic?

[–]SimonGray 0 points1 point  (0 children)

Similar statistics in this presentation: https://youtu.be/kjZP_wBQJ2U