Feature request: one-statement functions without brackets

Jari-Matti Mäkelä jmjmak at utu.fi.invalid
Mon Apr 2 16:00:36 PDT 2007


eao197 wrote:
> An interesting example of language syntax simplification can be seen
> from Scala language (http://www.scala-lang.org).

I've recently read about Scala. It's a very promising language. Maybe a
bit slow currently, but I've read they are working on it.

> This improvement has made Scala a very short-spoken language. In
> conjunction with other things (like: every expression has a value, type
> inference and optional {} in function body definition) Scala programs
> have less syntax noise than in С++/D or Java.

It has been interesting to observe the evolution of D. It seems that
today many languages are evolving to the same direction. I've heard even
Visual Basic is starting to implement ideas from the "higher level"
languages. C# 3.0 incorporates features found in functional languages.
Recently also D has got high level features that really boost the
expressiveness. Scala has gained much interest in the academic world and
is making big leaps in expressiveness (thanks to pattern matching,
traits, being fully object oriented, doing multiple inheritance "right"
etc.). And then there are Ocaml, F#, Spec#, Haskell and others. As far
as I see it, this causes a lot of competition. :)

Now, after the AST macros and the new type system have be implemented, I
think D will be in a difficult situation. Should it follow the route
that results in implementing everything but kitchen sink while keeping
the syntax similar to C/C++/Java or should it evolve into a relatively
simple, powerful and orthogonal core language that allows implementing
all higher level constructs without cluttering the common core. Of
course this is not just black and white.

It's a shame that the academic world hasn't really put interest in D. It
has a lot of potential while still remaining practical and useful for
real world applications. I think there is unorthogonality in D that
could be resolved much better with the help of academic expertise.

I personally would like to see the gap between static (compile time) and
dynamic (runtime) worlds closing. There are so many similarities between
templates and ordinary functions & lambdas. Also type inference could be
more general. Of course I understand Walter has only limited time and
everyone has their favorite feature request, but these things look
important to me ATM. It just seems that there's no clear roadmap and the
language is just wandering blindfolded there somewhere. What do you think?



More information about the Digitalmars-d mailing list