This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2015-09-02
Channels
- # admin-announcements (21)
- # announcements (1)
- # boot (128)
- # cider (18)
- # cljs-dev (10)
- # clojure (112)
- # clojure-brasil (2)
- # clojure-italy (4)
- # clojure-japan (12)
- # clojure-russia (38)
- # clojurescript (241)
- # clojutre (1)
- # datascript (2)
- # datomic (3)
- # events (1)
- # hoplon (38)
- # jobs (1)
- # ldnclj (5)
- # melbourne (8)
- # off-topic (2)
- # om (9)
- # re-frame (13)
- # reagent (43)
- # sneer-br (24)
- # sydney (3)
Eh, I tried to have circle ci run tests but boot show -d
used over 4G of memory and build failed.
It worked on the second try 😮
@joelkuiper: have you tried boot-notify as a HUD replacement? https://github.com/jeluard/boot-notify
@martinklepsch: No I haven’t, thanks for the tip that’s different from what figwheel does though, there you get an indication in the browser (also useful for monitoring the WebSocket conn)
yes I know, just thought that it’s actually not much different
@juhoteperi: not a fix but as a workaround - if you run boot test help
in the dependencies
heading of circle.yml
, wouldn't that download its deps?
@pandeiro: Yeah that would work as workaround
I have an --api
arg to a task specified as type str
but when I invoke boot mytask --api
, it errors out saying ":api must be a string" -- what am I doing wrong?
@pandeiro: tried quoting?
@pandeiro: can you paste your options vec
@micha Would it be possible to plug in Ivy instead of Aether for dependency management?
@pandeiro: my guess is you’re missing the optarg: the 3. item here: https://github.com/boot-clj/boot/wiki/Task-Options-DSL#anatomy
Google’s Bazel site got a nice facelift: http://bazel.io/
@martinklepsch: you were right re: my issue btw; thanks
@john_tollison: Gisting your build.boot
file will help. Looks like your development task adds a dependency that’s not in any of the repos.
@pandeiro: the error message around that could be improved. If you’d log an issue that’d be awesome!
ok, that make me feel a little less clueless. I haven't logged any issues... I do this through github/boot-clj, issues, I guess? I'll try to do that later tonight as I don't have very long atm.
@john_tollison: sure, good luck!
any reason, off the top of your head that development would add a dependency, specifically when I add clj-firmata (arduino) library, BUT it's not an issue at the repl? What kinds of things is "development" likely to add?
@john_tollison: totally depends on your build.boot
file
my env library: https://github.com/adzerk-oss/env
@micha: for your workflow, do you use uberjars — or do you always start apps using boot?
@micha: sweet!
ah ok, cool. i was trying to muck with environ and boot the other day and I had a realization that if I put these env properties inside boot — I wouldn’t have gotten the same assertions if I were to start an uberjar, so I ended up sticking with environ + .lein-env + prismatic/schema
@martinklepsch: notice that even in cljs (env/def FOO)
is getting the FOO
env var at compile time from the environment or system properties
@micha: yup saw that. wouldn’t use it from cljs though
I think for the compiler to safely remove code things need to be marked as constants and that wouldn’t be the case here
Probably not enough
emitted js needs to be something like this
/* @define {boolean} */
goog.define(“your-thing”, false)
5 vars will not be removed?
i wonder what this is: https://github.com/clojure/clojurescript/blob/c5e088786acbdfa5074199f1c5baa9fa7c30f5a6/src/test/clojure/cljs/analyzer_tests.clj#L356
@micha: It's used for case optimization: https://github.com/clojure/clojurescript/blob/033c5acf3d42e485221b47f300f69bb6cebda750/src/main/clojure/cljs/core.cljc#L2124
It’s not doing that. Though in theory I’m thinking that something like ^const
could map to the same emitted js as goog-define
.
not interfering, more that you cant remove dead branches from (if FOO …)
(given FOO would be boolean)
Closure compiler just doesn’t support it.
Interestingly they also have a @const
annotation
const seems like the winner, since if you tell the compiler FOO doesn't change then it can shake fof the else clause of that if at compile time
You annotate it as a special “define”: https://developers.google.com/closure/compiler/docs/js-for-compiler#tag-define
Yes, probably. I guess the difference between constants and defines is that defines can be overridden via compiler-options at compile time
seems like the gclosure docs don't really account for what we can do, which is emit consts programmatically via macro
yeah. I’d be curious if ^const actually allows dead branch removal
lemme check
i'm curious if it works on locals also
i suppose locals should already be const
@alandipert: what do you mean with locals?
like (function() { var x = 123; return function() {x = 321}})() is a possible thing in js
but locals aren't mutable in cljs, you can only mutate what they point at
i would imagine when you can return functions that can mutate variables "liveness" analysis is not entirely possible in all cases, but it seems like cljs would have an edge
since the locals never leak out of the closure, only their values at a point in time
anyway i'd be very surprised if david hasn't already shaved this yak
(def ^const ^boolean my-const false)
(if my-const
(js/console.log "my-const is true")
(js/console.log "my-const is false"))
both console.log calls are in the advanced build.is @const annotation emitted by cljsc?
I’m stupid sorry
It’s ^:const
but ^boolean
Syntax is easy in lisp languages, you know?
in most of them, yes 😉
So, @const
is not emitted but dead branch is removed 😄
if there’s a semi after the comment, update cljs
yeah I think it’s only for easy boolean stuff
even for the goog-define defined things you need ^boolean
(for now)
well, depends what you want to use them for
but yeah after compile time they’re not relevant
fwiw the ^:const annotation isn’t even needed to remove the dead branch in the above example.
@micha: I was just hypothetically thinking about using them to strip dead code where booleans are handy.
I like that little env
thing
i did a lil experiment with local consts,
// ==ClosureCompiler==
// @compilation_level ADVANCED_OPTIMIZATIONS
// @output_file_name default.js
// ==/ClosureCompiler==
function foo() {
/** @const */ var pi = 3.14
return (function(x) {
pi = x;
return pi;
});
}
var f = foo(); //f is a function
alert(f); //f is never called but we still get a warning about multiple assignment
without pi = x
the code becomes alert(function(){return 3.14});
so, it appears to be really good at knowing when things are const automatically
how do you compile this example? is there some handy cli scripty thing?
very useful lil app
i think the guy who wrote the closure book made it
sweet!
this is cool!
@micha: you should brag about the sloc in the readme 😄
@micha: quick thought: when doing def
it looks up the symbol you gave it without ns, but when you alter-var-root you need the fully qualified thing. Maybe that’s worth documenting.
good night!
@martinklepsch it should resolve the var in the namespace that calls the macro, no?