This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-07-22
Channels
- # admin-announcements (1)
- # aws-lambda (1)
- # beginners (38)
- # boot (48)
- # cider (11)
- # clara (4)
- # cljs-dev (61)
- # cljsrn (9)
- # clojure (68)
- # clojure-austin (3)
- # clojure-greece (9)
- # clojure-mexico (6)
- # clojure-russia (40)
- # clojure-spec (165)
- # clojure-uk (134)
- # clojurescript (37)
- # cursive (5)
- # datomic (25)
- # defnpodcast (2)
- # hoplon (1)
- # jobs (1)
- # juxt (1)
- # lein-figwheel (3)
- # leiningen (4)
- # mount (14)
- # off-topic (8)
- # om (29)
- # onyx (9)
- # protorepl (4)
- # quil (1)
- # re-frame (56)
- # reagent (3)
- # rethinkdb (1)
- # spacemacs (4)
- # specter (12)
- # test-check (2)
- # testing (1)
- # vim (12)
- # yada (4)
@rohit: the analysis cache isn’t completely about being valid EDN since we want to capture the fn signature for the benefit of users
@rohit I’m still collecting information about whether the Transit cache is worth these kinds of complications - so I’ll continue to keep an eye about how many issues like this people are encountering
@dnolen: will you integrate @rohit's patch in the meantime? (@rohit did you open a ticket by any chance?)
@martinklepsch: done and done
@martinklepsch: already applied to master
We could use a Github integration in this channel, yay, nay?
Yeah, maybe. Although a jira integration probably doesn't fit into our "free Slack" integration limit ...
i think it’ll require permissions from both jira admin and slack admin. https://clojurians.slack.com/apps/A0F7YS3MZ-jira
under simple optimizations, cljs.pprint/compile-format
[1] compiles to:
EDIT: see snippet below
this results in an error (again, under simple optimizations. works fine with :none
and :advanced
).
I don’t know if this is a problem in Clojurescript or the Closure Compiler itself
[1]: https://github.com/clojure/clojurescript/blob/master/src/main/cljs/cljs/pprint.cljs#L2672-L2690
@anmonteiro: the line you are highlighting looks pretty innocuous in cljs (https://github.com/clojure/clojurescript/blob/c3899acf797eb6779c53b313f5606c5018360b83/src/main/cljs/cljs/pprint.cljs#L2684). Could you share a usage which doesn’t work under :simple
optimization?
@rohit: exactly my thoughts. but the javascript it compiles is invalid
I’ve found this while trying to compile some devcards under simple optimizations
@anmonteiro: seems weird is there something suspicious looking in the CLJS code?
@dnolen: it’s really weird and I still haven’t found a reliable way to reproduce 100% of the time
@anmonteiro: just wondering if your devcards setup does not create multiple javascript contexts (e.g via iframes or webworkers) to isolate individual devcards. I saw one tricky case where :none
and :advanced
builds worked, but :simple
was broken just because I was crossing js-context boundary (e.g. calling pr-str on a data structure created in a different js-context).
ah, nevermind, forget my message, it was a different problem, :none
and :simple
worked, but :advanced
did not
managed to repro 100% without Devcards
compiling just the following with {:optimizations :simple, :pseudo-names true}
will cause the issue
(ns foo.core
(:require [cljs.pprint :as pprint]))
what triggers the issue is setting :pseudo-names
to true
but I’m not even sure if simple compilation + pseudo-names is a valid combo?
a problem where the generated pseudo name creates a clash with a ClojureScript name because I don’t think Closure is looking for it
and yes I would argue that :pseudo-names
is only for debugging advanced/simple compilation issues
@dnolen: this does happen with simple compilation
@dnolen: so could the problem in cljs.pprint/compile-format
be the usage of the dynamic var?
that Closure compiler thinks it can overwrite, or something?
@anmonteiro: I don’t think so
@dnolen: and how can that be avoided?
OK I think I get it
@dnolen: I managed to get it to work using a simple hack, though
IIRC, I was mutating (and assigning) the variable twice, so that Closure would generate another name for it
I can see how undesirable that is, though
@anmonteiro: my guess could be wrong of course and there’s something weird here about pseudo-names and how dynamic bindings work that I don’t understand
@dnolen: So far I was unable to find any related issues in the Closure Compiler repo, which leads me to believe that we might be doing something wrong
dnolen: have been working on support for deftype/defrecord in cljs-devtools, discovered some inconsistencies along the way. for example type->str
does not work for defrecords and I don’t see reason why it should not implement .-cljs$lang$ctorStr like deftype does, I had to resort to use cljs$lang$ctorPrWriter[1], nothing is really blocking me, because I have workarounds, but I would like to propose some patches which would make my implementation more maintainable
https://github.com/binaryage/cljs-devtools/commit/99d1d61398f14614d95b6fee632dbf00300d84b2
@darwin I don’t recall why there is a discrepancy about the ctorStr thing, probably just an oversight
also I would like to add some names for anonymous functions here and there, for example type constructors
@anmonteiro: that’s also possible but would be easier if we could get a smaller thing that exhibits the problem
@darwin I tried something like that at some point and it ended up being more trouble than it’s worth
feel free to take a look into it again but my feeling was it was a rabbit hole - but who knows, maybe you’ll be able to do it simpler w/o issue 🙂
I was tackling it along with some other things so maybe it just wasn’t important enough for me to sort out
interesting, those names should be properly munged, so I would not expect an issue, will try
@darwin in my experience so far anything to do name generation is a big pain in the ass
and speaking about demunge, it is not perfect, I had to write some wrappers around it, to handle dollars and to reverse js-reserved transformation
FYI, this[1] is what I use currently, not well tested, will run with it for next devtools release and see what problems people discover, then I can spend some time implementing something like this in cljs.core https://github.com/binaryage/cljs-devtools/blob/99d1d61398f14614d95b6fee632dbf00300d84b2/src/lib/devtools/munging.cljs#L150-L176