Clojurians
#lumo
<
2017-02-21
>

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

mfikes03:02:30

FWIW, the expression

(go (let [c (async/chan)] (async/>! c 666) (println (async/<! c ))))
Doesn’t cause the println to be triggered in Clojure (with the official core.async), nor in ClojureScript, nor in Planck with Andare. I haven’t thought deeply about this.

hlolli12:02:31

@mfikes yes I can confirm that. Andre seems to be behaving exacly the same as core.async. I need sanity check, so I ask at the #core-async what's going on.

hlolli13:02:58

unrelated to lumo but some core.async 101 knowledge missed my conciousness. (chan) always has room for one value, so when I put something on it >!, it waits blockingly for someone to take it, so this needs to be either two go statements to print from a channel, or using the number 1 (chan 1), actually adds a buffer, so how I see it, it has space for one value before it starts blocking.

anmonteiro15:02:31

for those of you wondering what the next version of Lumo would include: https://twitter.com/anmonteiro90/status/834064263245279233

anmonteiro15:02:33

:slightly_smiling_face: :slightly_smiling_face:

nwjsmith15:02:50

This is fantastic!

doglooksgood16:02:52

Does lumo support defmacro in version 1.2.0?

anmonteiro16:02:10

Lumo has supported defmacro since its first release

anmonteiro16:02:41

@doglooksgood but know that macros have ClojureScript semantics

anmonteiro16:02:06

Which means they need to be defined in a separate compilation stage than when they're used

anmonteiro16:02:32

Mike Fikes has a number of posts on this, I'll link to them when I'm at a computer

stbgz16:02:42

@anmonteiro that is awsome, I was working on the exact same thing and we endend up implementing things pretty similarly

stbgz16:02:13

one key difference is that I decided to make the classpath an atom

stbgz16:02:48

that can be updated at any point to allow for flexibility in loading dependencies at any point

doglooksgood16:02:50

@anmonteiro then how can I get this separate compilation stage? writing macro in another file or writing some code in lumo's source code then recompile it?

mfikes16:02:56

@doglooksgood The usual way is to write macros in another file. Self-hosted ClojureScript is essentially like regular ClojureScript in this respect, with the salient difference being that macros namespaces are compiled as ClojureScript instead of as Clojure—even if the macros namespace is in a file named foo.clj

doglooksgood16:02:14

@anmonteiro @mfikes thanks, I'm going to have a try.

mikebelanger17:02:33

wow - just tried 1.2, JVM-less advanced compilation is pretty awesome!

anmonteiro17:02:15

@stbgz I wanted to put in some of the legwork so that we can all collaborate on one thing now :slightly_smiling_face:

anmonteiro17:02:38

the classpath can also be updated dynamically. I’ll merge @npeckman ‘s work soon

anmonteiro17:02:44

@mikebelanger thanks! there’s a lot of stuff to iron out still but it’s a start

stbgz17:02:48

great! that’ll go a long way I think , my idea with the atom was to have listeners on it so that if you update it it’ll trigger a recompile, etc

mikebelanger17:02:38

If the target optimization to :none, is there a way of dialing into a repl? Doesn't look like lumo --classpath src build.cljs --repl does it.

anmonteiro17:02:04

not at the moment

mikebelanger17:02:17

@anmonteiro ah cool, no probs

doglooksgood17:02:34

@anmonteiro Nice post, thanks!

mikebelanger17:02:27

@anmonteiro still feels great to just compile cljs with so little project configuration.

anmonteiro17:02:56

I agree. I still can’t believe it myself, thanks :slightly_smiling_face:

npeckman17:02:24

Excited to play around with the compilation soon! It's so cool to be close to a groundbreaking project like this

dominicm17:02:19

@anmonteiro did you benchmark performance at all?

anmonteiro17:02:31

nothing serious

anmonteiro17:02:50

@dominicm the same project takes like 55 seconds in Lumo and 5 seconds on the JVM

anmonteiro17:02:58

small project with advanced optimizations

anmonteiro17:02:04

which is a lot

anmonteiro17:02:22

I think this is something we need to take upstream with the Google Closure Compiler team

dominicm17:02:43

Yeah, not a huge surprise to me. Nodejs is generally slow for this kind of work.

dominicm17:02:49

Mostly curious.

mikebelanger17:02:58

Just to be even more meta, would it be possible to create an embedded repl using lumo-compiled clojurescript?

anmonteiro17:02:49

who knows :slightly_smiling_face:

anmonteiro17:02:51

You can do any sorts of meta stuff now

anmonteiro17:02:16

the problem I had (and still didn’t solve) is that I couldn’t compile clojure.browser.repl

anmonteiro17:02:51

maybe we can just include a precompiled one or something but I haven’t given it any more thought

mikebelanger18:02:14

@anmonteiro no problem, good to know its theoretically possible, that clojure.browser.repl is the next thing to look at