This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-04-25
Channels
- # aleph (6)
- # beginners (6)
- # boot (94)
- # cider (34)
- # cljs-dev (36)
- # cljsrn (12)
- # clojure (124)
- # clojure-dev (41)
- # clojure-dusseldorf (6)
- # clojure-italy (3)
- # clojure-norway (1)
- # clojure-russia (161)
- # clojure-sg (7)
- # clojure-spec (71)
- # clojure-uk (95)
- # clojurescript (38)
- # core-async (16)
- # cursive (14)
- # data-science (1)
- # datascript (12)
- # datomic (15)
- # emacs (22)
- # funcool (2)
- # hoplon (15)
- # jobs-rus (2)
- # juxt (9)
- # liberator (7)
- # lumo (1)
- # off-topic (136)
- # onyx (24)
- # pedestal (39)
- # perun (2)
- # planck (20)
- # re-frame (23)
- # spacemacs (31)
- # unrepl (5)
- # untangled (1)
- # vim (1)
- # yada (29)
@oahner the default externs are populated in the env setup, see https://github.com/clojure/clojurescript/blob/master/src/main/clojure/cljs/env.cljc#L54-L55
I’ve been working on making the REPL for self-hosted CLJS a “real” REPL. https://github.com/cgrand/cljs-js-repl/blob/master/README.md
This repo contains:
• an async input stream protocol with a couple of impls (PipeReader, StringReader, LineColNumberingReader) in the io
namespace
• an async reader (and its EDN pendant too) built on top of io
• an async port of clojure.main/repl
(dynamic bindings are correctly supported so you can have several ns at once)
All of this allows to take over the REPL session and installs another REPL (or whatever) like one can do with a Clojure REPL.
I believe it would be beneficial to have a better common REPL infrastructure.
I’d like to discuss if/how it’s possible to have such features in Clojurescript.
@mfikes @anmonteiro I just realized that my repl works by accident because eval
is not really async. If I add a setTimeout
it messes things.
However upon further analysis I think there’s a fundamental problem with async eval: it can’t capture and restore the dynamic context where it was invoked (`cljs.js/eval*` supports a handful of hardcoded dynvars but no hook for the user to setup her env.)
Yeah, bindings don't work in an async environment
@cgrand if you look at the cljs.js
namespace you'll see that it passes bound-vars around
Which are captured when first calling a method from that namespace
@anmonteiro yes but afaict it’s a closed set, no?
Probably is. You may be able to add more to that context by calling private fns
But I wouldn't encourage you to do that
would this be of any help? https://github.com/binaryage/cljs-zones
Hmm no, I don’t think. Well I have done about the same (`dynvars` ns). Maybe something hacky could be done
And there's nothing that could be done with web workers, to make a seemingly async eval?
What about a run time loop that constantly carries bindings forward? Something like a gameloop like: https://github.com/rm-hull/big-bang
@cgrand there’s really no way to make this work, if namespaces are to be loaded from disk or across the wire - which they often are
@dnolen that's where I was getting: a binding conveyance mechanism is needed even if it's an opt in. Do you have the link to Brandon's proposal handy?
I found this old one https://dev.clojure.org/jira/browse/CLJS-210
@oahner it should but I think the small number of Windows using ClojureScript means it’s unclear how good/bad the experience is
well, it's surprisingly okay; I'm using msys2 and got all the sh scripts working by tweaking the classpaths to use ; instead of :