Re:Typed Lisp, a primer (2019)
by retrac on Tuesday January 31, 2023 @11:49AM
(#34597551)
Yes. With macros and runtime logic it's possible to implement just about any type system in Lisp, even an ML-like system. Box everything and use macros to transparently pick it apart and reconstruct your wrapped type objects when you use them. My initial reaction to that whole idea was horror. The inefficiency! But maybe not necessarily. A compiler that understood the type system used, could optimize most of it away. Just like how Haskell or SML compilers do.
[ Parent
| on HN ]
Re:Typed Lisp, a primer (2019)
by slaymaker1907 on Tuesday January 31, 2023 @12:33PM
(#34598364)
Typed Racket is an example of a typed language built off of a dynamic base that still manages to use type information for optimization. The main way it does that is by using existing unsafe APIs from the dynamic language, but in a safe way with the type information.