What I want is a C/C++ level language with the ability to do compile time introspection of class type structures, and metaclasses of classes with access to that.
So I can say "GarbageCollected class foo", which causes compile-time parsing of the methods/variables of foo. It can, for example, check that each data member of foo is also GarbageCollected. Similarly, when the foo type is used (not the instances, the type), it can validate the context (so raw pointers to foo aren't allowed). In effect, I want to be able to in-language have enough power to create a Java/C# esque "managed" typesystem.
Similarly, I want to be able to say "Reflecting class foo", and have it make the members of foo Reflect. Or "Property class foo", and when I create Property members their access has implicit access to the this pointer (in effect, I modify both code in foo, and code that uses foo). But I want this to happen with zero run-time cost, a modest compile-time cost, and with a system strong enough to do these kind of things in the language without it being a bunch of hard-coded keywords that only do this (because I don't know what else could be done this way..).
Then I can have a GC GUI low-performance reflectable system embedded adjacent to my high-performance audio filtering, without having to deal with crossing a language barrier half way.
That is exactly the reason why always wanted to develop a new language. I want a language that can do:
- Static typing (required for performance reasons) but support for type inference
- Have a rich type system that allows garbage collected object, native pointers and possibly other memory management approaches.
- Flexibility: For example sometimes I might want to control the exact layout of my structs like in C++
- Meta-programming to the extent that it is possible to integrate domain specific languages like SQL in a nice way. This basically means that I want support for clean macros like in lisp and full compile-time reflection.
- Easily extensible with minimal core features: Syntax and type system should be extensible. A for-each loop could be implemented as a macro. Even classes could be implemented on top of structs
when the language supports full compile-time reflection. Garbage collected types could be build on top of non-garbage collected ones. Runtime reflection could be implemented using compile-time reflection.
- Possible option: Support for constraints that can be checked during compile type to formally verify correctness. This could possibly be part of the type system, for example you could have a "integer between 5 and 7" type that can be converted to "integer" but not to "integer between 6 and 7" unless the compiler can prove that the value will never equal 5. You would need statements to tell the compiler "you can safely assume that variable a has type 'int between 5 and 6'" and "do a runtime check to ensure this condition" in order to help the compiler.
If someone had any great ideas on the syntax and type-system I could probably write a small compiler (I have some experience with compilers) but I could not make up a satisfying language definition yet.