graalvm

Discuss GraalVM related topics. Use clojure 1.10.2 or newer for all new projects. Contribute to https://github.com/clj-easy/graal-docs and https://github.com/BrunoBonacci/graalvm-clojure. GraalVM slack: https://www.graalvm.org/slack-invitation/.
phronmophobic 2021-06-09T19:10:30.080800Z

Just published a minimal example of compiling clojure code into a shared library targeting ios. https://github.com/phronmophobic/mobiletest

2😎
phronmophobic 2021-06-09T19:12:47.082100Z

It's not super useful on its own, but I'd like to experiment to see how viable it would be to build an iOS app with clojure+native-image

borkdude 2021-06-09T19:17:01.082700Z

@smith.adriane very cool!

1😁
borkdude 2021-06-10T09:01:59.084800Z

@smith.adriane I wonder if it can be useful to hook up babashka.nrepl (which is a SCI-compatible nrepl server as a library) to this so you can then control your phone from a distance. Not sure if you can just open a server socket like that on an iphone

1
phronmophobic 2021-06-10T17:05:23.085300Z

;; Connected to nREPL server - <nrepl://192.168.0.48:23456>
;; CIDER 1.1.0snapshot (package: 20210104.915)
: Could not resolve symbol: clojure.main/repl-requires user *cider-repl var/tmp:192.168.0.48:23456(clj)*:1:42
nil&gt; (ns foo)
nil
foo&gt; 
foo&gt; (+ 1 2)
3
foo&gt; (defn neighbours [[x y]]
  (for [dx [-1 0 1] dy (if (zero? dx) [-1 1] [-1 0 1])] 
    [(+ dx x) (+ dy y)]))
#&lt;SciVar@4debf57b: 
  #object[sci.impl.fns$fun$arity_1__4162 0x75ad55f0 "sci.impl.fns$fun$arity_1__4162@75ad55f0"]&gt;
foo&gt; (defn step [cells]
  (set (for [[loc n] (frequencies (mapcat neighbours cells))
             :when (or (= n 3) (and (= n 2) (cells loc)))]
         loc)))
#&lt;SciVar@413be9d6: 
  #object[sci.impl.fns$fun$arity_1__4162 0x24fac9c7 "sci.impl.fns$fun$arity_1__4162@24fac9c7"]&gt;
foo&gt; (def board #{[1 0] [1 1] [1 2]})
#&lt;SciVar@bfa3b74: #{[1 0] [1 1] [1 2]}&gt;
foo&gt; (take 5 (iterate step board))
(#{[1 0] [1 1] [1 2]}
 #{[1 1] [2 1] [0 1]}
 #{[1 0] [1 1] [1 2]}
 #{[1 1] [2 1] [0 1]}
 #{[1 0] [1 1] [1 2]})
😮 ^^ sci nrepl running on my iPhone

phronmophobic 2021-06-10T17:27:23.085700Z

ok, all I need to do is use https://developer.apple.com/tutorials/data/documentation/technologies.json?language=objc to generate some interop code

borkdude 2021-06-10T17:32:41.086Z

Wow!