3 ms·
I'm wondering if this has the refs, agents, and atoms that make concurrent clojure so awesome. If not, it would feel.... strange.
by andrewvc 15y ago
I'm wondering if this has the refs, agents, and atoms that make concurrent clojure so awesome. If not, it would feel.... strange.
- runevault 15y agoThe impression I got is the core syntax is all there, you just don't get access to the jvm libraries anymore.
- fogus 15y agoAll of the core syntax is not currently there, but you're right that ClojureScript only interops with js and not Java. For a more detailed differences list see https://github.com/clojure/clojurescript/wiki/Differences-from-Clojure https://github.com/clojure/clojurescript/wiki/Differences-fr...
- runevault 15y agoNo STM, that'll be interesting. Ack no transients either! I know it's early but not gonna lie that one makes me sad. I love being able to write stupid fast list/map builder functions that bash inline but then return something nice and immutable.
- fogus 15y agoBear in mind that the wording is very careful. We took great pains to say things like "not currently implemented." ;-)
- SomeIdiot 15y ago"ClojureScript does not currently support regular expression literals using #"" " This one seems like a big deal, given how often I find myself using regexes in clojure. Is it on its way and is there a workaround currently?
- ericmoritz 15y agoI'm sure you can use the native RegExp class: (def pat (RegExp. "Some(.+)"))
- abp 15y agoThere you go: https://github.com/clojure/clojurescript/commit/a201e9d8dec84ac0bca5b51c714b3179ed7444c8 https://github.com/clojure/clojurescript/commit/a201e9d8dec8...
- SergeyHack 15y agoIIRC just atoms are available right now.
- fogus 15y agoAtoms are available now. Agents might come soon. Refs and Vars are questionable.
- technomancy 15y ago> Vars are questionable. Really? Without vars you don't even have defn. Or do you just mean that vars in clojurescript don't implement IRef?
- nickik 15y agoI think stuff like defn is just a normal js function and does not have the semantics of a clojure var.
- lukev 15y agoAtoms are there. The others are not, but they would be pretty much meaningless in a Javascript engine anyway, since Javascript is specified to be single threaded.
- azakai 15y agoJavaScript does have Web Workers, though, which are threads/processes. They have no shared state though, not sure if that is a problem in this case or not.
- mattdeboard 15y agoNo agents yet