I'm wondering how the author convinced the AI to forget about decades of prior work on describing programming language implementation and produce a work that seems to have no prior art.
Even dynamically type programming languages will layout what types the languages has. But that is usually the conventions built off of years of history, usually based on C.
But what if you wanted to define a custom type to use? Say you wanted to make type mysmallint, and it was an integer that is between 1 and 1000. Now, you can write up code to do this but it is not the same thing as declaring type int. *
*unless you are using Haskell, F#, or others I am not aware of.
What if you wanted to define a custom type that says this string only contains ascii characters? You can not easily define that as a type and pass it around the code. You have to write custom code and do checks.
I'm not sure how a type system would "solve" arithmetic overflow / bounds dynamically, without expensive overhead (boxed types).
The same is true for overflow and unsafe math (tons of languages increase math and overflow safety on many paths without performance penalty, and baking that behavior into the type system with nondefault unsafe options is demonstrably tractable).
Hell, the prevalence of C static analyzers that warn about the vast majority of errors in these categories is proof that more safety is possible in C.
It’s not really about performance. It’s more the stubborn obsession with ABI compatibility at all costs and a pervasive lack of type system support and conventions relating to code reuse that hold C back.
Or do we have to have completely new forms of hardware datatypes?
1) Semantics of Language Constructs (part of Solution Domain) - These are just tools used to express any intention. You can make this as simple or powerful as you want.
2) Semantics of Programmer Intentions (part of Problem Domain) - These are the actual intentions expressed via a language according to the programmer's needs. Obviously no amount of language power can anticipate/provide-for all possible intentions.
In order to map (2) onto (1) we model problem approaches into distinct categories like Computation models (eg. Procedural/OO/Functional), Architectural models (eg. Monolith/Client-Server/Component) etc.
But the correctness of the above mapping depends only on the usage of rigorous formal logic to assert the intentions explicitly. This is why Dijkstra invented a simple language like GCL and taught how to verify your intentions in code using invariants/preconditions/postconditions and logical rules to mechanically transform a postcondition to precondition and thus derive a program based on intentions (expressed unambiguously as mathematical specifications).
A programming language can support the above at compile-time using types and/or at run-time using contracts but the fundamental problem of mapping Intentions -> Code can never go away. Hence this is what we should focus on learning. Once we are clear on this, mapping it onto any language (simple or complex) becomes comparatively trivial.