4 ms·
So what does the HN community think of Vala (http://live.gnome.org/Vala http://live.gnome.org/Vala)? C# like syntax. Compiles down to C. Reference counting f
by chadj 16y ago
So what does the HN community think of Vala (http://live.gnome.org/Vala http://live.gnome.org/Vala)? C# like syntax. Compiles down to C. Reference counting for memory management. Appears to work with clang as well.
More example syntax here: http://live.gnome.org/Vala/Tutorial http://live.gnome.org/Vala/Tutorial
- zaph0d 16y agoThanks, but no thanks.
- rbanffy 16y agoLooks interesting for low-level stuff. I assume memory management will become more sophisticated with time.
- kaffiene 16y agoYou 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.
- rbanffy 16y agoIf 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.
- dfox 16y agoactually, 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...)
- rbanffy 16y agoTrue, but it would be uglier than if the compiler hid the CG behind a wall of syntactic sugar.
- dfox 16y agoWell, 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().
- rbanffy 16y agoYes, 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.
- dfox 16y agoIn 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.
- bergie 16y agoWe use it on the server side with http://midgard2.org/ http://midgard2.org/ Check out https://github.com/midgardproject/midgard-core/tree/master/src/vala https://github.com/midgardproject/midgard-core/tree/master/s...