Clojurians
#lumo
<
2017-12-11
>

This page is not created by, affiliated with, or supported by Slack Technologies, Inc.

bhurlow14:12:13

@mfikes yep, I always set -K

mfikes14:12:15

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

hlolli14:12:57

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.

hlolli14:12:19

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

bhurlow14:12:03

@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

bhurlow14:12:44

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

hlolli15:12:08

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.

mfikes15:12:18

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

hlolli15:12:34

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.

bhurlow15:12:43

@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

hlolli15:12:55

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

bhurlow15:12:57

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

hlolli15:12:33

yes, ofc :slightly_smiling_face: I think we should do more of it

hlolli16:12:19

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.

johnjelinek16:12:30

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.

johnjelinek16:12:50

so, I'd love to see it packaged in lumo :smile:

mfikes16:12:50

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

mfikes16:12:48

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.

johnjelinek16:12:16

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

mfikes16:12:17

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.

johnjelinek16:12:30

I didn't know that was a thing!

johnjelinek16:12:36

are there docs for that?

mfikes16:12:23

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

bhurlow16:12:26

:+1: as managing dependencies with lumo becomes easier, pulling in things like test.check at will seems preferable to me

mfikes16:12:28

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.

mfikes16:12:40

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

johnjelinek16:12:29

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

mfikes16:12:52

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.

mfikes16:12:29

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

mfikes16:12:41

"Currently only :deps is supported"

johnjelinek17:12:05

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

johnjelinek17:12:24

or will it work with lumo by itself?

pesterhazy17:12:51

clj requires the JVM

pesterhazy17:12:38

@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 "(){}[],^%[email protected]\";:'" clojure "[email protected]"
else
  echo "Please install rlwrap for command editing or use \"clojure\" instead."
fi

pesterhazy17:12:48

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

mfikes18:12:00

@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

pesterhazy18:12:51

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

pesterhazy18:12:10

still better than build.boot :slightly_smiling_face:

mfikes18:12:11

Yeah, I agree.

pesterhazy18:12:13

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

mfikes18:12:46

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.

mfikes18:12:19

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.

mfikes18:12:50

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

johnjelinek18:12:16

yes, please support deps.edn natively

mfikes18:12:39

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

pesterhazy19:12:27

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

pesterhazy20:12:40

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

johnjelinek22:12:26

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

johnjelinek22:12:40

that way you're not writing a new system