top | item 44079518

(no title)

nicoty | 9 months ago

What's wrong with static type systems?

discuss

order

practal|9 months ago

I've summarized my opinion on this here: https://doi.org/10.5281/zenodo.15118670

In normal programming languages, I see static type systems as a necessary evil: TypeScript is better than JavaScript, as long as you don't confuse types with terms...

But in a logic, types are superfluous: You already have a notion of truth, and types just overcomplicate things. That doesn't mean that you cannot have mathematical objects x and A → B, such that x ∈ A → B, of course. Here you can indeed use terms instead of types.

So in a logic, I think types represent a form of premature optimisation of the language that invariants are expressed in.

chongli|9 months ago

Your invocation of Strong AI (in the linked paper) seems like a restatement of the Sufficiently Smart Compiler [1] fallacy that’s been around forever in programming language debates. It’s hypothetical, not practical, so it doesn’t represent a solution to anything. Do you have any evidence to suggest that Strong AI is imminent?

[1] https://wiki.c2.com/?SufficientlySmartCompiler

frumplestlatz|9 months ago

This is a very reductive definition of types, if not a facile category error entirely (see: curry-howard), and what you call "premature optimization" -- if we're discussing type systems -- is really "a best effort at formalizations within which we can do useful work".

AL doesn’t make types obsolete -- it just relocates the same constraints into another formalism. You still have types, you’re just not calling them that.

_flux|9 months ago

Personally I would enjoy if TLA+ would have types, though, and TLA+ belongs to the land of logic, right? I do not know how it differs from the abstraction logic referred in your writing and your other whitepapers.

What is commonly used is a TypeOK predicate that verifies that your variables have the expected type. This is fine, except your intermediate values can still end up being of mis-intended values, so you won't spot the mistake until you evaluate the TypeOK predicate, and not at all if the checker doesn't visit the right corners of the state space. At least TypeOK can be much more expressive than any type system.

There is a new project in the same domain called Quint, it has types.

exceptione|9 months ago

> But in a logic,

I am not sure if I misunderstand you. Types are for domain, real world semantics, they help to disambiguate human language, they make context explicit which humans just assume when they talk about their domain.

Logic is abstract. If you implied people should be able to express a type system in their host language, that would be interesting. I can see something like Prolog as type annotations, embedded in any programming language, it would give tons of flexibility, but then you shift quite some burden onto the programmer.

Has this idea been tried?

agumonkey|9 months ago

I'm not a logician but do you mean that predicates and their algebra are a more granular and universal way to describe what a type is.. basically that names are a problem ?

cardanome|9 months ago

Is there any programming language based on abstraction logic?

This is all a bit too abstract for me right now but seems interesting.

Timwi|9 months ago

An HTML version that I can just read on a phone would be nice.

hinoki|9 months ago

Forget it Jake, it’s land of Lisp.