November 18, 2006 Re: What's left for 1.0? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Benji Smith | Benji Smith wrote:
> Bill Baxter wrote:
> > So, what's left on everyone's lists for D1.0 must-have features?
>
> Although D doesn't currently use a generational copying collector, it would be nice if we could anticipate the hurdles to implementing a copying GC in the current language, and develop some syntactic extensions to the language for copying with a copying GC.
> [...]
>
> It would be nice, before version 1.0 of D, to get the syntax in place for pinning pointers. With the current GC, all objects are permanently "pinned" anyhow, so this implementation would be semantically correct, even if it didn't do anything :) But at least, with the syntax in place, we'd be prepared for the eventual introduction of a generational copying GC, when such a thing is inevitably implemented.
>
> --benji
You didn't get a lot of response to this. But it sounds reasonable to me. The slowness of the garbage collector seems to come up as a topic fairly regularly here.
--bb
|
November 18, 2006 Re: What's left for 1.0? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Andre Osterhues | Andre Osterhues wrote:
> == Quote from Bill Baxter (dnewsgroup@billbaxter.com)'s article
>> So, what's left on everyone's lists for D1.0 must-have features?
>
> I think that the "Design by Contract" methods need to be updated to match the
> documents. Still, there are no AssertException, InException, OutException, and
> InvariantException in Phobos. To me, Design by Contract is a killer feature
> seldom found in other languages, yet its implementation (sorry to say that) is
> still quite poor.
Can you be a little more specific? What is it missing?
As for the specific functions you listed, is the behavior you want them to have documented anywhere?
And is there any reason you can't just write the functions yourself and submit them for approval? Do they require any additional compiler features?
--bb
|
November 18, 2006 Re: What's left for 1.0? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Bill Baxter | Bill Baxter wrote: > So, what's left on everyone's lists for D1.0 must-have features? For a language that has unheard of features like variadic template support (!) one thing that seems oddly immature to me is support for static initializers. Things like: * No way to initialize a static array without counting elements static byte[???] imageData = [...]; // i hope you like counting! * No way to initialize a dynamic array with a known length byte[] imageData; imageData.length = 5; // two steps - meh * No way to initialize array of strings char[][] list = ["eggs","bacon","milk","break"]; //uh uh * No way to initialize non-static struct Point p = { x:1.0, y:2.0 }; // nope...not static * No way to initialize associative array char[int] strTable = {"hello":5, "hi":2, "greetings":9}; // no way I know things have gotten much better since the old days, when there weren't even array literals (yikes!), but it still looks pretty primitive in some ways compared to C. --bb |
November 18, 2006 Re: What's left for 1.0? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Bill Baxter | Bill Baxter wrote:
> Bill Baxter wrote:
>> So, what's left on everyone's lists for D1.0 must-have features?
>
> For a language that has unheard of features like variadic template support (!) one thing that seems oddly immature to me is support for static initializers. Things like:
>
> * No way to initialize a static array without counting elements
> static byte[???] imageData = [...]; // i hope you like counting!
>
> * No way to initialize a dynamic array with a known length
> byte[] imageData; imageData.length = 5; // two steps - meh
>
> * No way to initialize array of strings
> char[][] list = ["eggs","bacon","milk","break"]; //uh uh
>
> * No way to initialize non-static struct
> Point p = { x:1.0, y:2.0 }; // nope...not static
>
> * No way to initialize associative array
> char[int] strTable = {"hello":5, "hi":2, "greetings":9}; // no way
>
>
> I know things have gotten much better since the old days, when there weren't even array literals (yikes!), but it still looks pretty primitive in some ways compared to C.
>
> --bb
I agree this has been in the past and still is a weak point.
|
November 18, 2006 Re: What's left for 1.0? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Craig Black | On Fri, 17 Nov 2006 07:28:31 -0800, Craig Black <cblack@ara.com> wrote:
> Very good. I never tried it but for some reason always thought it could not
> be done. Will Linux be getting this capability say, within a year or so?
>
> Also, is there a utility in phobos to load a DLL at run-time?
>
> -Craig
>
>
> "Walter Bright" <newshound@digitalmars.com> wrote in message
> news:ejis3v$499$1@digitaldaemon.com...
>> Craig Black wrote:
>>> Can you load a DLL that implements an abstract class at run-time?
>>
>> Sure. Just like in C++. (Note that shared library support isn't there in
>> the linux DMD yet, but this should work under Windows.)
>
>
I think shared library support is available in gdc. Gdc works on more platforms anyway. I really wish it were the standard compiler, but unforunately this isn't possible.
-JJR
|
November 18, 2006 Re: What's left for 1.0? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Bill Baxter | Bill Baxter wrote:
> And there doesn't seem to be a dchar string literal syntax.
"foo"d
cast(dchar)"foo"
both work.
|
November 18, 2006 Re: What's left for 1.0? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Bill Baxter | Bill Baxter wrote:
> For a language that has unheard of features like variadic template support (!) one thing that seems oddly immature to me is support for static initializers. Things like:
>
> * No way to initialize a static array without counting elements
> static byte[???] imageData = [...]; // i hope you like counting!
>
> * No way to initialize a dynamic array with a known length
> byte[] imageData; imageData.length = 5; // two steps - meh
>
> * No way to initialize array of strings
> char[][] list = ["eggs","bacon","milk","break"]; //uh uh
>
> * No way to initialize non-static struct
> Point p = { x:1.0, y:2.0 }; // nope...not static
>
> * No way to initialize associative array
> char[int] strTable = {"hello":5, "hi":2, "greetings":9}; // no way
>
>
> I know things have gotten much better since the old days, when there weren't even array literals (yikes!), but it still looks pretty primitive in some ways compared to C.
C can't do any of those things.
|
November 18, 2006 Re: What's left for 1.0? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Walter Bright | Walter Bright wrote: > Bill Baxter wrote: >> And there doesn't seem to be a dchar string literal syntax. > > "foo"d > cast(dchar)"foo" > > both work. Ok. Can you fix the link to StringLiterals on http://www.digitalmars.com/d/expression.html There's a link there in the PrimaryExpressions overview right in between CharacterLiteral and ArrayLiteral, but the target does not exist, and the docs jump straight from CharacterLiteral to ArrayLiteral. --bb |
November 18, 2006 Re: What's left for 1.0? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Walter Bright | Walter Bright wrote: > C can't do any of those things. Sure it can. >> * No way to initialize a static array without counting elements >> static byte[???] imageData = [...]; // i hope you like counting! C has no problem with this. I do it all the time: static const unsigned char[] = { 1,2,3,4,5,6,7, 255 }; >> * No way to initialize a dynamic array with a known length >> byte[] imageData; imageData.length = 5; // two steps - meh C has no problem with this (using malloc, its own concept of "dynamic arrays"): byte* imageData = (byte*)malloc(5*sizeof(byte)); A better comparison is C++, which has no problem with it's std library vector class: vector<int> imageData(5); >> * No way to initialize array of strings >> char[][] list = ["eggs","bacon","milk","break"]; //uh uh C can do this: char *list[] = { "eggs","bacon","milk","break" }; >> * No way to initialize non-static struct >> Point p = { x:1.0, y:2.0 }; // nope...not static C has no problem with that either: struct Point { float x, y; }; void foo() { Point p = {1.0,2.0}; } (and C99 can do it with the x: y: syntax too, I think) >> >> * No way to initialize associative array >> char[int] strTable = {"hello":5, "hi":2, "greetings":9}; // no way Well you got me there. C can't do that. >> I know things have gotten much better since the old days, when there weren't even array literals (yikes!), but it still looks pretty primitive in some ways compared to C. --bb |
November 18, 2006 Re: What's left for 1.0? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Bill Baxter | On Fri, 17 Nov 2006 23:45:59 -0500, Bill Baxter <dnewsgroup@billbaxter.com> wrote: > Bill Baxter wrote: > * No way to initialize a static array without counting elements > static byte[???] imageData = [...]; // i hope you like counting! Perhaps specifying 0 should be the convenient syntax: static byte[0] imageData = [...]; // real length replaced > > * No way to initialize a dynamic array with a known length > byte[] imageData; imageData.length = 5; // two steps - meh auto imageData = new byte[5]; > > * No way to initialize array of strings > char[][] list = ["eggs","bacon","milk","break"]; //uh uh This is a weird one but here is a workaround: char[][] list = ["eggs"[],"bacon","milk","break"]; but since static and const array initializers can get by without this workaround, so should initializers for other arrays. > > * No way to initialize non-static struct > Point p = { x:1.0, y:2.0 }; // nope...not static Agreed; workaround is to use a const dummy: const Point p_init = { x:1.0, y:2.0 }; Point p = p_init; > > * No way to initialize associative array > char[int] strTable = {"hello":5, "hi":2, "greetings":9}; // no way I'd be OK if this were a 2.0 thing. |
Copyright © 1999-2021 by the D Language Foundation