Thread overview | ||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
March 10, 2005 Lack of STL is annoying | ||||
---|---|---|---|---|
| ||||
I find the lack of a standard template library quite annoying. Being the weirdo I am I tried to write one myself multiple times, but failed, making it too clunky and slow. Is there an estimated time of release or group effort to make a central STL, as part of the standard package? The biggest problem I had, by the way, was that D is simply too perfect, and -I- am not. It's hard to code it in such a way that it's elegant and makes semantic sense at the same time. Coding an STL is a very fun practise though. I'm thinking of objects like stacks, vectors, strings, just containers. I tried to expand it with more functionality like spawn objects (keeps track of object instances) and extra string functionality (expanded with regexp), it would be nice if the D STL would be an improvement over the C++ STL. Maybe somebody already has a nice, simplistic STL? Or, if there's no group effort yet, maybe somebody wants to help me code a tiny, but powerful STL. PS: I don't like it that Phobos' namespace eats the names you may use for filenames like error.d, object.d, etc. PSS: Any good IDE there yet? |
March 10, 2005 Re: Lack of STL is annoying | ||||
---|---|---|---|---|
| ||||
Posted in reply to Joey Peters | >I find the lack of a standard template library quite annoying. I don't doubt it. > Being the weirdo > I am I tried to write one myself multiple times, but failed, making it too > clunky and slow. Is there an estimated time of release or group effort to make a > central STL, as part of the standard package? This year. > The biggest problem I had, by the > way, was that D is simply too perfect, and -I- am not. It's hard to code it in > such a way that it's elegant and makes semantic sense at the same time. Coding > an STL is a very fun practise though. Indeed! > I'm thinking of objects like stacks, vectors, strings, just containers. They're in the prototypical DTL, and also in minTL. > I tried > to expand it with more functionality like spawn objects (keeps track of object > instances) and extra string functionality (expanded with regexp), it would be > nice if the D STL would be an improvement over the C++ STL. It most certainly will be > Maybe somebody already has a nice, simplistic STL? Or, if there's no group effort yet, maybe somebody wants to help me code a tiny, but powerful STL. Go for it. Good bits can be folded in when we get serious on DTL. |
March 10, 2005 Re: Lack of STL is annoying | ||||
---|---|---|---|---|
| ||||
Posted in reply to Joey Peters | Joey Peters wrote:
> PS: I don't like it that Phobos' namespace eats the names you may use for
> filenames like error.d, object.d, etc.
Do you mean that you want to re-define Error and Object ? (I hope not)
Or just that you can't use those filenames without them being included ?
(which is somewhat annoying, especially with stray dogs like unittest.d)
Ignoring some out-of-place Phobos files like crc32.d & etc/c/zlib/zlib.d
which I hope will get cleaned up before the library is released? (D 1.0)
--anders
|
March 10, 2005 Re: Lack of STL is annoying | ||||
---|---|---|---|---|
| ||||
Posted in reply to Anders F Björklund | In article <d0pa16$1t4k$1@digitaldaemon.com>, =?ISO-8859-1?Q?Anders_F_Bj=F6rklund?= says... > >Joey Peters wrote: > >> PS: I don't like it that Phobos' namespace eats the names you may use for filenames like error.d, object.d, etc. > >Do you mean that you want to re-define Error and Object ? (I hope not) > > >Or just that you can't use those filenames without them being included ? (which is somewhat annoying, especially with stray dogs like unittest.d) > Mainly the filename thing. I think names like object.d, error.d, etc are pretty common choises. I also don't really understand why it doesn't work, according to the modules section it should just be poured in it's own namespace? |
March 10, 2005 Re: Lack of STL is annoying | ||||
---|---|---|---|---|
| ||||
Posted in reply to Matthew | >This year. Good. >Go for it. Good bits can be folded in when we get serious on DTL. Do you have some sort of a roadmap or design document for the DTL? |
March 10, 2005 Re: Lack of STL is annoying | ||||
---|---|---|---|---|
| ||||
Posted in reply to Joey Peters | > Maybe somebody already has a nice, simplistic STL? Or, if there's no group effort yet, maybe somebody wants to help me code a tiny, but powerful STL.
Perhaps I could help. I am a C++ programmer that has a lot of experience writing C++ templates. I personally don't like C++ STL, so I wrote my own template library. It's WAY easier to use than C++ STL and more powerful IMO. It currently only lacks a hash table template, but I understand that capability is provided by D natively. I've never programmed in D, but I've kept my eye on the language since it was introduced on the internet. To get a library started, I could port my templates to D.
However, I do not like the idea of having to rely on a slow GC. I understand that D supports the old new and delete approach. This would be better for container templates IMO.
Anyone interested?
-Craig
|
March 10, 2005 Re: Lack of STL is annoying | ||||
---|---|---|---|---|
| ||||
Posted in reply to Joey Peters | "Joey Peters" <Joey_member@pathlink.com> wrote in message news:d0p88j$1ru8$1@digitaldaemon.com... >I find the lack of a standard template library quite annoying. Being the weirdo > I am I tried to write one myself multiple times, but failed, making it too > clunky and slow. Is there an estimated time of release or group effort to > make a > central STL, as part of the standard package? The biggest problem I had, > by the > way, was that D is simply too perfect, and -I- am not. It's hard to code > it in > such a way that it's elegant and makes semantic sense at the same time. > Coding > an STL is a very fun practise though. > > I'm thinking of objects like stacks, vectors, strings, just containers. I > tried > to expand it with more functionality like spawn objects (keeps track of > object > instances) and extra string functionality (expanded with regexp), it would > be > nice if the D STL would be an improvement over the C++ STL. > > Maybe somebody already has a nice, simplistic STL? Or, if there's no group effort yet, maybe somebody wants to help me code a tiny, but powerful STL. > > PS: I don't like it that Phobos' namespace eats the names you may use for filenames like error.d, object.d, etc. > > PSS: Any good IDE there yet? > > Note in-depth design discussions about STL-like libraries for D should probably be on the newsgroup digitalmars.D.dtl It's generally very quiet so getting that puppy as busy as this main newsgroup would be a good thing. |
March 10, 2005 Re: Lack of STL is annoying | ||||
---|---|---|---|---|
| ||||
Posted in reply to Craig Black | Craig Black wrote:
>>Maybe somebody already has a nice, simplistic STL? Or, if there's no group
>>effort yet, maybe somebody wants to help me code a tiny, but powerful STL.
>
>
>
> Perhaps I could help. I am a C++ programmer that has a lot of experience writing C++ templates. I personally don't like C++ STL, so I wrote my own template library. It's WAY easier to use than C++ STL and more powerful IMO. It currently only lacks a hash table template, but I understand that capability is provided by D natively. I've never programmed in D, but I've kept my eye on the language since it was introduced on the internet. To get a library started, I could port my templates to D.
>
> However, I do not like the idea of having to rely on a slow GC. I understand that D supports the old new and delete approach. This would be better for container templates IMO.
Have you actually tried the "slow GC"?
|
March 10, 2005 Re: Lack of STL is annoying | ||||
---|---|---|---|---|
| ||||
Posted in reply to Georg Wrede | > Have you actually tried the "slow GC"?
No I haven't. But I know for a fact that in its current state, it is slow. Walter says so himself. It hasn't been optimized yet. And I don't see Walter optimizing GC in the near future.
Let me clarify myself. I do not mean to prevent programmers from using GC. I just don't want to use it internally for templates when there are more efficient ways of doing things.
-Craig
|
March 10, 2005 Re: Lack of STL is annoying | ||||
---|---|---|---|---|
| ||||
Posted in reply to Joey Peters | "Joey Peters" <Joey_member@pathlink.com> wrote in message news:d0p88j$1ru8$1@digitaldaemon.com... > I'm thinking of objects like stacks, vectors, strings, just containers. I > tried > to expand it with more functionality like spawn objects (keeps track of > object > instances) and extra string functionality (expanded with regexp), it would > be > nice if the D STL would be an improvement over the C++ STL. I'm just a D lurker so far, but it has been pointed out that half of the STL goes away since D has built in associative arrays (maps), and arrays act similar to vectors (and therefore stacks). Array slices also solve the problem of many algorithms. But yeah it would need filling out with libaries (deques and some algorithms). |
Copyright © 1999-2021 by the D Language Foundation