lumo

:lumo: Standalone ClojureScript environment. Currently at version 1.9.0
rberger 2017-08-16T06:45:30.000164Z

Have an example script doing the kind of things I hope to do with Lumo and Clojurescript as a replacement for Bash scripts at https://github.com/omnypay/semver-from-git I ended up not being able to use npm libraries for things like git operations and instead just shelled out to the git executable. Main problem was the issue of almost all the npm libraries being async oriented. I couldn’t figure out how to cleanly use core.async (andare) since there is no support for blocking operations in JS. I could make it work, but could not figure out how to still have nice bitesized functions that return values. Everything ended up returning the channel of the go block. I was able to publish the program as an npm package though which was one of my key goals. https://www.npmjs.com/package/semver-from-git Would appreciate any constructive feedback or suggestions for improvement! I’m hoping it can help increase the number of full fledged examples of how to use lumo.

dominicm 2017-08-16T08:19:58.000363Z

@anmonteiro could a macro be built using js* for writing functions like async function() { }?

pesterhazy 2017-08-16T10:32:01.000078Z

@rberger looks like the github page 404s?

pesterhazy 2017-08-16T10:33:11.000274Z

honestly I think core.async may be overkill for a shell script in many cases anyway (plus I think I remember hearing that it takes a long time to compile in lumo)

pesterhazy 2017-08-16T10:33:31.000282Z

why not start with callbacks/promises and go from there?

2017-08-16T12:42:31.000110Z

takes long time to compile, but you can always direct lumo to a cache directory and then it's subsecond after that.

richiardiandrea 2017-08-16T14:08:11.000433Z

has anybody ever seen:

failed compiling file:out/cljs/core.cljs
	 (new)
	 Function.cljs.core.ex_info.cljs$core$IFn$_invoke$arity$3 (NO_SOURCE_FILE <embedded>:1934:200)
	 (evalmachine.<anonymous>:609:25)
	 Function.lumo.compiler.compile_file.cljs$core$IFn$_invoke$arity$4 (evalmachine.<anonymous>:616:4)
	 (Object.lumo$closure$compile_file)
	 (evalmachine.<anonymous>:1625:21)
	 (Object.lumo$closure$_compile)
	 (Object.lumo$closure$compile_from_jar)
	 (evalmachine.<anonymous>:1660:21)
	 (Object.lumo$closure$_compile)

should never happen!
	 (new)
	 Function.cljs.core.ex_info.cljs$core$IFn$_invoke$arity$3 (NO_SOURCE_FILE <embedded>:1934:200)
	 Function.cljs.core.ex_info.cljs$core$IFn$_invoke$arity$2 (NO_SOURCE_FILE <embedded>:1934:88)
	 (Object.lumo$io$slurp)
	 (Object.lumo$compiler$emit_cached_core)
	 (evalmachine.<anonymous>:482:28)
	 Function.lumo.compiler.with_core_cljs.cljs$core$IFn$_invoke$arity$2 (evalmachine.<anonymous>:231:85)
	 Function.lumo.compiler.compile_file_STAR_.cljs$core$IFn$_invoke$arity$4 (evalmachine.<anonymous>:461:41)
	 (evalmachine.<anonymous>:586:41)
	 Function.lumo.compiler.compile_file.cljs$core$IFn$_invoke$arity$4 (evalmachine.<anonymous>:616:4)

richiardiandrea 2017-08-16T14:09:29.000394Z

trying a simple: lumo -c src scripts/lumo_build.cljs

richiardiandrea 2017-08-16T14:10:07.000568Z

repro repo here: https://github.com/arichiardi/lumo-repros

pesterhazy 2017-08-16T15:56:17.000785Z

@richiardiandrea yeah i've seen that

pesterhazy 2017-08-16T15:56:26.000395Z

it's when you slurp the wrong type

pesterhazy 2017-08-16T15:57:08.000327Z

I didn't see it during compilation though?!

richiardiandrea 2017-08-16T15:58:04.000206Z

yeah I don't know what I am doing wrong (hopefully Antonio can have a look there)

anmonteiro 2017-08-16T16:09:44.000045Z

@richiardiandrea try setting source-map to false

richiardiandrea 2017-08-16T16:09:59.000678Z

k trying

richiardiandrea 2017-08-16T16:11:02.000262Z

worked!

richiardiandrea 2017-08-16T16:11:33.000186Z

so that means I need to have source-map-support in node_modules or it is a real little bug?

richiardiandrea 2017-08-16T16:11:42.000221Z

(I can report it)

anmonteiro 2017-08-16T16:14:40.000414Z

It's reported

anmonteiro 2017-08-16T16:15:18.000391Z

This is because we're blacklisting cljs/core.js.map from the binary

richiardiandrea 2017-08-16T16:16:24.000588Z

k cool thanks a lot

rberger 2017-08-16T16:17:35.000049Z

@pesterhazy Oops, forgot to make it public, https://github.com/omnypay/semver-from-git is now public