3 ms·
SBCL is an implementation I love working with because updates are steady and the software is stable. But the real superpower, in my opinion, is that, because t
by reikonomusha 3y ago
SBCL is an implementation I love working with because updates are steady and the software is stable.
But the real superpower, in my opinion, is that, because the compiler and standard library are written in Common Lisp, you can reach in into the internals of SBCL for your own projects—as if SBCL were just another Lisp library. Is it advised to use unsupported APIs? Definitely not. But it's nice to be able to have seamless access to the same facilities and optimization tools (e.g., DEFTRANSFORM, DEFINE-VOP) that the SBCL uses for its own implementation. You can build impressively clear and highly efficient code this way, essentially by extending the compiler "in userspace".
- kagevf 3y agoI wanted to get last modified dates from some files, and I tried to use OSICAT-POSIX, but it didn't work because it was missing a non-CL dependency, so I used SB-POSIX instead, and it worked as expected, no issues. I was glad to have that option, and for that particular code, cross-compatibility with other implementations wasn't a concern.
- kaeland 3y agoI’ve been learning CL in my spare time and had no idea this was possible or even a distinction between CL implementations. Thanks for sharing.
- _19qg 3y agoMost Common Lisp implementations have one or more compilers integrated into it. Most of them are written in itself. Thus, when the implementation provides the source for the compiler, you can explore/change the compiler like any other part of the Lisp code.
- User23 3y agoI have a real soft spot for DISASSEMBLE too. It’s magical to be able to instantly see how the optimizer handles your hot spots.
- aidenn0 3y agoAnd if you profile code, then you see assembly level profiling information too!
- dunefox 3y agoThat's what I like about Julia as well with @code_native, @code_llvm, etc. https://docs.julialang.org/en/v1/stdlib/InteractiveUtils/#InteractiveUtils.@code_lowered https://docs.julialang.org/en/v1/stdlib/InteractiveUtils/#In... It's just nice to have inside the language itself.
- perihelions 3y agoWhat's a good introduction for learning SBCL compiler internals like VOP's?
- mtlmtlmtlmtl 3y agohttps://pvk.ca/Blog/2014/08/16/how-to-define-new-intrinsics-in-sbcl/ https://pvk.ca/Blog/2014/08/16/how-to-define-new-intrinsics-... Some quick googling led me to this. Can't vouch for it though, since I need to learn this stuff too! Can't find much documentation for DEFTRANSFORM though, unfortunately.