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.
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/
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.
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.
about
blog
docs
community
downloads
rock has preliminary support for interfaces. mixins and namespaced imports are coming up soon! killer, simple syntax as usual.
for the first time, rock, a 10k SLOC pure ooc codebase, compiles under Win32, and produces executables with gcc. party?
blogpost! gtksourceview highlighting for ooc – gedit & anjuta, rock progress, sudoku solver http://bit.ly/dt0GI1
#ooc_lang for the web! fastcgi bindings by joshthecoder: http://bit.ly/9AcGCa
discount bindings (markdown text to html library) for @ooc_lang by @zenhob http://bit.ly/5dg2K7 coolness!
rock has constructors, half generics, operator overloads on the way. commit frenzy! http://bit.ly/5M8syC
finalizers in j/ooc, meta-classes in rock, yajit, deadlogger, woot, oos, arbitrary precision arithmetic http://bit.ly/5kHIcZ
The ooc blog is online again, thanks @aguspiza for reporting the problem!
@aguspiza Ow. Investigating, thanks for reporting!
yajit works again! check it out: http://github.com/nddrylliog/yajit (special thanks to fredreichbier & showstopper)
rock (ooc compiler in ooc) compiles classes and covers =) don't try it at home yet, though - it's still highly experimental
@alejandrocrosa Hmmm, rtfm? http://docs.ooc-lang.org/ooc-slim/executable-size.html ;)
@arvennard The C++ object model is too complex. And the C syntax has many drawbacks. ooc is, imho, much more readable/light/flexible.
(continued)... that change will allow very nice array and map literals, and other data structs will be usable easily too. Stay tuned.
SubProcess new() now takes an ArrayList<String> instead of String*. (breaking change). ArrayList and HashMap will be BasicTypes soon.
#ooc-lang freeimage bindings: http://bit.ly/2UJ4s7
#ooc_lang libdispatch bindings: http://bit.ly/O2Omd
Fun with version blocks http://paste.pocoo.org/show/151214/ shows the ooc object model flexibility once again!
@minnowcoder Do you have examples of 'more involved pattern matching' ? The match is a regular ooc match comparing classes..
Fun with fake variable-length argument lists: http://paste.pocoo.org/show/151147/ (code in comments = future syntax)