Type inference is possible with OO languages. Ironically recent versions of C# have a rather pathetic form of type inference. Anyway, OCaml has type inference, duck typing, strong typing and excellent OO.
GUI toolkits can be designed on pure functional principles, although that wasn't what I was advocating. Look up Functional Reactive Programming. There are various toolkits for Haskell implementing these techniques.
Safety is always a good thing to build into modern languages, not just because no one wants their programs to crash so much, but because in some cases it really matters - errors and inaccuracies in GUI programs can have all sorts of effects from wasted time right up to death. Languages should be designed to reduce programmer mistakes. Garbage collection is one of many techniques in this area. Others include: design contracts, modularity, strong typing, phantom types, test-driven development.
Unfortunately all of this research seems to have passed over the heads of the developers of Vala.
Posted Jun 4, 2009 14:11 UTC (Thu) by walters (subscriber, #7396)
[Link]
Type inference is possible with OO languages. Ironically recent versions of C# have a rather pathetic form of type inference.
Sure (and what is ironic about it?), but what I am claiming it that it's not overly useful in a heavily imperative/OO context, given that C++/Java/C# programmers have gone many years without it. Eclipse does a good enough job at filling out generics right now for me.
Unfortunately all of this research seems to have passed over the heads of the developers of Vala.
You missed by point that garbage collection would have been incompatible with a key Vala design goal. It didn't "pass over their head".
We can't use GC in the lower level components of the GNOME stack because then if you wanted to use a higher level language (like OCaml!) on them, you'd have two different garbage collectors in the same process which is a recipe for disaster.
Vala definitely has modularity and strong typing. I'd argue test-driven development is not a language feature but a cultural feature. I'm not familiar with phantom types.
Anyways, you seem to be essentially saying that because Vala isn't OCaml it must be broken, when there are actual engineering tradeoffs that you're not recognizing.
A look at two new languages: Vala and Clojure
Posted Jun 4, 2009 14:13 UTC (Thu) by rwmj (subscriber, #5474)
[Link]
Posted Jun 4, 2009 19:28 UTC (Thu) by khim (subscriber, #9252)
[Link]
Sure (and what is ironic about it?), but what I am claiming it
that it's not overly useful in a heavily imperative/OO context, given that
C++/Java/C# programmers have gone many years without it.
Then why it's added to C#, C++ (gcc 4.4 at least does have it), etc? Are
you sure developers do it because they all are mad?
Eclipse does a good enough job at filling out generics right
now for me.
Yup. Basically you are using type inference - just implemented
not in compiler as sane people are doing but in editor. And it produces
tons of useless clutter because it's implemented in wrong place.
We can't use GC in the lower level components of the GNOME
stack because then if you wanted to use a higher level language (like
OCaml!) on them, you'd have two different garbage collectors in the same
process which is a recipe for disaster.
Why is it a disaster? You can combine compiled Java code (GCJ) and
Scheme code (Guile) in a single process - and everything "just works".
Sure, it's not exactly super-fast (you are scanning some small regions of
memory twice), but no other problems are shown...
Anyways, you seem to be essentially saying that because Vala
isn't OCaml it must be broken, when there are actual engineering tradeoffs
that you're not recognizing.
Nope. If you want to see the language designed around existing
OO-system, but which is done right - take look on Groovy. It's not perfect
(no
language is perfect) but it adds a lot of usefull features to Java while
reusing the same JVM. Sure, JVM does have richer set of features if
you compare it with GLib/GObject, but still the Vala is pretty pathetic
language.
Are you sure all the language developers are mad?
Posted Jun 5, 2009 18:53 UTC (Fri) by amaranth (subscriber, #57456)
[Link]
Vala does have some type inference, btw. Just like C#, it supports things like this: