This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-04-26
Channels
- # aleph (2)
- # beginners (119)
- # boot (18)
- # cider (19)
- # cljs-dev (46)
- # cljsjs (1)
- # cljsrn (30)
- # clojure (101)
- # clojure-dusseldorf (12)
- # clojure-finland (1)
- # clojure-greece (7)
- # clojure-india (2)
- # clojure-italy (6)
- # clojure-poland (4)
- # clojure-russia (120)
- # clojure-sg (3)
- # clojure-spec (147)
- # clojure-uk (75)
- # clojurescript (86)
- # cursive (4)
- # datomic (50)
- # docker (1)
- # emacs (4)
- # juxt (51)
- # leiningen (16)
- # liberator (1)
- # luminus (1)
- # lumo (116)
- # mount (2)
- # off-topic (2)
- # onyx (38)
- # pedestal (4)
- # protorepl (2)
- # re-frame (44)
- # reagent (8)
- # ring-swagger (16)
- # schema (5)
- # specter (16)
- # test-check (226)
(.doesNotExist js/document)
generates a warning with *warn-on-infer*
while (js/document.doesNotExist)
doesn't
Don't want to trigger a flame here, but I am reading this: http://exploringjs.com/es6/ch_modules.html#static-module-structure and I was wondering if it could be beneficial to emit ES6 modules (and if not, why...if somebody has some little time to explain) in ClojureScript.
@richiardiandrea what would do you hope to gain by doing so?
it says modules' static analysis can speed up things (not tested, just wondering)
but I am now reading this which actually disproves my thought: http://mrale.ph/blog/2012/09/23/grokking-v8-closures-for-fun.html
you mean cljs?
Google Closure
oh ok tnx
outputting ES6 would make some ES6 interop things easier though, so there is some benefit to that
the current strategy is to pull everything down to ES3 which may not work out in the long run
gotcha, thanks for explaining that, so if I understand right you'd use goog.provide
and goog.require
in order to get what then has become ES6 modules
awesome thanks a lot for taking the time for the clarification
closure even supports some hacks like import { assoc } from "goog:cljs.core"
but that requires compiling the ES6 code with closure
oh nice, that's good to know
we are evaluating languages and one of the things that I am often asked is about the verbose and hard to read output we have in cljs
I am of course pushing it
because I don't care about the JS output 😄
exactly
just want to support the thought with something concrete 😄
@darwin I think that's exactly the concern, when you eventually need to, and your code needs a hot patch and some JS dev on the other side of the world will open that .js
file there
but of course, it is part of the tradeoffs you have to evaluate when choosing your language
@richiardiandrea exactly, let’s not fool ourselves, there are costs to generated code (I’m personally willing to pay the price tough)
I never tried it but I think if you run the generated JS through prettier
it shouldn't look all that bad
just as comparison, this is unbeatable: http://bloomberg.github.io/bucklescript/reason-demo
but yeah the benefits for me have always won the battle