HNHacker News
TopNewBestAskShowJobs

stassats

175 karma · joined January 29, 2008

submissionscomments
stassats··on Cl-kawa: Scheme on Java on Common Lisp
I did that to write simd routines for sbcl: https://github.com/sbcl/sbcl/blob/master/src/code/arm64-simd... Probably the best way of writing assembly, can evaluate the function immediately, use macros and any other code to emit instructions, even can print register values (instruction-level stepping would be even better, but too much work).
stassats··on Steel Bank Common Lisp
Still 40 years to go.
stassats··on Steel Bank Common Lisp
I have also seen some outright crashes on the new GC.
stassats··on Addressing the adding situation
The tricks to avoid multiplication (and division) are probably worth a whole post.

  x * 6:
  lea eax, [rdi+rdi*2]
  add eax, eax

  x * 7:
  lea eax, [0+rdi*8]
  sub eax, edi
  
  x * 11:
  lea eax, [rdi+rdi*4]
  lea eax, [rdi+rax*2]
But with -Os you get imul eax, edi, 6

And on modern CPUs multiplication might not be actually all that slow (but there may be fewer multiply units).

stassats··on Addressing the adding situation
The text mentions that it can also do multiplication but doesn't expand on that.

E.g. for x * 5 gcc issues lea eax, [rdi+rdi*4].

stassats··on ECL Runs Maxima in a Browser
ABCL is really slow.
stassats··on Finding and Understanding Bugs in C Compilers (2011) [pdf]
A good strategy if you don't care about fixing bugs.
stassats··on Walking around the compiler
That shouldn't mean that it doesn't return a NaN. Things are generally not optimized away because of NaNs. E.g. in GCC, abs(c) > -1.0 is not folded, unless building with -ffast-math
stassats··on Walking around the compiler
That fix has limited applicability. x * x is also a non-negative float. But abs(x * x) is not optimized. Or abs(abs(x)+1). GCC, for example, does know that.
stassats··on Quirks of Common Lisp Types
(+ 2 (id "2")) may also produce a compile time warning. Nothing precludes from having a special rule for that. Like (+ 2 (print "2")) does warn.
stassats··on Ask HN: What toolchains are people using for desktop app development in 2025?
> changes in the Qt project made the technique used by the Qt4 bindings impractical for Qt5 or Qt6 - at least that was my understanding when I looked into it.

It was hard to do reasonably with qt4 already. The best solution would be to support the C++ ABI natively, but that's never going to happen.

stassats··on Notes on Graham's ANSI Common Lisp (2024)
> Why does SBCL not use LLVM?

Why doesn't GCC use LLVM? Why is Zig writing their own backend?

stassats··on Web Embeddable Common Lisp
> lack of tail-call elimination

But lisp doesn't need TCO.

stassats··on Beware of Fast-Math
You can turn them back into rationals, (rational (sqrt 2d0)) => 6369051672525773/4503599627370496

Or write your own operations that compute to the precision you want.

stassats··on A Common Lisp jq replacement
>(safety 0)

Please, don't do that!

stassats··on Depending in Common Lisp – Using the CLOS dependent maintenance protocol (2022)
>any system that relies on information that was typed into a REPL three-months ago and is now only stored in the binary state of that REPL and nowhere else is totally insane as a production product.

Nobody does that.

stassats··on Nvidia's Project Digits is a 'personal AI supercomputer'
> roadrunner is petaflops of FP32

Isn't it actually FP64?

stassats··on The Alder Lake SHLX Anomaly
Using EAX is one byte shorter, so it might be doing that inadvertently.
stassats··on Mark–Scavenge: Waiting for Trash to Take Itself Out
Common Lisp. The dynamic-extent declaration allows for stack allocation.
stassats··on Bit-twiddling optimizations in Zed's Rope
> because 64-bit ARMv8.0 lacks a POPCNT instruction

It does have this: https://developer.arm.com/documentation/ddi0596/2021-09/SIMD...

And GCC happily uses it https://godbolt.org/z/dTW46f9Kf

stassats··on Leaving Neovim for Zed
There's M-:
stassats··on Popcount CPU instruction (2019)
CNT on arm64 counts 8 or 16-bit elements too.
stassats··on Steel Bank Common Lisp 2.3.5 released
SYS:WITHOUT-GCING is better but is still fraught with danger (that's why I didn't mention it).
stassats··on Steel Bank Common Lisp 2.3.5 released
That's not related to garbage collection.
stassats··on Steel Bank Common Lisp 2.3.5 released
That's a recipe for disaster. Never do that.
stassats··on Learn Lisp the Hard Way
What drives people to attempt to persuade others that Lisp is not practical?
stassats··on The empty list
> it's different enough than other languages it confuses people.

And javascript integers (or lack thereof) don't match CL integers. So if you want to interoperate between distinct languages you do have to consider the differences anyway.

stassats··on Reader Macros in Common Lisp (2014)
It's not. Reader macros don't take s-expressions, they take characters.
stassats··on Reader Macros in Common Lisp (2014)
Sure, what's so special about it?

(get-macro-character #\() => SB-IMPL::READ-LIST

(get-macro-character #\)) => SB-IMPL::READ-RIGHT-PAREN (that one just signals an error, the read-list one picks up the closing #\))

stassats··on SBCL: New in Version 2.2.1
Ok, I added the dates.
Page 1 of 3Next →