This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-02-07
Channels
- # aleph (1)
- # beginners (152)
- # cider (26)
- # clara (2)
- # cljs-dev (13)
- # cljsrn (5)
- # clojure (198)
- # clojure-greece (15)
- # clojure-italy (39)
- # clojure-sanfrancisco (3)
- # clojure-spec (28)
- # clojure-uk (16)
- # clojurescript (52)
- # community-development (15)
- # core-async (26)
- # cursive (42)
- # data-science (28)
- # datomic (19)
- # devops (7)
- # duct (11)
- # emacs (24)
- # fulcro (22)
- # garden (4)
- # leiningen (12)
- # luminus (1)
- # mount (5)
- # off-topic (106)
- # om (5)
- # onyx (10)
- # parinfer (37)
- # re-frame (17)
- # reagent (47)
- # shadow-cljs (36)
- # yada (2)
@chrjs I came accross a post of you about observablehq. You might find it interesting that i've put some cljs into it https://beta.observablehq.com/@jeroenvandijk/untitled/3
@jeroenvandijk I do indeed! That’s a great use of mori. You’re giving me ideas for all sorts of things where an external compiler is needed (webPPL, for example) 🙂
I had to adapt mori slightly (update deps and export eval-str). I will push it to github for reference
I was also thinking of using clojure.spec to validate the data of vega configuration for instance. But maybe that's just trying to sell cljs to the rest of the world
I also planted a seed at observablehq hopefully https://talk.observablehq.com/t/enabling-other-languages/253
I’d guess they’ve thought a bit about other languages (what with Jeremy Ashkenas being onboard).
Really, cljs already has all the tools (re-frame and klipse, I’m thinking) to make this kind of reactive notebook.
Exactly my thoughts 🙂
The main thing I ran into doing this was getting clojurescript as a commonjs package/universal module definition. At some point i realized datascript and mori had done this before. And mori had basically all i needed
So i think to get something a la a cljs notebook of the ground with cljs we need something like http://unpkg.com for clojurescript libs. Once we have some boilerplate to load cljs libs (via eval i guess) it could work i think
I was challenged by a collegeau 🙂
Here is what I did to get a proper export for observablehq https://github.com/jeroenvandijk/mori/commit/51bd0d5f4d9ce007ae70d55e89068fc26eaff88f
@chrjs Hi, since you mentioned using webPPL in observablehq you might find this answer interesting as well https://groups.google.com/forum/#!topic/webppl-dev/7aCTwmvNUSo. Regards, Kees aka colleague
Yeah, afaik the only way to use it would be to write the model as a string, and call webppl.run()
on it, as described there.
It’s a bit unsatisfying to have to stringify the model, but such is life (since javascript doesn’t have macros to do the cps transformation, webppl has to have a proper compilation step, cough unlike #anglican cough).
Also, who are you that know of webPPL!? Probabilistic programming is a bit of a niche (for now…).
@keesterbrugge doesn't sleep
@chrjs I don't know much about webPPL, actually it's the first time i hear about it, but from the examples page. Wouldn't something like this work for observablehq
In one cell
webPPL = function(args) {
return require("your-webppl-stuff").then(function(webppl) {
var model = eval("var identity = function(x) {return x}; identity('" + args[0] + "')")
return webppl.Infer(model)
})
}
Then use it in other cells
webPPL `{method: 'enumerate', maxExecutions: 10, model: model}
`I expect something like that will work, yeah. Just a little unsatisfying to have to put things through eval, instead of a true webPPL repl-like experience. But that’s not a criticism of observable, which I really like.
Yeah I understand, it is the same for clojurescript (see my question at the help forum). I guess we have to wait or to build it ourselves 🙂
> Also, who are you that know of webPPL!? Probabilistic programming is a bit of a niche (for now…). I'm from the future, it's the only way we do machine learning here. To get a glimpse see http://www.mbmlbook.com/