Pierre THIERRY wrote:
> I've just moved from the old rsync-based bitc source to Mercurial,
> successfully built osdoc and the coytools, then bitcc. Now I'd like to
> use it a bit to see it in action, but I already struggle with Hello
> World:
> 
> ----8< hello1.bitc ------------------------------------------------------
> (bitc-version "0.10")
> (import stdio bitc.stdio)
> (stdio.write-string stdio.stdin "Hello world!")
> ----8<------------------------------------------------------------------
> 
> $ ./bitcc -I ../include/ hello1.bitc
> hello.bitc:3:6: syntax error
> Exiting due to errors during Parsing
> 
> ----8< hello2.bitc ------------------------------------------------------
> (bitc-version "0.10")
> (import stdio bitc.stdio)
> (quux stdio.stdin "Hello world!")
> ----8<------------------------------------------------------------------
> 
> $ ./bitcc -I ../include/ hello2.bitc
> hello.bitc:3:5: syntax error
> Exiting due to errors during Parsing
> 
> 
> So it finds a syntax error at the end of the first identifier of my line
> of code (3:6 is the 'o' of stdio and 3:5 is the 'x' of quux). 
> 
> What am I doing wrong? (FWIW, I'm in $BITC_ROOT/host/bin, after make and
> make install)

A top-level form in BitC must be a defining form. That is, one of
define, defstruct, defunion, defrepr, deftypeclass, definstance.

The parser is looking for one of these keywords, to begin a top-level
form, which is why you are getting a syntax error after the end of the
first word.

Also, in order to run the program, the compiler will need a `main'
procedure. There is an example of Hello World program in the test cases:
src/bitcc-bootstrap/tests/unit/hello.bitc

Swaroop.

_______________________________________________
bitc-dev mailing list
[email protected]
http://www.coyotos.org/mailman/listinfo/bitc-dev

Reply via email to