Fork me on GitHub

@yonatanel Happy to adjust where we can if you think of a better way to phrase/place it.


@richiardiandrea @mfikes Replumb looks really good for an Onyx JS-Fiddle.. Which I suppose we need a name for . 🙂


So after playing around for a few hours, is my understanding correct that the library implementing cljs.js/eval is supposed to take care of *load-fn*?


@michaeldrogalis Yes. I’d recommend Replumb if you are looking for a conventional REPL experience and Klipse if you want live forms that are evaluated with their output placed in another place in the browser.


@michaeldrogalis Yes, but Replumb and Klipse both help implement *load-fn*


Klipse might do better, then. I had been taking care of live evaluation on my own. Even better if its off loaded.


@michaeldrogalis thanks! mfikes is the master of names, we came up with Replumb together basically ;)


Btw Klipse uses Replumb


Here is a good canonical example of what Klipse can look like:


I think viebel uses his own *load-fn* in there so that he can handle loading namspaces from GitHub


@richiardiandrea Nice. This doesn't seem like a hard task then, tbh.


@richiardiandrea Oh woah, how does that work?


@mfikes This seems right on the money. @lucasbradstreet Roughly what you were thinking too?


Yes… and he optimized the sh*t out of it so it can be fast


(In case, @michaeldrogalis you were considering going low-level for perf reasons, Klipse has strived to be fast.)


Brings a tear to my eye so I don't have to do that. 😛


I am going to summon @viebel because I don't know the details, in theory it is a kind of a network get I guess


Hello @viebel! You've done some mighty cool stuff. 🙂


Here it is on github so you need not go digging for it:


This is beautiful.


Yeah, as I was saying to @mfikes on Twitter, it'd be nice if we could lift everything in onyx-examples out of the repo so people can play with them without any set up.

Yehonathan Sharvit15:10:50

This is exactly the goal of klipse


Goal achieved, sir.

Yehonathan Sharvit15:10:51

Did you check codox klipse theme?


How have I never seen this before?! o_o


This is amazing!

Yehonathan Sharvit15:10:11

Do you have already a live demo snippet for onyx?


Just be aware that you can work around by evaluating the two js* forms that are at the top of the picture in my tweet


Yes. The dep below, plus the code snippet, work straight away in Cljs:


Yeah it is cool stuff


@mfikes Cool, I had missed that the first time. I wasn't sure if that was to quiet the warning or something, the Jira post was helpful.

Yehonathan Sharvit16:10:55

@michaeldrogalis does the code work on klipse?


Since it requires an external dep, I assume not, but @richiardiandrea was mentioning that it can resolve things from GitHub?


@michaeldrogalis The js* forms are to work around a bug in order to get things to function; the warning is this one and can be turned off programmatically


@mfikes Makes sense, this is super helpful


You can also apply my patch in the ticket, make your own local ClojureScript compiler, and work with that one.


Awesome, this all seems easy enough. Thanks to everyone's excellent work here to put together. 🙂

Yehonathan Sharvit16:10:53

@michaeldrogalis for external deps you need to use data-external-libs attribute as documented here


Cool, going to need a little while before I can get it set up, but this seems to fit the bill nicely.

Yehonathan Sharvit16:10:52

See for instance how I’m using clojure.math.combinatorics in the source of this page


How exactly is the GitHub resolution working under the hood, out of curiosity?

Yehonathan Sharvit16:10:18

you provide an array of external-libs that are the url prefixes of your repository

Yehonathan Sharvit16:10:35

and my custom load-fn will look for the source files there

Yehonathan Sharvit16:10:37

for instance for onyx the external-libs will be:



@viebel That's so cool. Really incredible work my friend.

Yehonathan Sharvit16:10:50

thank you so much!

Yehonathan Sharvit16:10:01

I can’t wait to se a demo of onyx with klipse

Yehonathan Sharvit16:10:31

I’m trying to make the code of the README work in klipse but there are issues


Close! The warning @mfikes mentioned is here: #error {:message "ERROR in file", :data {:tag :cljs/analysis-error}, :cause #object[TypeError TypeError: Cannot read property 'default_vals' of undefined]}


I think we'll need to handle that on our own.

Yehonathan Sharvit16:10:05

So it can’t work for the moment?


I think either needs to be resolved, or we sub in (js* "goog.provide('onyx.static$.default_vals');") and (js* "goog.provide('onyx.static$util');) somewhere.


Not Klipse's fault 🙂

Yehonathan Sharvit16:10:15

@mfikes how were you able to run onyx in Planck?


I think compilation munges onyx.static.default_vals to onyx.static$.default_vals because onyx.static.default-vals has a javascript reserved keyword in it. Not sure if that’s an issue here


@viebel See my tweet, it has all the details right in the picture:

Yehonathan Sharvit16:10:38

Can you put the code here so I can copy/paste it?

Yehonathan Sharvit16:10:10

I see it jus above


@michaeldrogalis That error can be worked around with the js* forms (at least in Planck)


(js* "goog.provide('onyx.static$.default_vals');")
(js* "goog.provide('onyx.static$util');")


Things I never thought I'd be doing when I started a dist sys project - munging JS reserved words 😛

Yehonathan Sharvit16:10:16

Now, I’m encountering another error:

#error {:message "No such namespace: onyx.refinements, could not locate onyx/refinements.cljs, onyx/refinements.cljc, or Closure namespace \"onyx.refinements\"", :data {:tag :cljs/analysis-error}}


@viebel Does your tool let you specify the branch to resolve from? The work needed to get Onyx run on Cljs isnt in develop yet since I havent had enough reviewers, so its on


If not, I can provisionally move it to master.

Yehonathan Sharvit16:10:15

OK will make external-libs pointing to cljc-triggers branch


Should do the trick. Thanks for helping us. 😃


Holy cow, it works


Soooo really all that's left to do is build up our examples to have Klipse links, and we're done.

Yehonathan Sharvit16:10:04

Not yet: For the moment, one has to run the following in the console


Yehonathan Sharvit16:10:41

@mfikes do you know why prepending the js* stuff didn’t solve the problem?

Yehonathan Sharvit16:10:50

(js* "goog.provide('onyx.static$.default_vals');")
(js* "goog.provide('onyx.static$.util');")

(ns my.onyx
  (:require [onyx-local-rt.api :as api]))

Yehonathan Sharvit16:10:03

I had to run the goog.provide in the console!

Yehonathan Sharvit16:10:39

@michaeldrogalis instead of links to klipse repl, it would be much cooler to have a html page with embedded interactive code snippets


I Love Open Source, good job guys


@viebel Is your goog.provide issue resolved?


@richiardiandrea Applause all around. 🙂


So, you can’t put forms prior to an ns form in a conventional namespace.


Ah, I didnt know that either.

Yehonathan Sharvit17:10:12

That’s not the problem

Yehonathan Sharvit17:10:42

I figured out that I can put forms prior to ns but the code will run only after the deps are resolved

Yehonathan Sharvit17:10:42

but that’s not a showstopper @michaeldrogalis

Yehonathan Sharvit17:10:34

In the html page with interactive snippets, you could add a



That's a fine solution. cc @colinhicks I think we have a few places where we can go with this.


Linking out to the repl might be a good first solution since its so easy.

Yehonathan Sharvit17:10:59

but how will you solve/workaround the goog.provide issue?


I suppose forking would be a suboptimal solution 🙂


Could do a hosted page with exactly one interactive snippet. 😛

Yehonathan Sharvit17:10:35

hosted page with one snippet - Sounds good to me!


Might take a shot at this tonight since its already close.


Will definitely ping everyone on Twitter when it's working. ^^

Yehonathan Sharvit17:10:27

It takes a bit of time to load - but it it is much less time (and effort) that cloning the repo and running it locally


Yeah, longer load time is normal for Onyx.


Can the output be pretty printed at the bottom?

Yehonathan Sharvit20:10:40

@michaeldrogalis working on pretty printing ...


@viebel Ah, okay. I didn't know if it was an out of the box option. I don't want to put you to work or anything, I can dig in on it later if you're busy.

Yehonathan Sharvit20:10:00

anyway it’s a good feature

Yehonathan Sharvit20:10:07

Happy to make it for you


Hey, the Klipse approach is cool!


I've been thinking: For the tutorials, it may not be necessary to compile the whole runtime in Klipse (or other browser-based REPL) ...


That is, the runtime could already be compiled to JS, and available to the page. And we just ask the tutorial taker to define the job map, user-defined functions, etc.


Huh - yeah that's a solid idea @colinhicks.

Yehonathan Sharvit20:10:47

The problem is from a maintenance side

Yehonathan Sharvit20:10:08

every time you update onyx, you’ll have to remember to compile to js


We have a pretty extensive automated release process. Incidentally that piece isn't too bad for us.


Had to invest in a lot of infrastructure to manage all the subprojects of Onyx.

Yehonathan Sharvit20:10:42

You’ll also have to update the analysis cache files

Yehonathan Sharvit20:10:06

boostrapped cljs needs them for validating function calls etc...

Yehonathan Sharvit20:10:27

Pretty print is out!!!!

Yehonathan Sharvit20:10:53

You might need to empty your browser cache

Yehonathan Sharvit20:10:07

Make sure in the console that you get klipse version 3.3.0


Hmm, yeah that might not be so good then


Oh, the "empty cache" comment was unrelated to the above. Nevermind


Ahhhh beautiful!


@viebel gets today's gold star.

Yehonathan Sharvit20:10:23

I don’t find the appropriate emoji

Yehonathan Sharvit20:10:35

I just wanted to say: I’M TOUCHED!

Yehonathan Sharvit20:10:20

going to sleep now...

Yehonathan Sharvit20:10:34

It’s already 11:30 PM here


Sleep well, thanks for helping us. 🙂


Remove drain and stop and replacing with:

Shows you show the segments move throughout the job.


Or whatever number of tick calls you want to see.


which will be cool for a visualization


it would be really cool to eventually have an interactive version of this

Yehonathan Sharvit20:10:49

Instead of the gist you could have an interactive snippet 😎


So now that Onyx has the local runtime library, would it be reasonable to learn and use it for programs that would otherwise have no real use for it (for example, in a single page app or a program that will only ever run on 1 server)? I have no real need for it, so the amount of upfront configuration and learning has put me off learning it until now.


It's a wonderful programming model if you want a way to structure your computation to be easily scaled across multiple machines in the future.


@gardnervickers: Are there any substantial benefits outside of scalability that you've found with it in use, or any types of problems that Onyx is really well suited for even if there is no possibility of ever scaling?


It forces you to think about where state lives inside your computation. That's really the big benefit. By acknowledging where state exists and is changed in your computation, distributing it becomes much much easier. So much so, Onyx can do it for you 😄


The model Onyx requires is a pretty good general purpose one, though weighing a different model versus Onyx's is highly dependent on what you're trying to do.


@gardnervickers: Yeah, it seems very well thought out when looking at it from the outside - I'll probably try it at some point once more experienced users have had some more time to use the local runtime. Thanks for the help!


@shaun-mahood That is the idea, yes. Decouple the programming model from its runtime was a goal. It's good for any "flow"-type domain


@michaeldrogalis: Good to know, thanks - I think I have a couple areas in my programs where it could clean things up. The talks have all been super interesting so it's great that the barrier to entry is so much lower.


@shaun-mahood We're quite pleased with that too. Enjoy the programming model. 🙂