With the latest version of the language, we have fairly full support to string literals. I also introduced support to declaring functions. While it’s possible to declare functions that are defined in the same module, since Practical supports perfect forward referencing, that is a futile thing to do. Declarations are meant for linking with functions defined elsewhere.
I’ve also introduced the ability to define an ABI while declaring a function. The only ABI, besides Practical, currently supported is “C”, for linking with external C functions. Most useful, at this point, is the use of the standard library.
Accordingly, I have finally closed bug #1: Compile a program that prints “Hello, world”. It is still not particularly good looking, but it nominally satisfies the above condition:
decl main() -> S32;
decl("C") puts( string : C8@ ) -> S32;
def main() -> S32 {
if( puts("Hello, world\n")>=0 ) {
0
} else {
1
}
}
Next on my to do list (not yet sure of the order):
- Arrays
- Slices
- Compound types (structs).
- importing modules
The later, in particular, might open the door for starting to work on the run-time library.
I’m very excited. This is beginning to look like an actual language.