@richiardiandrea A current goal for the project is to be a drop-in replacement for most of the ways you deal with IO via <http://clojure.java.io|clojure.java.io>
, though there are some JVM assumptions about the way <http://c.j.io|c.j.io>
deals with things, so that goal might not be tenable, ultimately.
Oh, sorry, I see that wasn't a question now.
Ah ah no problem ;)
Still worth reading that answer
:)
Also, I'm finishing up a short set of examples in my async forks and then I'll be putting up a PR.
Oh great!
Which you can see here, if you're interested https://github.com/futuro/abio-node/blob/async-io/examples/walkthrough.cljs
I see what you mean there, the Clojure core namespaces do not have async functions at all right?
Yeah, they rely implicitly on the consumer of the library to handle async desires.
I guess having different names from core makes sense for async funcs
They also have different kinds of streams and readers and writers, which are defined by the host.
My current approach is to have a single protocol method that can do both sync and sync, depending on arity.
I was thinking earlier that in the lumo tests it would be great to replace all the <http://lumo.io/slurp|lumo.io/slurp>
with the abio slurps
F.e., https://github.com/futuro/abio-node/blob/async-io/src/abio/node/io.cljs#L9 that's the definition of a reader, and -read
takes either no arguments or one argument, that being the callback to run.
As sanity check 😄
Gotcha
Ha, that'd be pretty neat.
Lumo tests are doing all sorts of io btw and we basically use node directly
It's been interesting learning from the <http://clojure.java.io|clojure.java.io>
code while also trying to piece apart the things that don't make sense for CLJS (or, at least, for Node).
Nice
For example, I called the two records BufferedReader
and BufferedWriter
, but I don't think Node has an unbuffered reader or writer.
Maybe streams, but I can't recall right now.
Yeah streams I guess are close to that, but I am not a node super expert as well
With nRepl now out of contributors I am starting to eye a possible lumo nRepl server
"out of contributors"?
Sorry autocomplete
Out of clojure.contrib
It's now in clojure-emacs
So easier to contribute to
Ah, nice!
I'm really curious if there's efforts to port cider and friends to be self-hosted compatible.
Well, I am the one carrying that flag, I am working on a PR for cljs-tooling
now, there is a lot of work to do though
Abio will be very helpful with that
I know when I was researching the nRepl, I found that threading and host specific IO were the two biggest hurdles. What hurdles have you encountered so far with cljs-tooling
?
None, I just want to add var
to lumo
and I need some time to fix the error I found in some tests
But there is no IO in there so it's relatively easy
the patch is here in WIP if you are curious https://github.com/clojure-emacs/cljs-tooling/pull/24
Neat, thank you 🙂