Fork me on GitHub

@richiardiandrea: I edit my post after to include a different issue, I use the paths and IO function from the readme and can import my own namespaces. But for instance core.async I can't import. Is there any more paths I need to include? I assumed ["/src/cljs" "/js/compiled/out"] would be enough.


@mfikes: core.async not in bootstrapped, that is too bad. Is that on the horizon for support in the future or is that really difficult to get done?


@bbss I'm pretty sure Cognitect isn't pursuing it, so it is probably up to the community if it is going to happen. I hacked on it a bit a while back. I came away feeling that it is indeed possible to succeed (although the code will have shifted significantly, making it hard to keep in sync with upstream changes). We've also learned a bit about macros in bootstrapped ClojureScript and bootstrap has itself also matured. So, in short core.async isn't there, but could be if someone sat down and put in perhaps a chunk of a week porting it. Here is what I was doing:


Okay, good to know, thanks.


Most ClojureScript libraries involve only a little porting to get them to work, but then you have things like core.async which is a lot of Clojure macro code.


I see, I am not so familiar with macros yet so this seems a bit daunting to me. Nevertheless could be interesting to dive into the internals a bit.


@bbss Aspects are still very new to me, frankly, especially when it comes to bootstrap. I mistakenly thought that a consequence of the staged ClojureScript compilation model would be that we would have to build lots of macro “towers,” and I only recently discovered I was incorrect:


@mfikes are there places where I can read more about clojurescripts compilation model? I read some of your posts on the macros but can't say I understand them well, might need to read that book on macros you recommended somewhere. 😅


Hello. Is it ok that uuid's for strings with different case in ClojureScript are different? For example (= (uuid "071C600F-B72B-44AE-8A15-9366EA1BB9D9") (uuid "071c600f-b72b-44ae-8a15-9366ea1bb9d9")) returns false.


It seems spec requires string to be lower-case (according to this post however there are multiple violations. Moreover java returns true for (= (java.util.UUID/fromString "071C600F-B72B-44AE-8A15-9366EA1BB9D9") (java.util.UUID/fromString "071c600f-b72b-44ae-8a15-9366ea1bb9d9")). Maybe that's my point of confusion.


@nidu Yeah, that result is surprising to me. It might be worth reporting.


Moreover it seems every string is accepted to uuid. (= (uuid "123") (uuid "123")) also returns true.


Created issue #CLJS-1599 for it


Is modelling the app around -re-frame similar in concept to using relay in javascript


@rnandan273 I've been poking re-frame for the last few days, never seen Relay before. Yeah, concepts sure look similar, GraphQL queries being subs, GraphQL params being reactions... I fail to see the event part though, this seems to be handed off to React itself.


Or, um... no, GraphQL mutations are part of that flow too.


@d-side thanks for sharing


Actually seems like Relay has two different concepts of parametrization (e. g. displaying different subsets of available data) and mutation (e. g. changing the available data). Re-frame uses the same mechanism for both since parameters are part of the global state too.


Well, at least according to my limited understanding of both. I'm reading through Relay docs right now. Does feel familiar, but it's the same feeling as reading React docs after reading Reagent docs: makes me wonder does it really have to be that complicated .-.


@bbss: Even though you read some, here is a list of posts I've written about macros and bootstrap.


Feel free to ask, some of this stuff is a bit puzzling at times, but we can sort through it.


I'm trying to build a cljs web app that will periodically make an ajax call to an api that will return JSON, for purposes of updating status icons on the page. I'm not quite sure what the "best practices" are for this sort of functionality. Can anyone point me in the right direction? Thanks!


@kspear: I don't know about "best practices", but that architecture is exactly how TourneyBot works:


on the "client" side, it polls for the entire tournament state (`tournament.json`), and then renders the page with that information


Thanks @chrisoakman, I'll give that a look. Appreciate it :)


Hi! I’m trying to add core.logic queries to my CLJS app; where end-users write queries that compile down to core.logic programs. core.logic seems to be primarily implemented as macros. I’m wondering if it makes any sense to do the compilation for that on the server-side (i.e. in the JVM with the usual Closure optimizations) — I’m guessing there’s a decent chance the resulting code will be faster, since cljs.js doesn’t get the benefits of the Closure compiler?


mfikes: Thanks for the links, reading up now


i have a cljs library and a small cljs project which i run with figwheel to develop the library. how can i make the library linked with the test project so that i would not have to run lein install after every change in the library?


@michaelr: I'm not sure about right solution, but you could add that library into :source-paths in project.clj of that small project (but you will need to also include it's dependencies)


maio: hey that might work


@maio: yep worked. thanks!


I’m trying to setup figwheel with SASS using this script:


cljs/sass compilation work fine, but I’m unable to connect to the repl from the browser


is there any additional setup required?


Nice, there seems to be lots of progress on proto-repl lately. Atom is certainly a much more beginner friendly environment than Emacs/Vim. Do you use it yourself @adamkowalski? How do you cope with the broken auto indentation for LISPs? That's like a major roadblock to using it more for me. Liked it a lot besides this actually.


The auto-indent for Atom is a pretty serious problem. I've been meaning to look into it soon.


The language-clojure package needs some love.


@chrisoakman: I looked at it for a bit and toyed around but unfortunately I think it's a pretty fundamental issue with atoms indentation architecture (if you can call it like that)


It uses regexes to indent/de-dent and that doesn't play nice with ((()))


Hello all. Can anyone tell me why the following doesn't work?


cljs.user=> (defn hello [] "Hi!")
cljs.user=> ((var hello))
cljs.user=> ((var (symbol "hello")))
clojure.lang.ExceptionInfo: clojure.lang.PersistentList cannot be cast to clojure.lang.Named at line 1 <cljs repl> {:file "<cljs repl>", :line 1, :column 2, :tag :cljs/analysis-error}


what do you get when you do (var (symbol “hello”))


cljs.user=> (var (symbol "hello"))
clojure.lang.ExceptionInfo: clojure.lang.PersistentList cannot be cast to clojure.lang.Named at line 1 <cljs repl> {:file "<cljs repl>", :line 1, :column 1, :tag :cljs/analysis-error}


i get the classcast exception


is there a way to get the var if I know the name of the symbol?


(sorry, got a call)


i wasn't sure if my question was clear


I don’t know the answer, trying to reason it out.


(def foo "hello")
=> #'rgnt.repl/foo
(symbol "foo")
=> foo
(type (symbol "foo"))
=> clojure.lang.Symbol

Chris O’Donnell19:03:09

not sure if that works in clojurescript or not


yeah, looks like that's not available in ClojureScript


at least in clj, find-var?


so I saw that post and then I read this later from David Nolen's blog


which led me to var


which led me to try out the thing that I posted but I'm clearly missing something


@jaydeesimon: there are no real vars nor reified namespaces in ClojureScript


the var functionality is extremely limited, it exists primarily only to support cljs.test


you should in general avoid anything to do with vars in ClojureScript - this stuff doesn’t port and it’s never going to


@dnolen: got it. thanks guys! I'll take a different approach then


@jaydeesimon: if you’re trying to look up something at runtime your only option is to use ^:export and write your own resolution thing


runtime resolution is completely at odds with advanced compilation


David, do you envision webassembly becoming the host for clojurescript at some point in the future?


@smw unlikely for the foreseeable future - it doesn’t currently bring anything to the table


for ClojureScript (for C++, different story)


@chrisoakman: I have new lines working fine in Atom. I use lisp-paredit just for that with other options off. I need to make this an explicit part of Proto REPL.


Interesting; I want to take a look at that.


There has been some discussion in the #C0F2A0MJN channel about handling indentation.


Do you have a link to the relevant source for that feature?


Thanks David. I figured the gains would probably come in speed as well as, eventually, threading support, etc. First class language without the requirement to compile to js. But maybe the thing I’m thinking about is actually a different language.


@jasongilman: thanks simple_smile I'll give this a look


I wonder if the llvm java frontend (.class files -> llvm bytecode) combined with the llvm webassembly support could result in a port of the google closure compiler running in the browser or on node?


@smw that could be interesting but certainly not useful to the typical ClojureScript user - people targeting bandwidth constrained clients


@smw it’s hard to imagine much in the way of speed gains


more thinking parity between bootstrapped clojurescript and clojure-hosted?


but it might just be terribly slow


ClojureScript is a GCed language and already has competitive performance against Clojure


Right, but as far as I know you can’t do dead code removal in bootstrapped cljs at the moment?


Maybe a native cljs port of the closure compiler is the better idea, but it looks massive


DCE support would really only be interesting for Node.js bootstrap target


and yeah - it seems like a lot of work, minimal gain


Yeah, I think you’re probably right. It’d be much more fun to show off the cljs development workflow with something as fast and simple as planck, though.


Sorry for wasting your time simple_smile Just brainstorming how to make it easier to sell. I’d like to see world domination.


there are a couple of things we could do to make things faster - the JVM really isn’t a problem here at all in that respect - and we’ll probably benefit if/when Clojure makes some headway as well


but IMO, the Uberjar is pretty dead simple - it’s really the integration for dev/prod workflow that requires some fiddling


but honestly we’re not doing any worse than anybody else here far as I can tell