planck

Planck ClojureScript REPL
futuro 2017-03-27T15:56:18.499402Z

Does Planck currently offer asynchronous file read/write?

mfikes 2017-03-27T15:56:33.505525Z

No.

mfikes 2017-03-27T15:56:55.514357Z

It imitates the <http://clojure.java.io|clojure.java.io> system.

futuro 2017-03-27T15:56:56.514781Z

Cool, just wanted to double check my brief tour through the source

futuro 2017-03-27T15:57:51.537908Z

How do you feel about adding asynchronous counterparts to the synchronous file operations?

futuro 2017-03-27T15:59:26.577151Z

I've been thinking more about the point of threading in the nREPL server, and I believe the reason there's no async i/o is because you just wrap things in thread or future calls

futuro 2017-03-27T15:59:58.590430Z

However, JavaScript doesn't have that ability, instead opting for callbacks and event loops

mfikes 2017-03-27T16:00:06.594749Z

I see no issue with that. (Planck already has support for an async variant of clojure.shell, for example.)

futuro 2017-03-27T16:00:20.601924Z

s/has//

futuro 2017-03-27T16:00:55.617386Z

(Turns out I can just edit my comments)

futuro 2017-03-27T16:01:50.640737Z

Cool; I'll mess around with abio and see if I can come up with a prototype

achikin 2017-03-27T19:28:49.200544Z

Hi! I’m trying to hack around in planck and stuck with adding external dependencies.

mfikes 2017-03-27T19:29:55.222822Z

@achikin Have you seen http://planck-repl.org/dependencies.html ?

achikin 2017-03-27T19:31:25.254648Z

Works great with clojurescript.csv but things like clojure.data.xml or clj-http refuse to load.

slipset 2017-03-27T19:31:46.262303Z

planck has http suport

slipset 2017-03-27T19:32:13.271088Z

and I’d be surprised if clojure.data.xml has (standalone)clojurescript support

mfikes 2017-03-27T19:32:24.275488Z

@achikin Looks like some of the libraries you are trying to load are Clojure libs

mfikes 2017-03-27T19:33:31.298402Z

For HTTP, require the planck.http namespace and then do (dir planck.http)

slipset 2017-03-27T19:33:32.298696Z

hmm, there is a cljc file in clojure.data.xml

mfikes 2017-03-27T19:33:43.302406Z

A small example is at the bottom of http://planck-repl.org/planck-namespaces.html for HTTP

achikin 2017-03-27T19:35:04.329731Z

@mfikes it works perfectly, but I wanted to use planck to explore several “native” libraries.

mfikes 2017-03-27T19:36:09.351751Z

What kind of error do you get with clojure.data.xml? (Perhaps it is not compatible with self-hosted ClojureScript.)

achikin 2017-03-27T19:37:31.379882Z

From the docs of clojure.data.xml The Clojurescript implementation uses the same namespace as the Clojure one clojure.data.xml.

slipset 2017-03-27T19:37:50.386523Z

@achikin what version are you using?

slipset 2017-03-27T19:39:52.426833Z

the docs suggest 0.0.8 as the latest stable, which doesn’t seem to contain cljc stuff.

mfikes 2017-03-27T19:41:10.452138Z

@slipset is right. It only contains clojure/data/xml.clj

slipset 2017-03-27T19:41:54.467360Z

Current alpa seems to be at 0.2.somethingrather.

slipset 2017-03-27T19:42:30.479172Z

Since you’re here @mfikes, what do you think of https://github.com/mfikes/planck/issues/466

slipset 2017-03-27T19:42:56.487884Z

If you’re interested, I could code up a suggestion for this...

slipset 2017-03-27T19:43:07.491311Z

Won’t be happening on this side of easter though (I think)

mfikes 2017-03-27T19:44:31.519133Z

Issue #446 seems reasonable. I bet to pull it off you'd have to convey it via a well-known JavaScript variable.

slipset 2017-03-27T19:45:00.528469Z

maybe, but you’ve got in-ns as a special thing in planck, right?

achikin 2017-03-27T19:45:02.529093Z

@slipset you’re right - i’m on 0.0.8

slipset 2017-03-27T19:45:45.543271Z

so I was thinking something like *repl-capabilities* or some such

mfikes 2017-03-27T19:46:27.557144Z

If it were exposed at the ClojureScript level, I wonder what namespace it would be in.

slipset 2017-03-27T19:47:27.577416Z

How’s it done with in-ns? Because I found that lumo has lumo.repl/in-ns whereas planck has it as in-ns

slipset 2017-03-27T19:47:50.584762Z

(and it seems to live in clojure.core in, well clojure.

mfikes 2017-03-27T19:49:29.617698Z

I don't understand the in-ns question. FWIW, in-ns is a REPL special that switches to, or creates a namespace.

slipset 2017-03-27T19:51:17.654872Z

ah,

slipset 2017-03-27T19:52:06.671074Z

my point is that in lumo and clojure, you need to prefix in-ns.

slipset 2017-03-27T19:52:26.677842Z

in lumo it’s lumo.repl/in-ns in clojure it’s clojure.core/in-ns.

slipset 2017-03-27T19:52:56.688037Z

Whereas in planck it doesn’t hava a ns, it seems to live at some top-level, since it’s only called by issuing in-ns

slipset 2017-03-27T19:53:34.700746Z

My thought was that if you had a function/var which lived in the same place as plancks in-ns, it could be the same place for all repls.

mfikes 2017-03-27T19:54:17.715898Z

Oh. Right. You are effectively saying *repl-capabilities* could be a REPL special. Gotcha.

slipset 2017-03-27T19:54:26.719026Z

🙂

slipset 2017-03-27T19:54:46.725908Z

I’m not a standalone-repl-native speaker 🙂

mfikes 2017-03-27T19:55:02.731534Z

Hah.

mfikes 2017-03-27T19:55:19.737495Z

Actually, FWIW, in the regular ClojureScript REPL, in-ns is a REPL special as well.

slipset 2017-03-27T19:55:36.743735Z

also, planck is lagging behind lumo, since lumo has get-arglists

slipset 2017-03-27T19:55:42.745977Z

😛

mfikes 2017-03-27T19:55:54.749855Z

What is get-arglists?

mfikes 2017-03-27T19:56:09.754990Z

I've seen the ticket. I've just never heard of it...

slipset 2017-03-27T19:56:34.764058Z

I imagine it’s a way to ask the arguments of a function?

mfikes 2017-03-27T19:57:24.781495Z

It is a function defined in Clojure?

slipset 2017-03-27T19:57:30.783659Z

nope

slipset 2017-03-27T19:57:32.784527Z

hang on.

slipset 2017-03-27T19:57:58.793532Z

user=&gt; (-&gt; 'println resolve meta :arglists)
([&amp; more])
user=&gt;

slipset 2017-03-27T19:58:24.802781Z

That’s from my clojure repl.

slipset 2017-03-27T19:58:43.809504Z

user=&gt; (-&gt; '+ resolve meta :arglists)
([] [x] [x y] [x y &amp; more])
user=&gt;

slipset 2017-03-27T19:59:49.833174Z

resolve doesn’t, err, resolve in planck.

mfikes 2017-03-27T19:59:50.833680Z

cljs.user=&gt; (require '[planck.core :refer [resolve]])
nil
cljs.user=&gt; (-&gt; 'println resolve meta :arglists)
([&amp; objs])
cljs.user=&gt; (-&gt; '+ resolve meta :arglists)
([] [x] [x y] [x y &amp; more])

slipset 2017-03-27T19:59:59.836874Z

aha 🙂

mfikes 2017-03-27T20:00:07.840166Z

So, what did Lumo do?

slipset 2017-03-27T20:00:25.846952Z

(lumo.repl/get-arglists \”%s\")

mfikes 2017-03-27T20:00:33.849716Z

(I'm on Lumo 1.1.0 which doesn't seem to have it.)

slipset 2017-03-27T20:00:37.851163Z

that’s from inf-clojure.el

slipset 2017-03-27T20:02:06.882776Z

funny, doesn’t seem to exist

slipset 2017-03-27T20:02:33.892211Z

but the inf-clojure.el (the emacs lisp for implementing inf-clojure) mentions it.

mfikes 2017-03-27T20:04:04.923890Z

Ah. Interesting. With Planck, I took the approach of porting Clojure core functions by putting them in the planck.core namespace. The planck.repl namespace has some things that are in cljs.repl (like source, doc, pst, etc.)

slipset 2017-03-27T20:05:28.953643Z

I guess this is too much, but looking through here (searching for either planck or lumo) you see the problem I’m trying to solve with 466