Earlier quoted context omitted.
Good pointers. But Claude Code is even more expensive.
Back in the day those were not unusual costs for programming tools. (Beer wasn't free.)
Steel Bank Common Lisp version 2.6.7
161–170 of 172 posts
Re: Steel Bank Common Lisp version 2.6.7
#162* the SB-SIMD contrib now supports ARM64. (Thanks to Sylvia Harrington) * AVX512 instructions are now supported on X86-64. (Thanks to Robert Smith and Arthur Miller) * additional support for SIMD instructions on ARM64 and X86-64. (Thanks to Arthur Miller) These seem like pretty awesome additions. Does anyone know how SIMD works in SBCL? Is this at the codegen layer? i.e. can it auto-vectorize or anything like that? O…
On implementation level, it is a codegen layer. It uses a system of macros to generate instructions from a database of instructions. The database is specified manually:
https://github.com/sbcl/sbcl/tree/master/contrib/sb-simd/cod...
At compile-time, they are converted into "VOPs", i.e. intrinsic functions, which are used by the compiler to emit the actual machine instructions.
> can it auto-vectorize or anything like that?
Unfortunately, it can't.
> are these intrinsics you have to explicitly ask for?
Yes, more like higher-level intrinsics. You get quite some automation, but you are requesting manually what you need. More like a DSL, than pure intrinsics. This is how you can use it (as an example):
(defun count-lines-and-words-ascii (sap size ws-init-state) (declare (type fixnum size) (type (unsigned-byte 8) ws-init-state) (type sb-sys:system-area-pointer sap) (optimize (speed 3) (safety 0))) (loop with loop-end of-type fixnum = (logandc2 size 127) for i of-type fixnum from 0 below loop-end by 128
with 0x0 of-type u8.32 = (u8.32 #x00)
with 0x20 of-type u8.32 = (u8.32 #x20)
with 0x0A of-type u8.32 = (u8.32 #x0A)
with wa of-type u64.4 = (u64.4 0)
with la of-type u64.4 = (u64.4 0)
with ws-prev of-type u8.32 = (u8.32 ws-init-state)
for c1 = (u8.32-sap-ref sap (+ i 0))
for c2 = (u8.32-sap-ref sap (+ i 32))
for c3 = (u8.32-sap-ref sap (+ i 64))
for c4 = (u8.32-sap-ref sap (+ i 96))
do
(flet ((process-chunk (curr prev)
(let* ((ctrl (u8.32-sat- (u8.32- curr 9) 4))
(ws (u8.32-or (u8.32= ctrl 0x0) (u8.32= curr 0x20)))
(ws-shift (u8.32-alignr ws (u8.32-permute128 prev ws #x21) 15))
(wmask (u8.32-andc1 ws ws-shift))
(lmask (u8.32= curr 0x0A)))
(values wmask lmask ws))))
(multiple-value-bind (wm lm prev) (process-chunk c1 ws-prev)
(psetf wa (u64.4+ wa (u8.32-sad wm 0x0))
la (u64.4+ la (u8.32-sad lm 0x0))
ws-prev prev))
(multiple-value-bind (wm lm prev) (process-chunk c2 ws-prev)
(psetf wa (u64.4+ wa (u8.32-sad wm 0x0))
la (u64.4+ la (u8.32-sad lm 0x0))
ws-prev prev))
(multiple-value-bind (wm lm prev) (process-chunk c3 ws-prev)
(psetf wa (u64.4+ wa (u8.32-sad wm 0x0))
la (u64.4+ la (u8.32-sad lm 0x0))
ws-prev prev))
(multiple-value-bind (wm lm prev) (process-chunk c4 ws-prev)
(psetf wa (u64.4+ wa (u8.32-sad wm 0x0))
la (u64.4+ la (u8.32-sad lm 0x0))
ws-prev prev)))
finally
(return
(loop for j from loop-end below size
with words of-type fixnum = (sum-lanes wa)
with lines of-type fixnum = (sum-lanes la)
with prev-ws of-type boolean = (logbitp 31 (u8.32-movemask ws-prev))
with tlines of-type fixnum = 0
with twords of-type fixnum = 0
for byte of-type fixnum = (sb-sys:sap-ref-8 sap j)
for curr-ws of-type boolean = (or (= byte 32) (Re: Steel Bank Common Lisp version 2.6.7
#163I wonder sometimes how the world would look like if lisp won and the unit of deployment was a lisp machine image, if that makes sense. How would a kubernetes optimized for lisp look like? How would AWS EC2 look like? etc.
Re: Steel Bank Common Lisp version 2.6.7
#164* the SB-SIMD contrib now supports ARM64. (Thanks to Sylvia Harrington) * AVX512 instructions are now supported on X86-64. (Thanks to Robert Smith and Arthur Miller) * additional support for SIMD instructions on ARM64 and X86-64. (Thanks to Arthur Miller) These seem like pretty awesome additions. Does anyone know how SIMD works in SBCL? Is this at the codegen layer? i.e. can it auto-vectorize or anything like that? O…
> "AVX512 instructions are now supported on X86-64" This is the first news I've seen on HN in weeks that I am genuinely excited about! I have several AVX-2 hobby projects in Common Lisp, and an AVX-512 machine. It's an unexpected surprise to read this morning that this very useful ISA is suddenly unlocked. I'll be trying it out right away. (edit: Looks like they mean *compiler* support for AVX-512, but not SB-SIMD de…
Nice to hear! :)
It is the basic compiler support, and lots of instructions added. However, you can't use knor, knoq and similar since they require scheduling of k-masks. Not done yet. But you can certainly use some of avx512 instructions and add yourself if you need some that is not available already. Check https://github.com/sbcl/sbcl/blob/master/src/compiler/x86-64....
Re: Steel Bank Common Lisp version 2.6.7
#165Earlier quoted context omitted.
>For hobby stuff, I found an even more niche solution that is more enjoyable to work with in the GUI/TUI/CLI space. What is that solution?
GToolkit[1] - a Smalltalk environment that's based on Pharo but replaces the UI framework and some other parts of the stack. It uses Rust through FFI to interface with and bundle native dependencies. I don't remember the exact numbers, but when I checked, the GT+Pharo ecosystem (available packages, number of people in Discord, tools with support for the language, etc.) was ~2x smaller than Common Lisp's. It also come…
Re: Steel Bank Common Lisp version 2.6.7
#166Earlier quoted context omitted.
I mean, both Scheme and CL have good libraries and a set of standards.
Okay, but what that has to do with preferring strong CS theoretical grounds vs. cutting corners to get-the-shit-done? My initial point was about cultures - Haskelites are typically very smart, extremely mathy, and they'd often choose certain ways even if it takes them forever and requires reading and analyzing dozens of academic papers, just because "Galois was a genius and we can make this theory fit here, because t…
Also, where do you go from "preferring strong CS theoretical grounds" to "cutting corners"? They don't have to be mutually exclusive.
That garbage collection that Haskell has? Guess where that came from. The whole "functions as data to pass around", guess where that came from. It was those pesky lispers on a Tuesday.
Edit: typo
Re: Steel Bank Common Lisp version 2.6.7
#167Earlier quoted context omitted.
Lisp's been around for 70 years at this point and hordes of developers tried it and said: lovely, but I ain't using it at work. I'm strongly convinced, having used Scheme, CL, Racket, Clojure that Lisp is doomed to be (mostly) a hobby language. The very power of Lisp, macros, dynamic programming, reflection lead to a mess of an ecosystem where every single developer reinvents the wheel and nobody can understand yet a…
>> said: lovely, but I ain't using it at work. Says who, you? Wrong. I use Common Lisp at work. edit: and not just use as in a side toy, design and writing software in CL is my primary responsibility. FWIW, at a FAANG!
Re: Steel Bank Common Lisp version 2.6.7
#168Earlier quoted context omitted.
Okay, but what that has to do with preferring strong CS theoretical grounds vs. cutting corners to get-the-shit-done? My initial point was about cultures - Haskelites are typically very smart, extremely mathy, and they'd often choose certain ways even if it takes them forever and requires reading and analyzing dozens of academic papers, just because "Galois was a genius and we can make this theory fit here, because t…
So, Haskell people smart, other people dumb? Also, where do you go from "preferring strong CS theoretical grounds" to "cutting corners"? They don't have to be mutually exclusive. That garbage collection that Haskell has? Guess where that came from. The whole "functions as data to pass around", guess where that came from. It was those pesky lispers on a Tuesday. Edit: typo
Da hell you're talking about, friend? I said nothing about "people", or them being smart or dumb; just a difference in cultural stereotypes.
Now you're ironically "proving the point" I didn't make by saying some dumb shit and pulling me into this pit too. If I was actually smarter I'd probably just ignored it. Reminds me Billy Madison quote: "everyone in this room is now dumber for having listened to it. I award you no points, and may God have mercy on your soul."
Re: Steel Bank Common Lisp version 2.6.7
#169I wonder sometimes how the world would look like if lisp won and the unit of deployment was a lisp machine image, if that makes sense. How would a kubernetes optimized for lisp look like? How would AWS EC2 look like? etc.
Lisp's been around for 70 years at this point and hordes of developers tried it and said: lovely, but I ain't using it at work. I'm strongly convinced, having used Scheme, CL, Racket, Clojure that Lisp is doomed to be (mostly) a hobby language. The very power of Lisp, macros, dynamic programming, reflection lead to a mess of an ecosystem where every single developer reinvents the wheel and nobody can understand yet a…
Message Sent from Common Lisp
Re: Steel Bank Common Lisp version 2.6.7
#170Earlier quoted context omitted.
So, Haskell people smart, other people dumb? Also, where do you go from "preferring strong CS theoretical grounds" to "cutting corners"? They don't have to be mutually exclusive. That garbage collection that Haskell has? Guess where that came from. The whole "functions as data to pass around", guess where that came from. It was those pesky lispers on a Tuesday. Edit: typo
> Haskell people smart, other people dumb? Da hell you're talking about, friend? I said nothing about "people", or them being smart or dumb; just a difference in cultural stereotypes. Now you're ironically "proving the point" I didn't make by saying some dumb shit and pulling me into this pit too. If I was actually smarter I'd probably just ignored it. Reminds me Billy Madison quote: "everyone in this room is now dum…
Again, check HAKMEM from ITS/Maclisp/PDP10's (The OS from Richard Stallman took all the ideas for GNU Emacs, the GPL license, the free software movemement and whatnot). Lisp itself accounts for tons of papers and innovation.