This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-01-23
Channels
- # aws-lambda (5)
- # beginners (212)
- # boot (3)
- # cider (130)
- # cljs-dev (24)
- # clojars (2)
- # clojure (287)
- # clojure-dusseldorf (23)
- # clojure-italy (11)
- # clojure-russia (10)
- # clojure-spec (9)
- # clojure-uk (45)
- # clojurescript (59)
- # core-async (1)
- # cursive (13)
- # datascript (1)
- # datomic (46)
- # emacs (12)
- # events (9)
- # fulcro (196)
- # graphql (3)
- # hoplon (79)
- # jobs (5)
- # jobs-discuss (7)
- # jobs-rus (2)
- # keechma (26)
- # keyboards (9)
- # leiningen (2)
- # luminus (9)
- # off-topic (20)
- # om-next (1)
- # onyx (15)
- # re-frame (16)
- # reagent (18)
- # reitit (1)
- # remote-jobs (2)
- # rum (3)
- # shadow-cljs (13)
- # sql (135)
- # unrepl (46)
- # vim (1)
- # yada (23)
@qqq any decent JIT will do what's known as deoptimizing. Integers will be stored as ints until you start using floats. Integers will be stored unboxed in arrays until you add a non-integer value, etc.
That's one of the major reasons why unhinted math is so much faster in CLJS than CLJ.
@tbaldridge: I missed something important. What does the JavaScript VM do that JVM does NOT do that makes "unhinted CLJS math faster than unhinted CLJ math"?
The JVM is restricted by the (limited) type system it implements. On the JVM if you say arr[idx] = 42
, the JVM will box the number if the array is of type Object
. In JS VMs the value is not boxed until the VM discoveres that you try to do something like arr[idx + 1] = "foo"
So it starts with the array being a int[]
until you stick something that's not a int into it, then it transparently converts the array into a object[]
Apply the same logic to function arguments, object fields, etc.
Hrm, looking at it now @qqq that may not be the case for arrays. It is the case for functions and object methods it seems.
And in V8 ints are stored as tagged integers, so there's never boxing as long as your integer stays less than 31bits
there is some Work In Progress
implementation of clojure to python?
even though still experimental but intended to be "complete"
(I find ~10 projects on github, half of them by @tbaldridge, but no one has many activity)
Why you want to use clojure on pythonvm??
Most of the material on the internet from machine learning is in python
Yes, there is awesome stuff in JVM/Clojure/JS... but python looks like de "main" language
I tried "Hy Lisp" for precisely the same reason, gave up, then tried looking for numerical libs in Java (Tensorflow Java API, MXNET, and JCuda)
Yes, mainly with JNA/JNI methods. You work with Python in the Clojure. JNI a little bit more stable.
Yes, mainly with JNA/JNI methods. You could work with Python in the Clojure (like ~java). JNI a little bit more stable.
Cython is pretty awesome yes. https://spacy.io is the proof đ
Is this what counts for âtruly amazingâ? https://techcrunch.com/2018/01/22/facebook-invented-a-new-time-unit-called-the-flick-and-its-truly-amazing/
Isnât that just a least common multiple of a bunch of terms? Yes, it is.
(def terms '(24000 ;; i.e. 24 Hz theatrical film framerate
25000
30000 ;; 30 Hz NTSC video
48000
50000
60000 ;; 60 Hz NTSC fields
90000
100000
120000
8000 ;; 8 kHz audio
16000
22050
24000
32000
44100 ;; 44.1 kHz audio
48000 ;; ... etc.
88200
96000
192000))
(defn gcd [a b]
(if (zero? b)
a
(recur b (mod a b))))
(defn lcm [a b]
(/ (* a b) (gcd a b)))
(reduce lcm terms)
;; => 705600000
is there a way to interpret webasembly on rhino https://developer.mozilla.org/en-US/docs/Mozilla/Projects/Rhino ?