This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-10-24
Channels
- # arachne (1)
- # aws (1)
- # beginners (43)
- # boot (67)
- # cider (7)
- # cljs-dev (14)
- # cljsjs (6)
- # clojure (215)
- # clojure-czech (2)
- # clojure-dev (12)
- # clojure-dusseldorf (2)
- # clojure-italy (1)
- # clojure-russia (22)
- # clojure-spec (2)
- # clojure-uk (33)
- # clojurescript (85)
- # cryogen (2)
- # cursive (1)
- # datascript (22)
- # datomic (18)
- # dirac (8)
- # hoplon (9)
- # klipse (1)
- # lein-figwheel (5)
- # leiningen (126)
- # off-topic (1)
- # om (57)
- # onyx (159)
- # pedestal (33)
- # planck (2)
- # re-frame (52)
- # reagent (3)
- # ring (2)
- # ring-swagger (16)
- # test-check (12)
- # testing (5)
- # untangled (86)
- # vim (6)
@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: http://blog.klipse.tech/clojure/2016/03/30/destructuring.html
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?
(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: https://github.com/viebel/klipse
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.
This is exactly the goal of klipse
Goal achieved, sir.
Did you check codox klipse theme?
How have I never seen this before?! o_o
This is amazing!
Do you have already a live demo snippet for onyx?
Just be aware that you can work around http://dev.clojure.org/jira/browse/CLJS-1831 by evaluating the two js*
forms that are at the top of the picture in my tweet https://twitter.com/mfikes/status/789676348491071488
Yes. The dep below, plus the code snippet, work straight away in Cljs: https://github.com/onyx-platform/onyx-local-rt#usage
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.
@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 https://github.com/clojure/clojurescript/blob/f6a03a3d6eee64be417206d419b3017b09c5ddfd/src/main/clojure/cljs/analyzer.cljc#L385-L392
@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. 🙂
@michaeldrogalis for external deps you need to use data-external-libs
attribute as documented here https://github.com/viebel/klipse#clojure-only-1
Cool, going to need a little while before I can get it set up, but this seems to fit the bill nicely.
See for instance how I’m using clojure.math.combinatorics
in the source of this page http://blog.klipse.tech/clojure/2016/09/16/combinatorics-riddle.html
How exactly is the GitHub resolution working under the hood, out of curiosity?
you provide an array of external-libs that are the url prefixes of your repository
and my custom load-fn will look for the source files there
for instance for onyx the external-libs will be:
,
@viebel That's so cool. Really incredible work my friend.
thank you so much!
I can’t wait to se a demo of onyx with klipse
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 https://raw.githubusercontent.com/onyx-platform/onyx/0.9.x/src//onyx/static/default_vals.cljc", :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.
So it can’t work for the moment?
I think either http://dev.clojure.org/jira/browse/CLJS-1831 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 🙂
@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: https://twitter.com/mfikes/status/789676348491071488
Can you put the code here so I can copy/paste it?
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 😛
hehehe
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}}
There is this file https://github.com/onyx-platform/onyx/blob/0.9.x/src/onyx/refinements.clj
but it’s .clj
@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 https://github.com/onyx-platform/onyx/tree/cljc-triggers
If not, I can provisionally move it to master.
OK will make external-libs pointing to cljc-triggers
branch
Should do the trick. Thanks for helping us. 😃
We made it!!!!
Holy cow, it works
Thats amazing
Soooo really all that's left to do is build up our examples to have Klipse links, and we're done.
Not yet: For the moment, one has to run the following in the console
goog.provide('onyx.static$.util’);
goog.provide('onyx.static$.default_vals’);
@mfikes do you know why prepending the js*
stuff didn’t solve the problem?
(js* "goog.provide('onyx.static$.default_vals');")
(js* "goog.provide('onyx.static$.util');")
(ns my.onyx
(:require [onyx-local-rt.api :as api]))
I had to run the goog.provide in the console!
@michaeldrogalis instead of links to klipse repl, it would be much cooler to have a html page with embedded interactive code snippets
Indeed. 😄
I Love Open Source, good job guys
@richiardiandrea Applause all around. 🙂
Ah, I didnt know that either.
That’s not the problem
I figured out that I can put forms prior to ns
but the code will run only after the deps are resolved
but that’s not a showstopper @michaeldrogalis
Seems okay.
In the html page with interactive snippets, you could add a
<script>
goog.provide('onyx.static$.util');
goog.provide('onyx.static$.default_vals’);
</script>
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.
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. 😛
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. ^^
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
Whaaaaat 😄
Yeah, longer load time is normal for Onyx.
Can the output be pretty printed at the bottom?
@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.
anyway it’s a good feature
Happy to make it for you
Hooray 🙂
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.
The problem is from a maintenance side
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.
You’ll also have to update the analysis cache files
boostrapped cljs needs them for validating function calls etc...
Pretty print is out!!!!
Go and check again the onyx live demo page http://viebel.github.io/klipse/examples/onyx.html
You might need to empty your browser cache
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. ⭐
I don’t find the appropriate emoji
I just wanted to say: I’M TOUCHED!
going to sleep now...
It’s already 11:30 PM here
Sleep well, thanks for helping us. 🙂
thank you!
Remove drain
and stop
and replacing with:
(api/tick)
(api/tick)
(api/tick)
(api/tick)
(api/tick)
(api/tick)
(api/tick)
(api/tick)
(api/tick)
(api/tick)
(api/tick)
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 https://www.oreilly.com/ideas/the-world-beyond-batch-streaming-102
I just came across your blog post about Onyx local runtime http://www.onyxplatform.org/jekyll/update/2016/10/18/Local-Runtime.html
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. 🙂