Phel v0.40 is out: Sharper Edges phel 🚀
> EDN/Transit IO + ^:by-ref params + big compiler perf wins (call-site cache, const folding, etc)
https://github.com/phel-lang/phel-lang/releases/tag/v0.40.0
🚀 Old project, revived: Clojure 1.13 now runs on Android!
I ported Clojure 1.13 to run on Android (Dalvik / ART) — and not just loading
it: it supports on-device dynamic eval (JVM bytecode → d8 → DEX, compiled at
runtime). So you get a real REPL-style "evaluate Clojure live" experience right
on the phone 😄
Why it's neat
• Tracks the latest Clojure (1.13) — not stuck on the old 1.7 branch
• The changes are fully transparent and zero-overhead on the JVM — the Android
path only kicks in when java.vm.name == "Dalvik"
• Verified on an Android API 36 emulator: boot → AOT calls → on-device eval, all green
Two repos
• Patched Clojure 👉 https://github.com/xlisp/clojure-android
• Runnable Android demo 👉 https://github.com/xlisp/clojure-android-demo
No need to x-post -- major releases to #announcements (at most once a month), minor releases to #releases Very cool on getting Clojure's master branch running on Android!
This is cool but it's not Clojure 1.13, because there is no 1.13 and no (well, 1) commits yet for it. This is Clojure 1.12.5
It would make the most sense to just track the clojure-1.12-dev branch instead of master, which sometimes has speculative or broken things on it
Thanks @seancorfield @alexmiller! I directly forked the latest master branch code from https://github.com/clojure/clojure to build this, and I've successfully got the Android UI running: https://github.com/xlisp/clojure-android-demo/blob/main/app/src/main/clojure/demo/ui.clj 😄
@stevechan if the classloader and data reader hooks were in Clojure main, could you avoid forking Clojure and just pull and build it with a separate script?
I believe that should be possible. Here is the script I currently use to package Clojure JAR files for Android: https://github.com/xlisp/clojure-android/blob/master/build-jar.sh. If that works out, it would be fantastic—it would mean we could write Clojure directly using the latest version, without needing any custom modifications! 😄
gojava 0.1.0 https://github.com/gloathub/gojava is a new Go library that ports the most common standard Java libraries to Go. It is meant to be used by Clojure dialects for Go (like #gloat's Glojure) to allow them to support clean Java interop functionality. It can also be used by anyone porting Java to Go.
interesting that you chose to preserve jvm semantics instead of go semantics
That's the whole point. .clj files using Java interop forms would expect that. Glojure already had the Go interop covered.
In the gloat --repl (0.1.44)
user=> (math/Round 0.5) ; Go: rounds half-away-from-zero
1.0
user=> (math/Round -0.5) ; Go: rounds half-away-from-zero
-1.0
user=> (Math/round 0.5) ; JVM: rounds half-toward-+infinity
1
user=> (Math/round -0.5) ; JVM: rounds half-toward-+infinity
0
user=>#gloat 0.1.43 • #glojure support for JVM interop forms using the most common Java std classes. ◦ See https://gloathub.org/doc/gloat-java-interop/ • Uses the new https://github.com/gloathub/gojava Go library • Glojure already fully interops with Go code • The dream here is to be able to compile existing Clojure to Go code and binaries with as little change as possible.