This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-08-21
Channels
- # announcements (15)
- # beginners (82)
- # calva (19)
- # cider (7)
- # clj-kondo (7)
- # clojure (81)
- # clojure-brasil (8)
- # clojure-dev (37)
- # clojure-europe (2)
- # clojure-italy (7)
- # clojure-nl (8)
- # clojure-spec (5)
- # clojure-uk (14)
- # clojurescript (67)
- # cursive (13)
- # datomic (29)
- # defnpodcast (2)
- # figwheel-main (19)
- # fulcro (9)
- # graalvm (5)
- # iot (3)
- # off-topic (16)
- # other-languages (1)
- # overtone (1)
- # pathom (4)
- # protorepl (2)
- # re-frame (25)
- # reagent (1)
- # shadow-cljs (126)
- # spacemacs (9)
- # sql (2)
- # test-check (24)
- # tools-deps (11)
Hi all. I’m studying the internals of Clojure and ClojureScript and noticed that all persistent data structures in ClojureScript were written in ClojureScript itself, while in Clojure they were written in Java. I was thinking that it turn more suitable to compile/transpile Clojure using ClojureScript. Am I correct?
I believe this is mostly because deftype
and defprotocol
were added later to Clojure whereas they were available right from the beginning in Clojurescript. Those are necessary to write such low-level constructs.
Why is loop/recur missing from the cljs cheatsheet: https://cljs.info/cheatsheet/
quick CI question. I have a bog-standard figwheel-main based project, and I basically want to run my unit tests using lein fig:test-headless in circleCI. What environment would be appropriate to run the tests in? Node? The unit tests are just testing pure functions
@kah0ona I would go with node personally for speed, if you're doing something custom. However since you're using figwheel, did you check out the figwheel testing apparatus? https://figwheel.org/docs/testing.html
So i have this test runner function, and lein fig:test runs correctly, but it opens a browser window
but, the Chrome thing doesn’t seem to do anything, and i’m not sure how to use Node for this. I mean, do i still need some host page? Or can i just invoke the generated .js file?
i probably should abandon this approach, and use something like https://github.com/Olical/cljs-test-runner
So is there a preferred job board for clojurescript jobs these days?
or just all the usual place but filter for cljs
Hi friends: what would be the way to get the cljs equivalent of this JS:
import ptBR from 'date-fns/locale/pt-BR';
registerLocale("pt-BR", ptBR);
the more i use clojure(script) almost exclusively, the more i realize i don’t know much about modern javascript 😄
I am interested in seeing what the clojurecsript compiler is actually doing by stepping through a simple compilation - maybe the hello-world example in the Quick Start, but I am a bit confused how to pass those args into intelliJ and make it step through. Would anybody be able to guide me?
doing stuff with the compiler isn't hard - but if you're just getting started w/ Clojure(Script) then I would wait a bit
if you're feeling adventurous you can try some stuff here https://swannodette.github.io/2015/07/29/clojurescript-17
and this talk is informative https://www.youtube.com/watch?v=Elg17s_nwDg
hey @dnolen im not new to clojurescript and have been using it for a year and a half or so. I am actually interested in hacking the compiler to see if i can get it to emit Dart rather than javascript. I watched the Gellar youtube and worked through the hello-cljs example that you have on gitHub. I understand the relationship between source, the reader, creating an AST and using emit to render JavaScript. I seem to be a bit stuck on where to even start altering the compiler so emit spits Dart rather than JS. I don't even know if it would be a reasonable thing to do maybe maybe not?
hey @U28A9C90Q - the Dart AST is binary and I don't know if you could actually do that from a Java thread? Did you see: https://thosakwe.com/aot-compilation-and-other-dart-hackery/ or https://github.com/thosakwe/bullseye ?
It might be possible to use something like Protocol Buffers to pass data from Java to a Dart thread with the AST in it - however that would seem harder than just emiting a text file with the dart source
@ian.davies I was thinking in reverse engineer the frontend dart compiler: https://github.com/dart-lang/sdk/tree/master/pkg/front_end
Another way is to convert the frontend to java using https://github.com/google/dart2java
cool let me know how you make out. I don't suppose you have any insight into the clojurescript compiler?
The thing I am having difficulty wrapping my head around is how to separate out the requirement that clojurescript has on using the google closure compiler and all its helpers/classes
And even the persistent data structures that are written in Java or C# in Clojure and ClojureCLR respectively, are written in Clojure itself at ClojureScript
But there is a cljs.core file that defines all the main clojure functions, interfaces etc. that would have to be mapped to Dart
Could just write it as a macro and use an if statement within the main function that later invoked the right dart target. Dart also has a kind of catch all no such method function you can use.
Yep, I think that macro approach is better than relying on catch all, that resembles ruby method_missing
I ended up using npm
, create a webpack bundle, and importing that through :foreign-libs
.
@ian.davies it's worth considering just generating Dart source, Dart can hot reload and far as I know they aren't interested in a portable bytecode thing or anything
FWIW I don't think there's much value in going through other tools since in the end you don't care that much about the thing you generate in our case
people explored generating JS AST etc. w/ ClojureScript but it's just a lot of complexity minimal value add