Live data from Hacker News

Things Zig comptime won't do

matklad.github.io

251–252 of 252 posts

Re: Things Zig comptime won't do

#251
post #163

Earlier quoted context omitted.

And a modern compiler will jmp past the type checks if the inferencer OKs it!

Which the inferencer probably can't do because of how dynamic standard-class can be. Also, if we want to get pedantic, method-dispatch does not dispatch on types in Common Lisp, but rather via EQL or the class of the argument. Since sub-classes can be made (and methods added or even removed) after a method invocation is compiled, there is no feasible way in a typical lisp implementation[1] to do compile-time dispatch…

Very interesting comment!

To clarify, as you know CLOS isn’t the CL type system. I was particularly thinking about things like fixnum arithmetic.

The CMUCL and SBCL manual sections on code generation discuss this and it can be verified with DISASSEMBLE.

Re: Things Zig comptime won't do

#252
post #251

Earlier quoted context omitted.

Which the inferencer probably can't do because of how dynamic standard-class can be. Also, if we want to get pedantic, method-dispatch does not dispatch on types in Common Lisp, but rather via EQL or the class of the argument. Since sub-classes can be made (and methods added or even removed) after a method invocation is compiled, there is no feasible way in a typical lisp implementation[1] to do compile-time dispatch…

Very interesting comment! To clarify, as you know CLOS isn’t the CL type system. I was particularly thinking about things like fixnum arithmetic. The CMUCL and SBCL manual sections on code generation discuss this and it can be verified with DISASSEMBLE.

Missed your reply when it happened. Note that you cannot specialize a method on "fixnum" since it's not a class (though you can on "number" or "integer" since they are classes).
Post reply on HN