Vala could replace C ...

renoX renosky at free.fr
Tue Sep 4 04:55:27 PDT 2007


Reiner Pope Wrote:

> renoX wrote:
> > Reiner Pope Wrote:
> >> kris wrote:
> >>> http://arstechnica.com/journals/linux.ars/2007/09/02/vala-high-level-programming-with-less-fat 
> >>>
> >>>
> >>> "Vala is still a work in progress, but support for the language is 
> >>> growing rapidly. Close GObject integration makes Vala an ideal choice 
> >>> for GNOME development, and the requisite library support is steadily 
> >>> falling into place. Vala's biggest deficiency right now is the lack of 
> >>> documentation. In time, Vala could replace C as the principle language 
> >>> of the GNOME platform."
> >> Most of the listed features, D has too:
> >> - Interfaces
> >> - Properties
> >> - Signals  (why is this a language feature?)
> > 
> > Maybe to have a better syntax? 
> > 
> >> - Foreach
> >> - Lambda expressions
> >> - Type inference for local variables
> >> - Generics
> >> - Non-null types
> > 
> > Are you sure that D has the 'non-null types' feature?
> > What I understand by 'non-null types' is like in Nice:
> > having a syntax to declare nullable types, and by default types are not nullable i.e
> > Type foo = null; is an error (if possible a compile-time error).
> > Type? foo = null; is ok.
> > This means that when you have a function f(Type t) you don't need to check in f whether t is null or not, it's already done for you.
> > 
> > AFAIK D doesn't have this.
> 
> You should have read what you quoted afterwards  :-)
> 
> >> I'm not sure how type modules work, but I do know about non-null types, 
> >> and they would sure be nice in D.
> >>
> >>
> >>    -- Reiner
> > 
> 
> D doesn't have it, but I think they would be nice.

Ooops, sorry for having misread your post.

And yes it would be nice but on one hand it's a "specialised" feature, it only works for non-null checks, I've read some article about Haskell which talks about 'type modifiers' where for example you could declare a function to return a type 'Maybe Foo'
and the typesystem makes you checks whether there is an error or not before being able to use 'Maybe Foo' as 'Foo'..
So it's more generic, but of course having Type? is a more readable syntax than 'MaybeNull Type'.

renoX

> 
>     -- Reiner




More information about the Digitalmars-d-announce mailing list