Re:Apache loses Java showdown vote to Oracle
by rbanffy on Tuesday December 07, 2010 @03:10AM
(#1978404)
Looks interesting for low-level stuff. I assume memory management will become more sophisticated with time.
[ Parent
| on HN ]
Re:Apache loses Java showdown vote to Oracle
by kaffiene on Tuesday December 07, 2010 @04:17AM
(#1978514)
You can't do sophisticated GC in C. The memory model of the JVM is important - it knows what is a pointer and what is data, which is important for efficient GC.
Re:Apache loses Java showdown vote to Oracle
by rbanffy on Tuesday December 07, 2010 @04:22AM
(#1978520)
If course you can. But you will have to write a memory manager for that and make the compiler keep track of what your pointers point to. I don't know enough about Vala to say it's not desirable given its syntax and what it assumes about the memory management the program does, but it's not impossible.
It may be a whole lot of work.
Re:Apache loses Java showdown vote to Oracle
by dfox on Tuesday December 07, 2010 @10:34AM
(#1979316)
actually, you can do consevative GC in C just fine without any special support in compiler, see Boehm's GC. Which is actually what was until recently used in Mono and also extensively used by various other runtimes (gnu java, ecl, many scheme implementations...)
Re:Apache loses Java showdown vote to Oracle
by rbanffy on Tuesday December 07, 2010 @10:52AM
(#1979383)
True, but it would be uglier than if the compiler hid the CG behind a wall of syntactic sugar.
Re:Apache loses Java showdown vote to Oracle
by dfox on Tuesday December 07, 2010 @12:32PM
(#1979766)
Well, the only difference you see is that you call GC_malloc() instead of malloc() (and that can be redefined, even link-time), and that on some platforms (at least Cygwin and AIX, maybe also Solaris) you need to call GC_INIT() from main().
Re:Apache loses Java showdown vote to Oracle
by rbanffy on Tuesday December 07, 2010 @02:25PM
(#1980222)
Yes, but that should be placed in the C code, not in the Vala sources. Assuming it's a c#/Java-like language, the programmer should be spared from this job.
Re:Apache loses Java showdown vote to Oracle
by dfox on Wednesday December 08, 2010 @11:36AM
(#1983512)
In case of Vala I think that required modifications are pretty well limited to underlying runtime library (gobject) and do not touch compiler too much. But on the other hand they will be quite invasive across whole Gtk/Gnome platform.