View mode: basic / threaded / horizontal-split · Log in · Help
January 19, 2012
Re: Why the Standard Library
On 19-01-2012 22:26, Zachary Lund wrote:
> On Thursday, 19 January 2012 at 21:22:23 UTC, Zachary Lund wrote:
>> On Thursday, 19 January 2012 at 19:06:41 UTC, Alex Rønne Petersen wrote:
>>> On 19-01-2012 19:52, Zachary Lund wrote:
>>>> I've been wondering in the back of my mind for awhile now and it really
>>>> hasn't bothered me much but I figured I might as well get it off my
>>>> mind.
>>>>
>>>> Why is there a need for a default "standard" library? I can understand
>>>> about some of the core stuff, but hell, even threads can be handled via
>>>> a 3rd party library. Why must Phobos or any library be a part of D
>>>> itself?
>>>>
>>>> I'm unfamiliar with the reason for C++ having a standard library as
>>>> well
>>>> (which I bring up when people bitch about poor design or something
>>>> similar which I usually get no viable or any answer at all). More of an
>>>> ignorant question probably but oh well...
>>>
>>> Without a standard library, interoperation between libraries becomes
>>> a huge pain, because there's no standard interface/design for various
>>> things such as threads, containers, bigints, networking, file I/O, etc.
>>>
>>> Not to mention, if a standard library didn't exist, you'd have to
>>> adapt your build system to whatever arbitrary amount of libraries you
>>> need to use.
>>
>> C++ has interoperability between containers and allocators which have
>> done much good. However, they hardly have any libraries that force
>> preferential design that doesn't require flexible implementation.
>>
>> Things like bigint and networking are not based on optimized or
>> flexible implementation but on ease of use. You generally choose a
>> BigInt library that is the easiest to use, not the one that has the
>> most flexibility when it comes to which implementation it uses or the
>> one that is most optimized. Also, I'm not sure who would reuse the
>> std.socket design. There are plenty of libraries that give a more
>> robust and clean interface to sockets.
>>
>> I don't mind robustness but I do not like being forced onto a
>> preferential design (which doesn't require flexible implementation)
>> simply because it is in the "standard". I do not think the etc.curl or
>> std.bigint promote library interoperability. Thus, I do not think
>> these modules belong in the library considered "standard".
>>
>> Also, libraries aren't really that big of a pain to add to a build
>> system. It's generally just a matter of finding where the library is.
>> On Linux, this is simple. On Windows, it generally requires either
>> environmental variable or user input. I don't see any way around this
>> nor do I find putting everything into one glob of a library a solution.
>
> I also forgot to mention about library reuse. You don't tend to use
> BigInt libraries all the time. In 6 years of programming, I've not used
> a single one. Nor have I used regex in a C program. Nor have I needed
> the constant use of MD5 hashing. And I sure as hell did not need the
> constant use of CURL or ZLib nor have I ever even used those libraries.
>

Right. But again: Nobody forces you to link to all of Phobos.

-- 
- Alex
January 19, 2012
Re: Why the Standard Library
What I want to know, is why "std.stdio" wasn't named "std.io"... 
*sigh*.. my OCD is going to drive me crazy one day.
January 19, 2012
Re: Why the Standard Library
On 19-01-2012 23:13, F i L wrote:
> What I want to know, is why "std.stdio" wasn't named "std.io"...
> *sigh*.. my OCD is going to drive me crazy one day.
>

That *is* a valid concern IMHO.

-- 
- Alex
January 19, 2012
Re: Why the Standard Library
On Thu, Jan 19, 2012 at 3:31 PM, Alex Rønne Petersen <xtzgzorex@gmail.com>wrote:

> On 19-01-2012 23:13, F i L wrote:
>
>> What I want to know, is why "std.stdio" wasn't named "std.io"...
>> *sigh*.. my OCD is going to drive me crazy one day.
>>
>>
> That *is* a valid concern IMHO.
>
> --
> - Alex
>

I proposed Steve Schveighoffer's stdio overhaul take the name std.io and
std.stdio retains its name for backward compatibility.  I can't remember if
the idea was well received.

Regards,
Brad Anderson
January 19, 2012
Re: Why the Standard Library
On Thu, 19 Jan 2012 17:42:27 -0500, Brad Anderson <eco@gnuk.net> wrote:

> On Thu, Jan 19, 2012 at 3:31 PM, Alex Rønne Petersen  
> <xtzgzorex@gmail.com>wrote:
>
>> On 19-01-2012 23:13, F i L wrote:
>>
>>> What I want to know, is why "std.stdio" wasn't named "std.io"...
>>> *sigh*.. my OCD is going to drive me crazy one day.
>>>
>>>
>> That *is* a valid concern IMHO.
>>
>> --
>> - Alex
>>
>
> I proposed Steve Schveighoffer's stdio overhaul take the name std.io and
> std.stdio retains its name for backward compatibility.  I can't remember  
> if
> the idea was well received.

It is in the works:

https://github.com/schveiguy/phobos/commit/9ee5034f446877b0e78fec608271084d289f6345

-Steve
January 19, 2012
Re: Why the Standard Library
On Fri, 20 Jan 2012 09:31:12 +1100, Alex Rønne Petersen  
<xtzgzorex@gmail.com> wrote:

> On 19-01-2012 23:13, F i L wrote:
>> What I want to know, is why "std.stdio" wasn't named "std.io"...
>> *sigh*.. my OCD is going to drive me crazy one day.
>>
>
> That *is* a valid concern IMHO.

I thought that the name std.stdio reflected that the module is in the  
standard library (std.) and that the module contains standard I/O members  
rather than extraordinary I/O members, which may be contained in another  
module that is also in the standard library.

In other words, the 'std' is not a duplication because it has two meanings  
depending on the context. "std." refers to it being in the standard  
library and "stdio" refers the the members *of that module* being standard  
i/o stuff and not special i/o stuff.

-- 
Derek Parnell
Melbourne, Australia
January 19, 2012
Re: Why the Standard Library
> It is in the works: 
> https://github.com/schveiguy/phobos/commit/9ee5034f446877b0e78fec608271084d289f6345

Ha! That's awesome. When do you think this update will take 
effect?


Derek wrote:
> I thought that the name std.stdio reflected that the module is 
> in the standard library (std.) and that the module contains 
> standard I/O members rather than extraordinary I/O members, 
> which may be contained in another module that is also in the 
> standard library.
>
> In other words, the 'std' is not a duplication because it has 
> two meanings depending on the context. "std." refers to it 
> being in the standard library and "stdio" refers the the 
> members *of that module* being standard i/o stuff and not 
> special i/o stuff.

Then why isn't "std.math" not "std.stdmath"? Default (or 
"standard") libs should have names without qualifiers (seeing as 
how they're in the standard library already). Libs with extra or 
uncommon utilities should be the ones with naming pre/post 
affixes, eg, "std.io" and "std.iospecial".
January 19, 2012
Re: Why the Standard Library
On Thursday, January 19, 2012 22:33:30 Alex Rønne Petersen wrote:
> Regardless of your preferences, the majority of the D community likes to
> have a standard library, so there's no reason to just stop shipping it
> (even though I don't think that's what you're suggesting).

Most languages have fairly large standard libraries. If anything, Phobos is 
small. Just look at languages like C#, python, or Java. Many programmers now 
expect large standard libraries. They don't prevent you from using 3rd party 
solutions if you want to, but they make the language a lot easier to use.

- Jonathan M Davis
January 20, 2012
Re: Why the Standard Library
On Fri, 20 Jan 2012 10:33:33 +1100, F i L <witte2008@gmail.com> wrote:

> Derek wrote:
>> I thought that the name std.stdio reflected ...
>
> Then why isn't "std.math" not "std.stdmath"?

Please don't misunderstand me. I wasn't defending the name, just stating  
what I thought the rationale behind it was.


-- 
Derek Parnell
Melbourne, Australia
January 20, 2012
Re: Why the Standard Library
On Thu, 19 Jan 2012 18:33:33 -0500, F i L <witte2008@gmail.com> wrote:

>> It is in the works:  
>> https://github.com/schveiguy/phobos/commit/9ee5034f446877b0e78fec608271084d289f6345
>
> Ha! That's awesome. When do you think this update will take effect?

I first have to show it's a) better and b) a drop-in replacement :)

I am slowly working on it when I have time.  But the implementation is  
mostly finished (from my previous version that everyone hated), it just  
needs to be designed correctly.

-Steve
1 2 3
Top | Discussion index | About this forum | D home