This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-01-18
Channels
- # admin-announcements (90)
- # alda (1)
- # aws (23)
- # beginners (60)
- # boot (217)
- # cljs-dev (20)
- # cljsjs (23)
- # cljsrn (85)
- # clojars (28)
- # clojure (101)
- # clojure-art (1)
- # clojure-berlin (10)
- # clojure-dev (16)
- # clojure-my (2)
- # clojure-russia (194)
- # clojure-sg (7)
- # clojure-ukraine (1)
- # clojured (1)
- # clojurescript (99)
- # clojurex (1)
- # community-development (6)
- # core-matrix (11)
- # cursive (26)
- # datomic (51)
- # euroclojure (30)
- # hoplon (560)
- # jobs (44)
- # ldnclj (34)
- # mount (23)
- # music (3)
- # off-topic (10)
- # om (145)
- # onyx (3)
- # perun (38)
- # portland-or (2)
- # proton (55)
- # re-frame (64)
- # reagent (26)
- # ring-swagger (3)
- # spacemacs (21)
- # sydney (3)
- # yada (1)
If I do this
(extend-type number
IFn
(-invoke [n m]
(+ n m)))
I can then (-invoke 2 3)
=> 5
.
Should this also allow (2 3)
=> 5
?I suppose there's not a way to emit static JavaScript that would efficiently support this, considering cases like (n 3)
, where (number? n)
is known to be satisfied only at runtime.
(Practical concerns aside, this is making me think that it is not strictly valid to emit a diagnostic at analysis time that (2 3)
involves something that cannot be invoked.)
@mfikes it could be interesting - but you’re often not going to have enough type information to make a static optimization like that work
@dnolen: Yeah. I’m also thinking that the analysis diagnostic I mentioned above, (warning on simple cases like (2 3)
), while perhaps useful, is not theoretically correct to do.
The ClojureScript compiler tests pass for me on Nashorn 8u66! (Previous versions of Nashorn would derail in some way.)
ChakraCore is a go: https://twitter.com/mfikes/status/689195226922119170
@mfikes are you running this on a real Windows machine? if so I wonder how the basic benchmarks look
@dnolen: Parallels desktop on Mac. Maybe 5 seconds to run it. Slower than JavaScriptCore on my Mac but faster than Nashorn.
@dnolen when I get a bit of time, I'll install Node on that Windows 10 instance so we can at least see what the perf ratio is between Node and Chakra