Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

For me it looks like a compilable python (with more complex syntax, of course) but with all the libraries of C.

The garbage collector without gc_free() means less control and memory leaks in complex programs (my biggest issue with python). I guess one could use malloc() and free() if they really want to (since C headers can be imported).

The hello world example is confusing though.



Hmm what is confusing in the hello world example?

And yeah, you can totally use malloc/free.

Either globally (e.g. just change the definitions of gc_malloc/gc_realloc etc. to be extern(malloc), extern(realloc), etc.) or locally for a specific class, e.g. overriding the "alloc" method of a class or writing your "new: static func() {}" yourself instead of relying on auto-new generation from "init: func() {}" methods.

We need more documentation =) Stay tuned.

EDIT: Added some docs here http://ooc-lang.org/docs/memory/no-gc.html


Thanks for the docs, what a quick and effective feedback !

Let's have a look at the "hello world" :

"Hello world!" println()

It is simple and short but makes no sense to me because the print function takes no argument and doesn't seem linked to the string "Hello world!" it prints.

When a function manipulate data, shouldn't it be passed as argument ? I would understand better:

println("Hello world!")

But maybe it's because it's not the first time I read code.

EDIT : OK, I just read your group post. Thanks.


println() isn't a function, it's a method/message passed to the "Hello world!" string object. The lack of syntax highlighting that (the strange dots) makes it difficult to notice.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: