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

On the other hand you could make an argument that static typing isn't actually a language feature as much as it is a step in the process of programming.

Static typing consists of (a) tagging variables with their type and (b) running a program that uses these type tags to check and/or rewrite the program.

It's easy to add type tags to a lisp program. It's just that Lisp doesn't specify that second program that checks and transforms the first. So I would say Lisp is half way there when it comes to static typing.

That's a pretty contrived argument though... :-)



no, adding type declarations to Lisp is the easy part. when it comes to static typing, standard Common Lisp offers very little.

Declaring types? That has been done. In Common Lisp:

    (defun twice (n)
      (declare (number n))
      (the number (* n 2)))
The difficult parts are:

* the type system and its capabilities

* make the operations of the type system sound

* determining sub-types

* type inference

* integration with the rest of the language (where data objects also have something like types)

Common Lisp provides lots of infrastructure for all kinds of things, but very little for a type system. For example in Lisp one can determine the value of an expression via EVAL, but there is no function to compute the type of an expression (other than a type of the computed value).




Consider applying for YC's Summer 2026 batch! Applications are open till May 4

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

Search: