
Lumo – A fast, standalone ClojureScript REPL that runs on Node.js and V8 - rcarmo
https://anmonteiro.com/2016/11/the-fastest-clojure-repl-in-the-world/
======
iagooar
Sometimes I think Clojure should have been developed on top of the ErlangVM
instead of the JVM. I think that the ErlangVM solves a lot better the problems
that Clojure is trying to solve. Also, seems like targeting the ErlangVM is an
achievable feat, since Elixir in its version 1.3 has proven to be extremely
solid.

Crazy idea: if I wanted to implement Clojure on top of the ErlangVM, where
should I start?

~~~
mac01021
I think shared memory is foundational to Clojure's approach to concurrency,
and that is something the Erlang VM cannot provide. So some main fixtures of
Clojure's standard library, like atoms, STM, agents, become either useless or
nonsensical.

It's also not clear to me wether the Erlang VM provides what Clojure needs to
efficiently implement its user-defined types, protocols, etc

That said, a Clojure-like dialect of lisp built on Erlang is a fine idea and,
as others have said, I would probably start by seeing how the Lisp-Flavoured-
Erlang (LFE) guys built _their_ lisp.

~~~
wcummings
Mnesia is sorta like STM in Erlang.

~~~
rvirding
Actually no, it is completely different internally with different properties.

------
delegate
The startup time is of course very low, so that's good.

I think you're underselling the tool for beginners like myself - it's not just
a ClojureScript REPL, it's actually an executable which can run node.js
scripts written in clojurescript.

For example, here's the typical node http server example:
[https://gist.github.com/anonymous/c14b2b57184c650d9f3ff0a9e1...](https://gist.github.com/anonymous/c14b2b57184c650d9f3ff0a9e1a84058)

You can run it with lumo test.cljs

~~~
cutler
How do I add Clojurescript libraries to my script? Doesn't that require a
lein/boot cljs project?

~~~
anmonteiro90
Lumo, just like Planck, implements classpath emulation. You can specify colon
separated paths to JARs/dirs in which Lumo will resolve requires. Take a look
at `lumo -h` for all the available options.

------
mark_l_watson
Neat project, but back when I was using Clojure a lot, I lived in Emacs and
the time spent for booting up my interactive environment was OK because once
booted up, I would work for a long time without restarting from scratch. Same
for me now with Emacs+Intero for interactive Haskell development - once
everything is loaded, Everything is fast.

This project seems more suited to being able to write fast starting scripts in
Clojurscript.

~~~
cheez
Came here to say exactly this. The use case is very limited, although
technically it's something that will push the state of the art forward.

------
anmonteiro90
Author here. Happy to answer any questions.

~~~
Gonzih
Any canche to see ARM binaries pre built? Would love to run this on raspberry
pi / pocket chip. Also planck had io support. Are you planning to add support
for io in idiomatic clojure to your project?

~~~
anmonteiro90
Why not?! Sounds like a great idea. Happy to see someone help me with that

------
spinningarrow
I've been using Planck (and Replete for iOS) when I need a fast-starting
clj[s] REPL for checking things quickly. What would be the use case for Lumo
for me?

~~~
anmonteiro90
The difference is that both Planck and Replete run on JavascriptCore, while
Lumo runs on Node.js and V8. One of the advantages of piggybacking on Node is
that we get access to its whole ecosystem for free.

------
kimi
This would be cool for ClojureScript scripting

------
jiyinyiyong
Really hope one day we can build ClojureScript projects without JVM. Lumo is
one more step further than Planck.

------
fibonacho
I totally though this was about the WebGL tile rendering library:
[https://github.com/kbirk/lumo](https://github.com/kbirk/lumo)

I was like "Clojure... V8, what?!"

------
sandGorgon
any chance of a npm/yarn package ?

~~~
anmonteiro90
Happy to consider it, but I'm unsure what the benefits would be? Probably
something like Homebrew would be more suitable I believe.

~~~
sandGorgon
With all due respect we are on Linux. No homebrew for us. Since you are
already on the node platform..this makes sense for all of us.

~~~
rcarmo
Erm. No. I'd pay not to use npm at all.

~~~
spinningarrow
Why? You can use it not at all for free!

~~~
rcarmo
Because the whole npm system is broken, and I wish yarn would break apart and
start anew.

------
provemewrong
s/Clojure/ClojureScript

~~~
darklajid
I was confused as well. The article compares the standard Clojure REPL with
two ClojureScript REPLs (one being the one introduced in the article).

Interesting nevertheless, but still confusing.

------
hellofunk
Please change the title to ClojureScript, not Clojure.

------
lispm
'fastest starting Clojure REPL'... which is still slow compared to
alternatives.

~~~
anmonteiro90
Unfortunately, Node.js and V8 seem to be about 2.5X slower than JavaScriptCore
for bootstrapped ClojureScript. I haven't found a way around it. I also don't
mean to trick anyone and this is explained in the post.

~~~
lispm
To me 'fast' means more than startup time. The headline is just clickbait.

The time you are reporting is also not that 'fast'. Other tools start in a
fraction of that time.

~~~
grzm
sbcl isn't Clojure, is it? Or am I mistaken? I don't see the article or its
title comparing it to repls in general.

Edit: original comment mentioned sbcl and included sbcl repl start-up time.

~~~
lispm
Better title would be:

'less slowest starting Clojure REPL of three'

Mentioning 'fastest' at a time of 3GHZ multicore machines with SSD and a
duration of 0.1 seconds is just absurd. That's >100 million instructions just
to start a language prompt and evaluating a symbol to itself. The Java version
is even more absurd with around 1 billion instructions just to get a REPL...

A shell on a 1 MIPS DEC VAX 11/780 started faster, while the machine had a
hundred users.

