lumo

:lumo: Standalone ClojureScript environment. Currently at version 1.9.0
jimmy 2017-06-02T04:19:02.084916Z

hi guys, is there any good example using lumo with Google Cloud Functions ? or can we compile cljs within lumo to js then run it with Google Cloud Functions ?

stbgz 2017-06-02T04:55:48.325501Z

hey @nxq I created a home action using clojurescript hosted in aws lambda, unfortunately that code is private šŸ˜•

stbgz 2017-06-02T04:57:56.339493Z

I used this library to do most of the wrapping https://github.com/nervous-systems/cljs-lambda, not sure if itā€™ll be helpful

jimmy 2017-06-02T05:07:47.406919Z

Thanks for your info. I will check it out.

2017-06-02T13:34:38.765086Z

I just setup a simple lumo build with (.log js/console ā€œHiā€) source file. It takes 70s to build on my 3-year-old i7 MBPro and if I change :optimizations to anything other than advanced it barfs a meaningless error. Any pointers?

2017-06-02T13:36:22.801079Z

what's the barf, are you using lumo.build-api/build?

2017-06-02T13:37:39.827386Z

this works (fast) compil1.cljs

(ns compil1)

(println "hello world")
build.cljs
(require '[lumo.build.api :as b])

(b/build "./"
         {:main 'compil1
          :output-dir "out"
          :optimizations :simple})

% lumo build.cljs

2017-06-02T13:40:36.887023Z

(require ā€˜[lumo.build.api :as b]) (b/build ā€œsrcā€ {:main ā€˜lumo1.core :output-to ā€œmain.jsā€ :optimizations :none :target :nodejs})

2017-06-02T13:41:24.903071Z

(ns lumo1.core) (.log js/console ā€œHiā€)

2017-06-02T13:42:47.931077Z

try it on my computer...

2017-06-02T13:49:17.069613Z

this most likely means that the build didn't locate any file

2017-06-02T13:49:51.081598Z

It worked with :optimizations :advanced

2017-06-02T13:50:20.092305Z

If you call a 70s compile ā€œworkedā€

2017-06-02T13:50:26.094773Z

no, yes

2017-06-02T13:50:34.097444Z

you're right, I get the same

2017-06-02T13:51:48.124339Z

I had to move from src to same working directory too. Feels like the source file lookup is broken. But anmonteiro would know better.

2017-06-02T13:52:44.145454Z

70s is the time needed for advanced I guess, since it isn't using any cacheing. Lumo is usually slow to start the first time because of that.

2017-06-02T13:52:46.146060Z

I took the code sample from his blog as well: https://anmonteiro.com/2017/02/compiling-clojurescript-projects-without-the-jvm/

2017-06-02T13:54:05.174689Z

are you using lumo with node8.0.0?

2017-06-02T13:54:14.178094Z

Sorry, what do you mean by ā€œfirst timeā€? I donā€™t see anything resembling incremental compilation in a simple tool like Lumo.

2017-06-02T13:54:30.183967Z

Lumo uses its own Node version, no?

2017-06-02T13:54:47.190218Z

Yes, Iā€™m using Node 8.0 otherwise.

2017-06-02T13:54:53.192302Z

it compiles node, you can see the version when you start lumo

2017-06-02T13:55:15.200947Z

The version in Lumo differs from my installed version

2017-06-02T13:57:09.244050Z

ok so it's the last release, I also see that this only happens with :optimizations :none, :whitespace and :simple work.

2017-06-02T13:57:24.249883Z

so yes, you want to create a ticket?

2017-06-02T13:57:52.260Z

:whitespace didnā€™t work for me

2017-06-02T13:58:21.271006Z

yes, not for me either sorry

2017-06-02T13:58:54.283184Z

I'm running on node 8, latest master of lumo. So it's still a problem.

2017-06-02T13:59:33.298232Z

Hmm. I think the fanfare needs to die down a bit before Lumo is usable. Sorry.

2017-06-02T14:00:41.326843Z

I don't know where you got your high assumptions from.

2017-06-02T14:06:00.450098Z

If you ask me, I don't see any fanfare because very few people are using lumo, especially not the build.api whereas jvm cljsbuild is much more battle tested and with figwheel development. The fact that it's so little used is one big factor why this has been overseen.

2017-06-02T14:08:17.501624Z

Well, thatā€™s my point really. The Lumo REPL canā€™t use Clojure libs and I donā€™t see any advantage over lein-cljsbuild + nodemon as far as compilation speed goes.

2017-06-02T14:10:03.541457Z

yes, I would never use lumo to do frontend development at this point in time.

2017-06-02T14:10:17.546912Z

My mistake. I just saw the blog post and assumed Lumo had taken off.

anmonteiro 2017-06-02T15:17:11.166012Z

@clojer I never said Lumo was ready for general usage, especially the build API

borkdude 2017-06-02T15:17:55.183792Z

Lumo is great for scripting

anmonteiro 2017-06-02T15:18:18.193579Z

If you read my blog post about compiling projects, you probably noticed: 1. It's an alpha feature 2. The slow compile times are coming from the Closure Compiler JS upstream

anmonteiro 2017-06-02T15:18:34.199901Z

It's not related to first time or not

anmonteiro 2017-06-02T15:21:26.268680Z

@clojer I really appreciate you trying out Lumo! But I don't think it's helpful to complain about goals that the project never had (being faster than the JVM to compile - simply because JVM CLJS will probably always be faster)

anmonteiro 2017-06-02T15:22:37.297012Z

We're well aware there are issues, and every bit of help is necessary to fix them, be it reporting bugs, trying new features or even lending a helping hand and fixing them

stbgz 2017-06-02T15:45:21.840465Z

@clojer why exactly canā€™t you use clojure libs? you mean jvm clojure libs?

p 2017-06-02T22:24:15.432579Z

Hey, any reason why the ZMQ npm module isn't loading? Here's my script: https://github.com/paullucas/lumo-misc/blob/master/zmq/zmq-test.cljs I'm getting the following error:

libstdc++.so.6: cannot open shared object file: No such file or directory
	 Object.Module._extensions..node (module.cljs:598:18)
	 Module.load (module.cljs:488:32)
	 tryModuleLoad (module.cljs:447:12)
	 Function.Module._load (module.cljs:439:3)
	 Module.require (module.cljs:498:17)
	 require (internal/module.cljs:20:19)
	 Object.<anonymous> (/home/plll/Code/lumo-misc/zmq/node_modules/zeromq/lib/index.cljs:6:11)
	 Module._compile (module.cljs:571:32)
	 Object.Module._extensions..js (module.cljs:580:10)
	 Module.load (module.cljs:488:32)

anmonteiro 2017-06-02T22:25:06.441569Z

@paulll need more info about your setup

anmonteiro 2017-06-02T22:25:07.441864Z

Linux?

p 2017-06-02T22:25:16.443430Z

Yup! NixOS.

anmonteiro 2017-06-02T22:25:17.443594Z

Lumo version?

p 2017-06-02T22:25:29.445785Z

Lumo 1.5.0
ClojureScript 1.9.542
Node.js v7.10.0

anmonteiro 2017-06-02T22:26:14.453630Z

hrm

anmonteiro 2017-06-02T22:26:40.457957Z

so hereā€™s what I think is happening: ZeroMQ has some native module and it canā€™t link against NixOSā€™s weird paths

anmonteiro 2017-06-02T22:27:21.464854Z

@paulll my theory will be wrong if youā€™re able to load the module in Node.js

p 2017-06-02T22:28:48.479385Z

Hmm, I am able to run it with Node. Ran the publisher example and it seems to work:

var zmq = require('zeromq')
  , sock = zmq.socket('pub');

sock.bindSync('<tcp://127.0.0.1:3000>');
console.log('Publisher bound to port 3000');

setInterval(function(){
  console.log('sending a multipart message envelope');
  sock.send(['kitty cats', 'meow!']);
}, 500);

anmonteiro 2017-06-02T22:30:21.495523Z

thatā€™s weird

anmonteiro 2017-06-02T22:30:40.498987Z

it might be related to https://github.com/anmonteiro/lumo/issues/163

anmonteiro 2017-06-02T22:30:51.500904Z

but it could also be some Nix issue šŸ˜ž