April 03, 2007
Jari-Matti Mäkelä wrote:
> [...]
> Sorry, I was not trying to disparage Walter's or Don's work. Sorry if I
> sounded like that.
> [...]

I didn't take your post that way at all.  I was just making a point.

Dave
April 03, 2007
David B. Held wrote:
> So while languages built
> around "religious principles" (everything is an Object, everything is
> message-passing, everything is a function, etc.) may be elegant, they
> are often not entirely practical.

I think you are underestimating the importance of language constructs with sound mathematical backing.

> Somewhere in between Haskell and C is a set of compromises that result in an elegant type system that recognizes that memory is not infinite and processors take real clock cycles to get things done.  While D does not necessarily position itself ideally within this space, I think it offers some compelling features in a unique combination that is fairly rare in many of the newer languages.

The languages I listed in the previous post have a strong community behind them (well, except Spec# perhaps) and seem to be suitable for real world applications. In addition, they are very similar to D or what D seems to be becoming. The fact that most of them run on top of a VM doesn't make them inferior as a language.

> Unfortunately, there is not enough science to design a language from start to finish with every feature you might want to add.

> The more you expose the rough edges of the language with practical programs, the more motivation will exist to recast those features in a more refined mold.

Learning from practical problems is just one way to see things.
I know Walter has been in contact with the C++ world, but D has also
embraced the functional paradigm quite much. Knowledge of functional
languages has existed for over 50 years. I'm sure they have made
practical points too, not only academic daydreaming.
April 03, 2007
eao197 wrote:
> I understand that transforming IfStatement/SwitchStatement from a  statement to an expression may be very hard. And optional ReturnStatement  may be very hard to implement too. It would be great, but if not it won't  be a tragedy. But I hope that optional semicolons is much easier to  implement. And such trifle can make D much more expressive (the Scala  history shows this).

Well, you might want to give it a try. It shouldn't bee all too hard to write a "D++ to D" filter, that simply adds semicolons at the end of every line, except for a few situations, which could be found out using regular (probably multi-line) expressions.

This first try at it would of course be limited, as taking care of every situation might be more work, but the result could already be informative.


Quite another thing is, the semicolons bring redundancy to the code that _humans_ need more than the compiler. Readability, clarity of meaning, and the possbility to split an expression to several lines, they all bring time savings when reading and understanding the code at a glance.

Also many people have to use C, C++ or Java, and the semicolon behaving in a familiar way does reduce the mental burden of switching between these languages.

All that outweighs the drag of one more key press on most of the lines. Besides, the actual "time savings" when writing code aren't all that massive. For example object.d (my version is DMD 0.163, and I admit this is an arbitrary file, ;-) but still) contains 620 lines, and only 193 of them contain a semicolon. That's less than a third.
April 03, 2007
Am 02.04.2007, 11:29 Uhr, schrieb Lionello Lunesu <lio@lunesu.remove.com>:

> Downs wrote:
>> Feature request: Allow functions of the form function-declaration statement;
>> Example: int test() return 5;
>>  This would make the function syntax closer to the way if/else, while, for and similar
>> statements' blocks are handled now, potentially making parsing easier. It would
>> also help with internal consistency.
>> Also, it would allow methods like void test() synchronized(this) { }, which to me just
>> looks cleaner than using brackets to contain a single statement.
>
> I never thought of this, or needed this, but it makes sense though. let { } be used for grouping statements. Nice.
>
> L.

Nice indeed.

-- 
Erstellt mit Operas revolutionärem E-Mail-Modul: http://www.opera.com/mail/
1 2
Next ›   Last »