Its basically C with Go like syntax, and a package system instead of headers. I aim to fully interop with existing C code and have no runtime requirements beyond what C has.
I'm not trying to go crazy with extra features over what C has though. An important part of what will make it work, is perfect interop with existing C code.
Yes I understand memory safety issues, but there is always a need for machine independent assembly languages. which C essentially is.
Unfortunately, no one will agree exactly on which aspects of C to change and which to keep - that's why we now have hundreds of languages used by less than 10 people each.
E.g. while I applaud the idea, I found many aspects of your example code snippets ugly and un-C-like. This is not to say that I'm worthy of judging your work, but that a) so much of it is a matter of taste rather than objective thought and b) humans can adapt to literally anything, given time to get used to it.
They are closer to Go than C I admit. Many languages are actually shifting to grammars similar to this for a few reasons. At the very least the grammar is less ambiguous, and its easier to code editing tools to recover after parse errors.
G will use llvm as its primary backend, and my intention follow the C ABI exactly so interop requires no work.
I haven't considered the standard library much beyond the fact that I would G to have its own that is inspired by the good parts of other languages. At first it would have to rely on C libraries.
G won't be able to support every way that the Go standard library works. But if you need everything Go has, then you probably want to use Go to begin with.
I think its important only add those things after the language can run the same sorts of programs C can currently.
For the future, some of my ideas include:
a form of combined data types that require a type-switch to disambiguate (and is checked by the compiler), like algebraic data types. (essentially sugar over tagged unions)
It may also have a form of defer blocks similar to Go defer statements. (sugar over the C idiom goto cleanup;)
A final thing I considered was a built in reference counted pointer type. Just to partially alleviate memory management, but without resorting to a garbage collected run time.
Its basically C with Go like syntax, and a package system instead of headers. I aim to fully interop with existing C code and have no runtime requirements beyond what C has.
I'm not trying to go crazy with extra features over what C has though. An important part of what will make it work, is perfect interop with existing C code.
Yes I understand memory safety issues, but there is always a need for machine independent assembly languages. which C essentially is.