Type Systems

So someone tried to graft a new type system onto Perl (which by the by is a "closed, strong and statically typed language") with perhaps predictable results.

So the "integer or undef" thing can be defined in some type systems,

or otherwise there must be some default value, and then maybe some way to tell the "default value because never set" and "default value set by something" cases apart. A common trick here is to use some bits as flag values and the remainder for integer values, which means that you will have fewer than the full range of, say, 64-bit integers, as some bits are reserved (the "tagging" that was mentioned, above). Maybe the numbers zero and up can be used for a map distance, and negative values for other things:

This is sort of where the "Microsoft boolean" came from, a boolean of the values 0, 1, -1; true, false, error. Groping towards Vedanta logic, they are: true, false, unreal.

Or you could have a struct with a boolean (has the integer been set?) and the 64-bit (or whatever) integer, but then you may have performance issues because there's a whole struct being slung around instead of an integer so maybe don't do that in a hot path? In addition to whatever overhead the LISP brings with it. Anyways you can usually just leave off the DECLARE and similar bits if the Common LISP type system is getting in the way, usually when you're prototyping something and do not know what needs to be what.

References

Or should this be the pointers section? Or how can we strong type this without beraking the keybaord?

https://blogs.perl.org/users/leon_timmermans/2025/02/a-deep-dive-into-the-perl-type-systems.html

Proxied content from gemini://thrig.me/blog/2026/04/01/type-systems.gmi (external content)

Gemini request details:

Original URL
gemini://thrig.me/blog/2026/04/01/type-systems.gmi
Status code
Success
Meta
text/gemini
Proxied by
kineto

Be advised that no attempt was made to verify the remote SSL certificate.