This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-10-10
Channels
- # announcements (1)
- # asami (36)
- # babashka-sci-dev (5)
- # beginners (4)
- # calva (10)
- # chlorine-clover (2)
- # clj-commons (2)
- # clojure (35)
- # clojure-android (1)
- # clojure-norway (1)
- # clojurescript (11)
- # cursive (8)
- # deps-new (5)
- # emacs (8)
- # fulcro (11)
- # graalvm (15)
- # gratitude (5)
- # holy-lambda (11)
- # jobs-discuss (5)
- # lsp (9)
- # off-topic (9)
- # other-languages (2)
- # pathom (6)
- # polylith (43)
- # portal (35)
- # quil (6)
- # react (13)
- # reclojure (3)
- # releases (5)
- # rewrite-clj (13)
- # shadow-cljs (32)
Hello, I would like to start project which which will interpret Clojure using Truffle. My idea is to reuse some parts of Clojure implementation. The problem is that code is quite hard to read. From what I read on the internat LispReader should accept stream of characters as and input and transform it into Clojure datastructures. Then Compiler class should take those datastructure and convert it into Clojure AST. When I look the code I am not able to find it properly. Anyone could assist please or interested in this project?
I think it's an interesting idea and I've also looked into Truffle + Clojure myself. If I may ask, what would be your major reason to run Clojure on Truffle?
Well the main benefit would be hopefully performance. Also Truffle(here I mean graal compiler) is trying to improve their optimization regularly so in the future in could improve even more.
There is a thesis from 2015 which also has built a Clojure Truffle interpreter. Have you found that?
I am trying to keep some resources around this topic here: https://github.com/borkdude/trickle-playground
Also there is https://github.com/nilern/coiffure which has some working features: https://github.com/nilern/coiffure
Yeah I foudn the thesis and from there I took an inspiration (using parts of Clojure official implementation)
There is none yet. But you should be able to use LispReader. Are you trying to use it from Java?
And if I am not wrong, then LispReader should be call from Compiler class and this class is responsible for building Clojure AST and convert it to the bytecode. WHat I want to try is to remove the bytecode part and usign the Clojure AST and convert it into Truffle AST
user=> (clojure.lang.LispReader/read (java.io.PushbackReader. (java.io.StringReader. "(+ 1 2 3)")) nil)
(+ 1 2 3)
Interesting I tried to do that from Java. Like copying the class from the original project
Do we actually know how much better is graal's jit against bare hotspot? I don't want to make any false claims but I think Clojure compiler produces code that's fairly close to what Java is doing. So benefits from graal going to be more on side of escape analysis and aggressive hot path inlining than anything else. My personal guess is 20 % maximum. No two fold numbers like in case of Truffleruby.