Some more thoughts about typing in programming languages

While looking for compiler-independent way of determining a system's endianness, I stumbled upon the idea of keeping my program language type system purely on a reflection level. This means that data and member access is only know for standard builtin types, but can be complexified using pre-compile offset generators totally independent from the underlying type system. However, this partially contradicts and partially supports the idea of specifiying structure information using the data/type storing itself. I mean if you need to specify a structure using an array with type identifiers, how would you type this array if the only known types are atomic builtin types? Right, using an address and than knowing that there's an id of type "type" stored. You can iterate based on your knowledge, write an array accessor or create pre-compile code generators to access on reflection-based level. I think that this language, at it's core, will be even more minimal and cruel than C, but extremely flexible and alterable. Depending on how good your pre-compile is, you could even write optimizers using the language itself... I still love the idea and I think it's time to gather up a minimal core and create this one languages that's able to improve itself this way. It's a bit like the philosophical part of Star Trek's future government principle: we help the language becoming a better language and the languages helps us getting better language makers. One hand helps another, recursively improving on already-archieved favors.

No comments: