Live data from Hacker News

Lumo – A fast, standalone ClojureScript REPL that runs on Node.js and V8

anmonteiro.com

51–60 of 78 posts

Re: Lumo – A fast, standalone ClojureScript REPL that runs on Node.js and V8

#51
post #2

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?

Forking Joxa (https://github.com/joxa/joxa) could be a good place to start.

Might I propose Cloxure ("clock-jur") as the language name? :)

Re: Lumo – A fast, standalone ClojureScript REPL that runs on Node.js and V8

#52
post #46

Earlier quoted context omitted.

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.

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.

What tools? What are you comparing it to?

Re: Lumo – A fast, standalone ClojureScript REPL that runs on Node.js and V8

#53
post #44

Earlier quoted context omitted.

I would start with lisp flavored erlang, and add clojure's immutable yet fast-copy data structures. They are based on work by Phil Bagwell, https://en.wikipedia.org/wiki/Hash_array_mapped_trie http://infoscience.epfl.ch/record/64398/files/idealhashtrees... You might do better to create a Lisp Flavored Haskell (if one hasn't been started already). I'm sure haskeller's would be offended by the idea, but it already uses…

Why do you think Haskellers would be offended by this?

Because they hate parens so much they spent a $ to eliminate them.

Re: Lumo – A fast, standalone ClojureScript REPL that runs on Node.js and V8

#54

any chance of a npm/yarn package ?

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

npm would be substantially more suitable. Don't forget about Windows developers, please!

Re: Lumo – A fast, standalone ClojureScript REPL that runs on Node.js and V8

#55

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... You can run it with lumo test.cljs

Yeah, we have access to the whole Node.js ecosystem :-) it's also possible to npm install a package and use it from Lumo. The Node require resolution algorithm just works.

How do you specify which npm packages / versions do you want to use?

Re: Lumo – A fast, standalone ClojureScript REPL that runs on Node.js and V8

#56

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…

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.

Re: Lumo – A fast, standalone ClojureScript REPL that runs on Node.js and V8

#57
post #26

Earlier quoted context omitted.

I'm curious, what are the practical differences? I know what the theoretical differences are, but do you have any experience with how lisp1 and lisp2 are different in daily use?

I'm afraid I don't have a satisfactory answer for you. I just prefer to pass around functions/closures as values, and being able to invoke them like any normal function, instead of having to call an helper `apply`/`invoke`/`call` function on them (depending on the language) That's why I said: "maybe more apt"... if OP doesn't care at all about that difference, and it's not among the details that they'd want to replic…

I never found the funcall argument terribly convincing, because there is no reason it couldn't be much more concise. And it allows you to avoid silly variable names like lst or fst.

In Common lisp to refer to a function as a variable you do (function f) or as (read-table) syntactic sugar #'f. You could easily use destructuring to write HOFs without funcall.

So instead of requiring people to write

  (defun bad-map (f list)
    "Maps function `f' over `list', inefficiently."
    (when list (cons (funcall #'f (first list) (bad-map f (rest list)))))
  (bad-map #'- '(1 2 3))
A hypothetical lisp-2 could just as well allow destructuring like this:

   (defun bad-map (#'f list)
     "Maps function `f' over `list', inefficiently."
     (when list (cons (f (first list) (bad-map #'f (rest list)))))
   (bad-map #'- '(1 2 3))
The fact that higher order functions stick out a bit by the extra #' is not necessarily a bad thing IMO; it helps when reading unfamiliar code to know immediately what arguments are functions and which ones are just plain objects.

Re: Lumo – A fast, standalone ClojureScript REPL that runs on Node.js and V8

#58
post #47
post #8

Earlier quoted context omitted.

One of the main objectives of Clojure was interoperability with Java because of the ecosystem. Java and Erlang ecosystems are not comparable. Also, JVM is great. :)

The erlang ecosystem has new-found life with Elixir. The ecosystem for Elixir is rock-solid. Very high quality libraries abound.

Absolutely. The level of robustness is outstanding for such a new language / ecosystem.

Re: Lumo – A fast, standalone ClojureScript REPL that runs on Node.js and V8

#59

Earlier quoted context omitted.

Yeah, we have access to the whole Node.js ecosystem :-) it's also possible to npm install a package and use it from Lumo. The Node require resolution algorithm just works.

How do you specify which npm packages / versions do you want to use?

Just like you'd do in Node. Add deps to a package.json and npm install. Then just `(js/require "your-package")`

Re: Lumo – A fast, standalone ClojureScript REPL that runs on Node.js and V8

#60
post #49

Author here. Happy to answer any questions.

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?

Why not?! Sounds like a great idea. Happy to see someone help me with that
Post reply on HN