Fork me on GitHub
#lumo
<
2017-06-02
>
jimmy04:06:02

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 ?

stbgz04:06:48

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

stbgz04:06:56

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

jimmy05:06:47

Thanks for your info. I will check it out.

clojer13:06:38

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?

hlolli13:06:22

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

hlolli13:06:39

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

clojer13:06:36

(require ‘[lumo.build.api :as b]) (b/build “src” {:main ‘lumo1.core :output-to “main.js” :optimizations :none :target :nodejs})

clojer13:06:24

(ns lumo1.core) (.log js/console “Hi”)

hlolli13:06:47

try it on my computer...

hlolli13:06:17

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

clojer13:06:51

It worked with :optimizations :advanced

clojer13:06:20

If you call a 70s compile “worked”

hlolli13:06:34

you're right, I get the same

hlolli13:06:48

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

hlolli13:06:44

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.

hlolli13:06:05

are you using lumo with node8.0.0?

clojer13:06:14

Sorry, what do you mean by “first time”? I don’t see anything resembling incremental compilation in a simple tool like Lumo.

clojer13:06:30

Lumo uses its own Node version, no?

clojer13:06:47

Yes, I’m using Node 8.0 otherwise.

hlolli13:06:53

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

clojer13:06:15

The version in Lumo differs from my installed version

hlolli13:06:09

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

hlolli13:06:24

so yes, you want to create a ticket?

clojer13:06:52

:whitespace didn’t work for me

hlolli13:06:21

yes, not for me either sorry

hlolli13:06:54

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

clojer13:06:33

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

hlolli14:06:41

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

hlolli14:06:00

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.

clojer14:06:17

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.

hlolli14:06:03

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

clojer14:06:17

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

anmonteiro15:06:11

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

borkdude15:06:55

Lumo is great for scripting

anmonteiro15:06:18

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

anmonteiro15:06:34

It's not related to first time or not

anmonteiro15:06:26

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

anmonteiro15:06:37

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

stbgz15:06:21

@clojer why exactly can’t you use clojure libs? you mean jvm clojure libs?

p22:06:15

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)

anmonteiro22:06:06

@paulll need more info about your setup

p22:06:16

Yup! NixOS.

anmonteiro22:06:17

Lumo version?

p22:06:29

Lumo 1.5.0
ClojureScript 1.9.542
Node.js v7.10.0

anmonteiro22:06:40

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

anmonteiro22:06:21

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

p22:06:48

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('');
console.log('Publisher bound to port 3000');

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

anmonteiro22:06:21

that’s weird

anmonteiro22:06:51

but it could also be some Nix issue 😞