views:

693

answers:

11

What with Delphi Prism coming soon, I've been looking at Oxygene (the Remobjects compiler, Delphi Prism will use), and have a found a few features I'd love to see in Delphi Win32. S

+6  A: 

Simple answer: All of them. Simply because that would make it one language again.

gabr
What I'm trying to get at is what is most important. somehow I doubt all will ever go in.
Steve
As a former Delphi user (9 years from the day it was release) I went to buy a copy recently to write some utilities. I was shocked at the pricing (why is there no cutdown edition) and couldn't understand all the various editions!
Fortyrunner
+5  A: 

ome of my favourites are :

Inline Property expressions and implicit property variables

property Length: double; 
property Width: double;
property Area: double read Length*Width

Property Initial Values

property Length: Integer := 15;

Iterators

While Iterators are available in Delphi, the use of sequences and the yield keyword makes creating them much easier.

method GetEmptyKeys: sequence of string;iterator;
...
property EmptyKeys : sequence of TKey read GetEmptyKeys;

...
...
...
method TMyClass.GetEmptyKeys
begin
  for each key in keylist do
    if key = '' then
      yield key;
end;

I could go on and on, but those would be very nice to have.

note this question has kind of been asked before but not in relation to Prism. here

Steve
A very good list! and they look like features that Codegear could implement relativly easy.Perhaps not so important now that we have generics, but there must have been hundereds of placers where this one-liner would have made sense in my code,property count: integer read internalList.count;
mliesen
I chose those features as in my opinion they are perhaps the easiest to implement, but then again unless you have the 300k line c code delphi compiler source in front of you, it's all easy!
Steve
A: 

Garbage collector

mliesen
That'd sure break Pascal's classical style. A good program has no need for a GC.
The Wicked Flea
Wicked Flea, Your conservative logic is absurd. Why use a high level language at all when you can use assembler?CodeGear has many options to be backward compatible, ranging from compiler switches to introducing keywords for managed classes.
mliesen
Garbage collection doesn't break Pascal's style. Delphi for .NET (the one before Prism) handled it just fine. (Delphi Prism doesn't have destructors, which could be construed as breaking Object Pascal's style.)
Jan Goyvaerts
Gotta agree with the Flea here. GC causes more problems than it fixes and encourages sloppy coding.
Mason Wheeler
Is GC a feature of Prism or the .net runtime?
Vegar
Is a feature of .net runtime.
Fabricio Araujo
It depends on your definition of Pascal. Classic Pascal is entirely, or almost safe. However the Borland dialects expand so much (and in a not safe way), that 99% of the codebases in Borland languages isn't, and the rest are probably examples. So any attempt to change fundamental aspects effectively creates a different language IMHO. And IMHO that is what Delphi.NET and Prism are, despite the "Delphi" marketing moniker
Marco van de Voort
+3  A: 

Apart from what Gabr said, some of the syntactic sugar cubes I would really like to have in Win32 are:

  • nullable types and related mechanisms like the colon operator and the coalesce compiler magic function
  • class contracts, i.e. pre- and post-conditions and invariants
  • require/allow variable on with statement, aka using
  • multi-threading enhancements, like async and future (ok, this is actually much more than just syntactic sugar)
Oliver Giesen
hmmm, now why would anyone actually bother to downvote this reply?...
Oliver Giesen
Because you mentioned the w-word. Thank goodness you didn't say anything about the g-word. :-)
Ulrich Gerhardt
@Ulrich: Ah, that might explain it... though it'd still mean that the downvoter didn't read what I wrote... the "w-word" combined with a required variable should no longer have any reason to be considered evil...
Oliver Giesen
+4  A: 

Some things that would have prevented me running back to Oxygene/Prism screaming, everytime I had to use Delphi in the past 3 or 4 years:

  • multi-pass compilation
    • cut the forward declares and that mutual usages require you to put everything in one file
  • type inference!
    • using, named with, inline vars
  • filenames are filenames, just filenames
    • they should not be identifiers, and most certainly not namespaces
    • make it crystal what gets compiled and what does not. This implicit search path stuff is very annoying, IMO.
  • class libraries that don't require anything else to be referenced
    • once referenced, no DCUs of units in the package should be necessary

I could go on on about actual language features. But some of them wouldn't even make sense in a single-pass compiler.
Or not a single language feature would come close to the benefits one of these general enhancements would bring to the table...

Robert Giesecke
If that's what you want, you're on the wrong language. Multi-pass and inline variable declaration would destroy two of Delphi's biggest advantages: fast compilation and predictable code structure. If you want to work with tons of syntactic diarrhea that takes forever to compile, switch to C++.
Mason Wheeler
Nope, I don't. I've been using Oxygene for some years, which has been renamed to Delphi Prism just recently. No syntactic diarrhea in it. Although I would have liked them to remove "begin" altogether. Like Wirth did when he made Oberon. ;-)
Robert Giesecke
A: 

I think the followings can be implemented quickly for starters:

  • try..except..finally block
  • method keyword (function and procedure distinction doesn't make sense imho)
  • require and ensure keywords
  • string in case statements
  • inline var
idursun
I don't like the 'method' keyword. It breaks all syntax compatibility with older code, without adding any new functionality.
Wouter van Nifterick
I think Prism still supports 'procedure' and 'function' keywords for backward compatibility as well
idursun
A: 

The colon operator looks wonderful. You have no idea how many times I've wished I had that in Delphi ever since I read about Oxygene having it. Same with double-comparisons, LINQ, try..except..finally and async/future declarations.

Put in features like this that would enhance the language, and leave out the slow, bloated "managed" crap that would wreck the fast, sleek, human-readable language I love, like multi-pass compilation, automatic garbage collection and inline variables, and I'd be very happy.

Mason Wheeler
It's not really the single-pass bit in DCC which makes it so much faster than others.Also, regarding garbage collection, I can't help but guess that you don't know what you're talking about :)
Moritz Beutel
@Moritz: I know exactly what I'm talking about. There is no good way to get another program to clean up after you in the general case, and trying to pretend that there is inevitably produces horrible performance in one way or another, either serious speed problems, excessive memory usage, or both.
Mason Wheeler
A: 

Preferably, none.

Marco van de Voort
Would you explain why?
Moritz Beutel
Haven't seen anything interesting.
Marco van de Voort
A: 

Why don't you vote for this? ;)

Alexander
+1  A: 

two pass compiler is number one!

The argument that speed will be slower doesn't hold water in reality.

Currently to have class A with at relationship to Class B without casting one declares the interface sections of these in a single unit.

With two pass you would not need to do that.

so you would have many smaller units with their dcus all ready compiled and only the unit you changed would need to be recompiled.

So 1 huge unit that vs many smaller units.

This is really a no brainer and with 64 bit coming why not do it right?

Steven T. Cramer
This totally changes the parsing model, and means rewriting the compiler bottom up. It might also have consequences for quality of errorgeneration
Marco van de Voort
+1  A: 

AOP, definitely.

Moritz Beutel