only on caturday

Setting up a working ooc-environment

Requirements

Download and Build

ooc is hosted on github. To get the current snapshot of the ooc-compiler use the following command:

git clone git://github.com/nddrylliog/ooc.git
cd ooc/
ant

NOTE: The Makefile also has a 'gcj' target, but it may cause problems - you're warned.

Install

Now you should have a file called "ooc.jar" in bin/. If not, see here. In order to be able to call the binary from anywhere copy utils/ooc somewhere into your PATH, e.g. /usr/bin/.

sudo cp utils/ooc /usr/bin/

Maybe you want to edit the file to set where the distribution is located. This is done by changing the path of OOC_DIST to the specific path, e.g.

export OOC_DIST=/home/<username>/ooc/

Test

To check if everything worked fine you should now be able to compile and execute a simple "Hello World"-program.

main: func {
    "Hello world!" println()
}

Copy this into hello.ooc and run

ooc hello.ooc -r

(the -r flags runs your program after compilation)

If everything is correct "Hello world!" should be printed on the console. And you should have a "hello" or "hello.exe" file created ;) ooc uses GCC by default, but you can use the flags -tcc, -icc, -clang to switch to another. Also, if you want to see the C files created by ooc, use the -noclean flag. See here for other compiler options.

Note for OSX users: If you encounter "in libs/osx64/libgc.a, file is not of required architecture", use the "-m32" compiler flag. Apparently Java on OSX reports CPU architecture as 64bits even when it's 32. Go annoy Apple until they fix that =)

There are many examples in the tests/ directory - check it out! It's the best way to learn ooc. Agreed, we lack documentation. Want to write some? Feel free! We'll review and publish it happily.

problems?

IMPORTANT: ooc is bleeding-edge software so it's not unlikely to experience some problems, e.g. compilation errors. For bug reports or if you just have a simple question feel free to join our IRC-channel (#ooc-lang on irc.freenode.net).

When you report a bug on #ooc-lang, and we say it's fixed & committed, just do

git pull
ant clean
ant

'ant clean' is not always necessary. However, recompiling without cleaning first can lead to problems, so don't report a bug unless you've tried with cleaning before building.

 
 
Creative Commons License 2010, nddrylliog & the ooc crew