Hello World in Bard v0.3
I've got Hello World working in Bard v0.3! That's what I"m calling the version of the language supported by my new Node.js-based compiler, BTW.
Here's the original "Hello.bard" source file (you may notice a few small design changes from my last blog):
routine main->Integer
println( "Hello World!" )
return 0
#--------------------------------------
library StdIO
library.c_header "#include <stdio.h>"
routine println( message:[Int8] )
=> $'printf( "%s\\n", $message )'
Here's Hello.c that the compiler produces:
#include <stdio.h>
int main()
{
printf( "%s\n", "Hello World!" );
return 0;
}
The output of ./a.out:
Hello World!
Lots more to do but it's always exciting to get to this point!