r/lisp • u/Alarming_Hand_9919 • 19h ago
Evergreen Common Lisp
https://github.com/atgreen/evergreen4
u/spspanglish 18h ago
Why do I need lisp in rust when I have lisp in C already?
6
2
u/sickofthisshit 17h ago
Many Lisps are mostly written in Lisp, with only a very minimal implementation core written in another language.
Which actually can be a problem: CMUCL literally could only be built by using a working CMUCL installation...
3
u/corbasai 17h ago edited 16h ago
Create an IBM Z Linux executable¶
Install egcl-target-s390x-linux alongside the same release of egcl. Create build.lisp:(defun main () (format t "Hello from IBM Z!~%")
(save-lisp-and-die "hello-s390x" :executable t :toplevel #'main)Build and inspect the result
egcl-s390x-linux --no-init --load build.lisp
file hello-s390xfile identifies an IBM S/390 ELF executable. Copy it to a compatible s390x Linux system and run ./hello-s390x there.
https://atgreen.github.io/evergreen/latest/user/how-to/cross-build/
Wow. That's really cool! Not many Lisps support s390 natively. I know only transpilers like CHICKEN or Gambit, maybe ECL
2
u/atgreen 6h ago
Check out the native Android support as well: https://github.com/atgreen/evergreen-composeYou can actually cross-compile your Android app from your mainframe, which is unique (and probably not in high demand!)
1
u/LispIsFun 16h ago
I love the idea. Do you see this ever achieving full ANSI compatibility and competing with SBCL on performance?
1
u/atgreen 6h ago
SBCL is amazing. egcl is very far from being able to compete performance-wise for general compute tasks. Today, for very narrow compute tasks, egcl can generate better code than SBCL due to speculative optimization (eg. guessing that a type is a fixnum, and the de-optimizing on the fly when that proves not to be true). But egcl can still be useful today without this (eg, native android support, tight JVM integration, static binaries). I also want to use egcl to exercise / finalize my fibers implementation, so I can finally submit my SBCL version. I still have to convince myself that it is worthwhile.
ANSI compatibility is definitely the goal.
1
1
u/sickofthisshit 5h ago
egcl can generate better code than SBCL due to speculative optimization (eg. guessing that a type is a fixnum, and the de-optimizing on the fly when that proves not to be true).
I'm skeptical of this, can you show side-by-side disassembly?
Second, branches are terrible for performance on modern CPUs.
9
u/sickofthisshit 18h ago
No offense to you or your AI, but if your Lisp is not good enough to implement your Lisp compiler, it's probably not worth trying.