This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-03-07
Channels
- # admin-announcements (5)
- # aws (2)
- # boot (313)
- # cider (69)
- # cljsfiddle (18)
- # cljsrn (17)
- # clojars (6)
- # clojure (121)
- # clojure-austin (4)
- # clojure-bangladesh (4)
- # clojure-colombia (2)
- # clojure-dusseldorf (17)
- # clojure-japan (1)
- # clojure-russia (65)
- # clojure-sg (4)
- # clojurescript (94)
- # community-development (6)
- # core-matrix (2)
- # cursive (2)
- # data-science (6)
- # datomic (28)
- # hoplon (4)
- # jobs (1)
- # jobs-discuss (1)
- # keechma (15)
- # ldnclj (2)
- # off-topic (6)
- # om (140)
- # om-next (1)
- # onyx (47)
- # parinfer (11)
- # re-frame (13)
- # reagent (4)
- # spacemacs (7)
- # specter (7)
- # yada (18)
@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: https://github.com/mfikes/core.async/commits/self-host
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: http://blog.fikesfarm.com/posts/2016-03-04-collapsing-macro-tower.html
@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 http://stackoverflow.com/questions/8258480/type-of-character-generated-by-uuid) 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.
Moreover it seems every string is accepted to uuid
. (= (uuid "123") (uuid "123"))
also returns true
.
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.
@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: See https://github.com/clojure/clojurescript/wiki/Differences-from-Clojure#macros
@bbss: Even though you read some, here is a list of posts I've written about macros and bootstrap. https://gist.github.com/mfikes/7a3902f7a8260fe6aab2
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: https://github.com/oakmac/tourney-bot
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?
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)
I’m trying to setup figwheel with SASS using this script: https://github.com/bhauman/lein-figwheel/wiki/SASS-watcher
cljs/sass compilation work fine, but I’m unable to connect to the repl from the browser
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/hello
cljs.user=> ((var hello))
"Hi!"
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}
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?
no worries
i wasn't sure if my question was clear
(def foo "hello")
=> #'rgnt.repl/foo
(symbol "foo")
=> foo
(type (symbol "foo"))
=> clojure.lang.Symbol
@jaydeesimon: How about ns-resolve
not sure if that works in clojurescript or not
yeah, looks like that's not available in ClojureScript
so I saw that post and then I read this later from David Nolen's blog http://swannodette.github.io/2014/12/17/whats-in-a-var
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
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
@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?
@chrisoakman: https://github.com/jonspalding/lisp-paredit/blob/master/lib/edit-commands.coffee#L68
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 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
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
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 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