lumo

:lumo: Standalone ClojureScript environment. Currently at version 1.9.0
2017-12-11T14:42:13.000041Z

@mfikes yep, I always set -K

mfikes 2017-12-11T14:44:15.000338Z

I'm starting to lean towards having Planck enable it by default, with it being disabled via --no-auto-cache or some such.

2017-12-11T14:48:57.000176Z

I wonder if it would make sense to md5sum the source files(with compiler version as well) and store into the cache .js/.json files somehow. Global cache directory that could work between projects.

2017-12-11T14:49:19.000568Z

just thinking out loud, but this would be maybe too much work and risky for too little gain

2017-12-11T14:57:03.000249Z

@hlolli I for one would love a global cache in say ~/.lumo/cache, not sure about the implications of cross project but I generally share a lot of deps between projects, e.g. andare:0.4.0

2017-12-11T14:57:44.000279Z

there another thread on the lumo gh project discussion storing the cache inside of deps shipped over npm

2017-12-11T15:01:08.000381Z

like antonio pointed out, if we start shipping caches, then we are always going to have a bad time across compiler versions. How is it again in clojure, are aot's included in the uberjars, I forgot if that's the default or optional.

mfikes 2017-12-11T15:24:18.000125Z

@hlolli It is my impression if you put AoT Clojure artifacts in a JAR you can run into similar problems (mismatches for different Clojure versions). TBH I haven't dug too deep into it other than having been burned a few times and then essentially avoiding it.

2017-12-11T15:54:34.000682Z

Then there's always the possibility of just compileing a js module and ship that (one function library for example), but I'm not sure how much redundant code is being used when one requires compiled cljs project from clojurescript. The plus there of course is useability for js users.

2017-12-11T15:57:43.000124Z

@hlolli yea definitely some pro’s and cons between shipping the compiled js. I’m definitely interested in the possibility of distributing the cljs src via npm, if for no other reason than debugging and transparency

2017-12-11T15:58:55.000147Z

the caches are really nothing else but compiled js, minus the cljs boilerplate (it expects cljs.vector type and all datatypes to exist).

2017-12-11T15:58:57.000578Z

I still do love the idea of giving a js team some compiled js

2017-12-11T15:59:33.000857Z

yes, ofc πŸ™‚ I think we should do more of it

2017-12-11T16:02:19.000628Z

I'd like to see benchmark on: 2 cljs dependencies as .jar (with cljs sources) in cljs project against the same 2 dependencies pre compiled to modules in cljs project.

johnjelinek 2017-12-11T16:02:30.000839Z

with the way spec/test.check was mentioned in the Clojure 1.9 announcement, it sure does feel like it's part of cljs proper. Cognitect seems to indicate that everything should be done with specs going forward. I think they covered the whole clj codebase in specs too.

johnjelinek 2017-12-11T16:02:50.000212Z

so, I'd love to see it packaged in lumo πŸ˜„

πŸ‘ 1
mfikes 2017-12-11T16:10:50.000049Z

@johnjelinek FWIW, Alex and David gave some insight into the future of Spec's bundling itself here https://clojurians.slack.com/archives/C07UQ678E/p1512749467000280

mfikes 2017-12-11T16:13:48.000585Z

I suppose with test.check bundling it with Lumo (or ClojureScript or Clojure) could lead to a situation where some new generator or desirable feature is added to test.check and you'd simply like to upgrade to the latest release of test.check in order to take advantage of it.

johnjelinek 2017-12-11T16:15:16.000139Z

what's the current path to upgrade to the latest within lumo?

mfikes 2017-12-11T16:15:17.000028Z

I'm starting to become a fan of using the new deps.edn stuff to make all of this dependency management trivial. You can just

lumo -c `clj -Spath`
and easily make use of deps.edn to get all the deps you want.

πŸ‘ 4
johnjelinek 2017-12-11T16:15:30.000648Z

I didn't know that was a thing!

johnjelinek 2017-12-11T16:15:36.000861Z

are there docs for that?

mfikes 2017-12-11T16:16:23.000283Z

@johnjelinek I'd be worried that if you bundled test.check with Lumo, then you wouldn't be able to use some other version without waiting for a new release of Lumo. (Unless Lumo somehow made that possible.)

2017-12-11T16:18:26.000015Z

πŸ‘ as managing dependencies with lumo becomes easier, pulling in things like test.check at will seems preferable to me

mfikes 2017-12-11T16:22:28.000150Z

An advantage of using deps.edn is that if you want test.check in Lumo just put this in deps.edn:

{:deps {org.clojure/test.check {:mvn/version "0.10.0-alpha2"}}}
and start Lumo via
lumo -Kc `clj -Spath`
but if for some reason you find you need to make a change to test.check (to fix a self-host bug), simply revise that to
{:deps {org.clojure/test.check {:local/root "/path/to/your/test-check/tree"}}}
Of course, this requires test.check to have deps.edn also set up, but that ability to easily switch to inter-project dependencies is awesome, IMHO.

mfikes 2017-12-11T16:23:40.000422Z

In other words, I suppose I'm arguing that bundling things into Lumo might make it easier, but things can be simpler if instead you decomplect. πŸ™‚

johnjelinek 2017-12-11T16:29:29.000016Z

wait ... the stuff in deps.edn also have to have a deps.edn? kinda like how npm relies on project.json?

mfikes 2017-12-11T16:30:52.000806Z

No, you can use :mvn/version to point to a Maven JAR and things work normally. It is only the :local/root way of doing it that requires the target path to have a deps.edn file sitting there for that project.

mfikes 2017-12-11T16:32:29.000148Z

Or, perhaps I'm wrong. It seems to auto-detect if lein is there.

mfikes 2017-12-11T16:33:02.000749Z

(See "Local project coordinate" on https://clojure.org/reference/deps_and_cli)

mfikes 2017-12-11T16:33:41.000382Z

"Currently only :deps is supported"

johnjelinek 2017-12-11T17:03:05.000649Z

cool -- does this take a dependency on the JVM to work?

johnjelinek 2017-12-11T17:03:24.000576Z

or will it work with lumo by itself?

pesterhazy 2017-12-11T17:55:51.000553Z

clj requires the JVM

pesterhazy 2017-12-11T17:56:38.000011Z

@mfikes probably better to use clojure instead of clj - the latter is just

$ cat $(which clj)
#!/usr/bin/env bash

if type -p rlwrap >/dev/null 2>&1; then
  rlwrap -r -q '\"' -b "(){}[],^%3@\";:'" clojure "$@"
else
  echo "Please install rlwrap for command editing or use \"clojure\" instead."
fi

pesterhazy 2017-12-11T17:58:48.000132Z

@mfikes also I don't think clojure (the cli tool) depends in any way on leiningen, unless I'm missing something

mfikes 2017-12-11T18:11:00.000253Z

@pesterhazy Yes. Wow, clojure -Spath is even faster. (About 12 ms instead of 43 ms.) Right, the tool doesn't depend on lein at all. It appears that it might support either parsing project.clj or calling out to lein in the future, in the case where you specify a :local/root dependency to a path containing an auto-detected Leiningen-based project. I only say this based on the appearance of :lein in these two bullets β€’ Default is to auto-detect the project type (such as :deps, :lein, :pom) β€’ Currently only :deps is supported at https://clojure.org/reference/deps_and_cli

pesterhazy 2017-12-11T18:11:51.000365Z

got it

pesterhazy 2017-12-11T18:12:51.000538Z

parsing project.clj directly may prove unrealistic, as you need to take into account profiles etc... so you may end up reimplementing lein

pesterhazy 2017-12-11T18:13:10.000517Z

still better than build.boot πŸ™‚

mfikes 2017-12-11T18:13:11.000483Z

Yeah, I agree.

pesterhazy 2017-12-11T18:14:13.000359Z

lumo/planck + clojure seem like a match made in heaven

mfikes 2017-12-11T18:15:46.000017Z

Ideally, Lumo and Planck could just "support" deps.edn directly (thus requiring no JVM), but it seems much more pragmatic to just delegate that functionality to the clojure tool and let it take care of everything for this particular use case.

πŸ‘ 1
mfikes 2017-12-11T18:28:19.000113Z

I'd go even farther and claim that the existence of clojure will cover a lot of the ground that Planck and Lumo cover. In other words, it is fast to start up, is easy to launch, can realistically be used to run Clojure scripts, etc.

mfikes 2017-12-11T18:31:50.000044Z

time clj -e "(+ 1 2)"
takes 880 ms, compared to 196 ms for Lumo and 235 ms for Planck. Not bad at all.

johnjelinek 2017-12-11T18:45:16.000276Z

yes, please support deps.edn natively

mfikes 2017-12-11T18:52:39.000730Z

The challenging aspect is pulling down deps. Even clojure doesn't do that by itself, and delegates to external libs.

pesterhazy 2017-12-11T19:06:27.000578Z

The download itself can't be difficult, but dependency resolution probably is gnarly

pesterhazy 2017-12-11T20:04:40.000347Z

org.eclipse.aether.transport.wagon.WagonTransporterFactory haha

🐴 2
johnjelinek 2017-12-11T22:12:26.000245Z

I think, since lumo is kinda wrapping node ... you could leverage npm to actually download the deps where possible

johnjelinek 2017-12-11T22:12:40.000473Z

that way you're not writing a new system