Fork me on GitHub
#lumo
<
2017-02-27
>
stbgz02:02:24

hey all I updated calvin to support the new lumo build api!

jonpither15:02:58

hi - having trouble building lumo - getting : ....> WARNING: src/node.js doesn't exist. Trying 'lib/internal/bootstrap_node.js' ....> WARNING: src/node.js doesn't exist. Trying 'lib/internal/bootstrap_node.js' ----> already patched http://node.cc ----> make Please use either Python 2.6 or 2.7 File "tools/getnodeversion.py", line 20 print '%(major)s.%(minor)s.%(patch)s'% locals() ^ SyntaxError: invalid syntax File "tools/getnodeversion.py", line 20 print '%(major)s.%(minor)s.%(patch)s'% locals() ^

dominicm15:02:26

@jonpither just understood what you meant previously about LUMO_ADD_CLASSPATH: I belive those are internals which already exist & are being exposed.

jonpither15:02:04

@dominicm trying to figure out how to call addSourcePaths from inside... failing

dominicm15:02:06

@jonpither The scripts may be pointing at #!/usr/bin/python which on Arch is Python3, they may need changing to #!/usr/bin/env python2 for arch

jonpither15:02:26

@dominicm That's all you need right, to call addSourcePaths from inside the REPL and it would work

dominicm15:02:58

@jonpither If the PR is merged, yes

anmonteiro15:02:25

I wanna merge that PR eventually but it needs a ton of work

anmonteiro15:02:57

The directory structure changed recently, the Lumo globals too, and it needs tests

jonpither15:02:16

isn't the only line we need addSourcePaths: lumo.addSourcePaths, in cljs.js

jonpither15:02:32

i.e. export that one fn

anmonteiro15:02:57

For the most basic functionality, yes

jonpither15:02:27

is there anyway to call that fn in the current lumo?

anmonteiro15:02:02

If it's not in the context globals, no

anmonteiro15:02:43

I'm happy to merge a PR adding just that while work on the other PR is still in progress

malcolmsparks15:02:05

Even if you have a dynamic classpath, I'm struggling to 'require' symbols dynamically - I assume you can only do this at the top-level

malcolmsparks15:02:46

If anyone on the channel has any ideas, let me know

malcolmsparks15:02:19

I'm getting this error

dominicm15:02:00

@jonpither https://github.com/nexe/nexe/issues/280 looks like nexe downloads node & then executes some python to find the node version (yeah, okay). Anyway, on arch, that python is pointing at the wrong version!

anmonteiro15:02:23

@malcolmsparks require can only appear at the top of the file

anmonteiro15:02:27

TBH I think Lumo scripts could probably support dynamic requires

anmonteiro15:02:43

but that's a Lumo capability, regular ClojureScript will never be able to support it

dominicm15:02:22

@anmonteiro To confirm: that does mean that even being able to modify the classpath dynamically, even just for now, doesn't mean that you can require new stuff yet?

anmonteiro15:02:01

Probably not from the same script that modifies the classpath

anmonteiro15:02:26

I didn't realize that this was your end goal, sorry

dominicm16:02:42

Now I'm extremely curious, what else could modifying the classpath be used for?! Also, you couldn't require another file after modifying the classpath could you?

dominicm16:02:02

ah, okay. That makes sense

anmonteiro16:02:12

1. Start Lumo; 2. Add something to the classpath; 3. Require it

anmonteiro16:02:08

People don't like leaving the REPL. Even if it only takes them another 200ms to start a new one 🙃

jonpither17:02:09

@anmonteiro raised a PR. Allows me to do the following: cljs.user=> (js/$$LUMO_GLOBALS.addSourcePaths ["aero-1.1.2.jar"]) nil cljs.user=> (require '[aero.core]) nil cljs.user=>

jonpither17:02:31

the goal isn't to do this like the above, but for tooling incorporating lumo to do it

anmonteiro17:02:34

looks good, will merge after CI runs

anmonteiro17:02:14

btw, anyone relying on js/$$LUMO_GLOBALS should be aware these are internal APIs and subject to change in future versions of Lumo

anmonteiro17:02:51

ATM those are just a hack that allow me to use some functions without requiring Node stuff (because of custom startup snapshots)

anmonteiro18:02:49

@jonpither just realized that this may not fully work in some cases, esp. on windows

anmonteiro18:02:18

but that’s not your problem 🙂

anmonteiro18:02:39

we should be calling this for every source path that’s added https://github.com/anmonteiro/lumo/blob/master/src/js/util.js#L15

anmonteiro18:02:00

I’ll open an issue so that I don’t forget