unrepl

discussing specification of an edn-based repl and its implementations.
richiardiandrea 2017-05-23T01:13:54.909755Z

Btw folks some other folks are trying discord for keeping history, I am already in that one, there was one thread on /r/clojure

richiardiandrea 2017-05-23T01:15:44.923971Z

I also really really waet to pitch my idea of generalizing repls to other languages, you send clj for registering transpiling functions and sir/de functions for you js favorite transpiler, that is an easy win from upgradable repls

cgrand 2017-05-23T08:52:41.005991Z

@richiardiandrea I’m not opposed to serving other langs but I would really appreciate if you could develop > you send clj for registering transpiling functions and sir/de functions for you js favorite transpiler

cgrand 2017-05-24T11:14:47.993350Z

so you just need a blob.py

richiardiandrea 2017-05-24T14:35:01.711258Z

True that, you need basically some code that your eval function can understand. Klipse does this already, the whole infrastructure is built in cljs but then everything that compiles to js can be evaluated in the browser.

richiardiandrea 2017-05-24T14:36:29.748518Z

The additional step to add to the upgrade is the transpiler, call a function to convert to js before eval and call a function for converting back the result I guess

cgrand 2017-05-24T15:32:43.221137Z

Are you talking about clj-cljs or js-cljs?

cgrand 2017-05-24T15:35:31.293358Z

I'm confused each time you mention a transpiler

richiardiandrea 2017-05-24T16:11:16.206201Z

Sorry this is cljs-in-cljs and a transpiler example would be the BuckleScript one converting from ocaml to js

richiardiandrea 2017-05-24T16:12:22.232095Z

So the idea is to have Lumo or a fork as universal repl for the whole js ecosystem

richiardiandrea 2017-05-24T16:12:59.246670Z

Just noticed Unrepl in this case stands for universal repl πŸ˜€

richiardiandrea 2017-05-24T16:14:03.271978Z

It is probably better for me at some point to create a poc or something, I hope to get a bit of time soon

richiardiandrea 2017-05-24T16:25:36.540181Z

so to expand: the repl receives a function, the repl transpiles to js, the repl evals the js. Of course there should be a mechanism to discover the function that does the transpilation to js...it would be awesome if we could send it as blob but it might a fully library

richiardiandrea 2017-05-24T16:26:01.550318Z

in case of Bucklescript, this whole thing: https://www.npmjs.com/package/bucklescript

richiardiandrea 2017-05-24T16:27:34.586520Z

I agree this might be a bit out of scope here

cgrand 2017-05-24T19:59:03.349953Z

How easy it is to hook up in nodejs module resolution?

richiardiandrea 2017-05-24T22:00:26.684861Z

(If I understand the question correctly) In lumo the module resolution is done automatically, node.js takes care of it so whatever is in .node_modules gets resolved on a require.

cgrand 2017-05-25T07:34:22.492115Z

Too much context was missing from my question. It was a reaction to "it might be a fully library".

cgrand 2017-05-25T09:29:06.797827Z

If we can hook up in the module loading then we can have them loaded on demand by the server from the client. So they wouldn't have to be part of the blob.

richiardiandrea 2017-05-25T14:40:07.143312Z

Yep I was thinking the same, and/or there could be a section in the package.json of the transpiler for defining things like which function I need to call for this or that. I think the first step would be to define the extension points or in another words what needs to be provided in order to be upgradable. In other other words abstract what the blob is. Will think and put my thoughts in the wiki page. At least this is not really clear to me πŸ˜€ I was thinking of these two functions, but maybe there is more

cgrand 2017-05-25T19:35:10.748419Z

Upgrading a X repl to be a X unrepl has more requirements than upgrading a cljs repl to a X unrepl.

richiardiandrea 2017-05-25T20:57:48.479206Z

Yeah that is what I feel I haven't discovered yet, how much more

cgrand 2017-05-25T22:41:11.090799Z

I would say three. A parser to split input in evaluable snippets. Eval. Allowing evaluated code to take control of the repl streams.

richiardiandrea 2017-05-26T04:36:01.922637Z

Nice, so I am thinking it now in terms of pipable repl exposing to the world only two streams, one in and one out. Each one is responsible for evaluating its part of the stream without exposing parser and eval, and the terminal of this exhaust system is stdout πŸ˜€

richiardiandrea 2017-05-26T04:37:25.931405Z

I mean no rocket science here I know πŸ˜€ However there are fewer things to add to the unrepl protocol if the only communication medium between repls are pipes

richiardiandrea 2017-05-26T04:38:30.938310Z

I probably now get in full what you had in mind all along πŸ˜…

cgrand 2017-05-26T16:47:42.915003Z

Yeah maybe. And upgrading a repl is just the matter of sending a specific input.

richiardiandrea 2017-05-26T17:10:32.362540Z

yep the protocol stays the same, the "engine" can just pipe the streams when an upgrade is requested

cgrand 2017-05-26T17:14:00.428366Z

All this upgrade stuff vaguely reminds me of Alan Kay and alien "objects".

richiardiandrea 2017-05-27T02:20:51.553903Z

Oh I don't know this one, so I will look it up

cgrand 2017-05-27T11:30:02.126288Z

From memory: look for Alan Kay's AMA on HN, especially interactions with Rich.

πŸ‘ 1
richiardiandrea 2017-05-27T15:07:56.756269Z

Ah that part on HN, I remember having read it yet, need a refresher

cgrand 2017-05-27T22:41:23.166310Z

At the time it sent me down a rabbit hole where i discovered jot and zot https://en.m.wikipedia.org/wiki/Iota_and_Jot

cgrand 2017-05-23T11:05:16.939262Z

I created a wiki page, feel free to edit, dump thoughts, questions etc.

cgrand 2017-05-23T11:05:37.943868Z

On β€œregular” CLJS: > current REPL is Read-Compile (in Clojure) followed by eval-print (in JS), to make this more upgradable, one option would be to start by setting up an upgradable JS repl (that would consume framed inputs as a JS reader is not handily available). Hence the process (even for a non-unrepl REPL) would be: upgrade the JS repl to a JS-eval CLJS-print repl and, from there, the REPL could work as usual -- except that now unrepl could upgrade the JS repl to JS-eval EDN-print.

richiardiandrea 2017-05-23T14:40:02.946765Z

Sure will dig into details, for now it is just an unproven idea I had πŸ˜€ thanks for the wiki page