Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

This is technically true yet I feel it's similar to pointing out that you can write a simple C compiler in assembly.


I don't consider it "technically true".

1. Common Lisp has a whole system for defining and declaring types, and implementations do actually use this information to produce safer and higher performing code, including some amount of static, compile-time verification (e.g., you can get "expected an INTEGER but got a STRING" styles of compile-time errors). Fast, competitive-with-C floating-point math is achieved this way. DEFTYPE/DECLARE work.

2. If you prefer a system that doesn't feel like a 1980s barebones type system (i.e., Common Lisp's), then you can use Coalton [1] which adds types to a Scheme-like DSL within Common Lisp, but has a type system like Haskell's (similar to stock GHC + common extensions). Multi-parameter type classes, monomorphization, functional dependencies, etc. Yet it's still fully interoperable with Lisp code, uses the same Lisp toolchain, same Lisp compilers, same Lisp editors, etc. so it really isn't just a language atop Lisp, but something that's integrated within it.

[1] https://coalton-lang.github.io/manual/


I wasn't objecting to "a lisp with compile time enforced static types" I was objecting to "lmao just write it yourself". I'm well aware it already exists just as any number of basic bootstrapable C compilers do. It's a huge undertaking to bolt that on as a DSL from scratch instead of introducing a dependency.


Ah, that makes sense. I read the original comment, "you can define them," as meaning one can add static types to Common Lisp programs. But designing and building entirely new systems, at least ones that should work for a large class of practical programs, is not easy. I agree with you then.


And that type system is written in a Lisp (Scheme).




Consider applying for YC's Winter 2027 batch! Applications are open till November 2.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: