Jump to page: 1 210  
Page
Thread overview
phobos dependencies
Dec 18, 2013
Dmitry Olshansky
Dec 18, 2013
Dmitry Olshansky
Dec 18, 2013
H. S. Teoh
Dec 19, 2013
Shammah Chancellor
Dec 19, 2013
Adam D. Ruppe
Dec 18, 2013
Walter Bright
Dec 18, 2013
Meta
Dec 19, 2013
Justin Whear
Dec 19, 2013
Dicebot
Dec 19, 2013
Dicebot
Dec 19, 2013
Meta
Dec 19, 2013
Jacob Carlborg
Dec 19, 2013
Adam D. Ruppe
Dec 19, 2013
Brad Anderson
Dec 19, 2013
Andrej Mitrovic
Dec 19, 2013
Marco Leise
Dec 19, 2013
Simen Kjærås
Dec 19, 2013
Dicebot
Dec 19, 2013
Jacob Carlborg
Dec 19, 2013
Idan Arye
Dec 20, 2013
Meta
Dec 20, 2013
Andrej Mitrovic
Dec 20, 2013
Andrej Mitrovic
Dec 20, 2013
Jacob Carlborg
Dec 20, 2013
H. S. Teoh
Dec 20, 2013
H. S. Teoh
Dec 20, 2013
Walter Bright
Dec 20, 2013
monarch_dodra
Dec 20, 2013
captaindet
Dec 20, 2013
H. S. Teoh
Dec 20, 2013
Patrick Down
Dec 20, 2013
Meta
Dec 20, 2013
Michel Fortin
Dec 20, 2013
H. S. Teoh
Dec 20, 2013
monarch_dodra
Dec 20, 2013
Martin Nowak
Dec 21, 2013
Meta
Dec 20, 2013
Michel Fortin
Dec 20, 2013
H. S. Teoh
Dec 20, 2013
Martin Nowak
Dec 20, 2013
monarch_dodra
Dec 20, 2013
H. S. Teoh
Dec 21, 2013
Michel Fortin
Dec 21, 2013
Dmitry Olshansky
Dec 21, 2013
Chris Cain
Dec 21, 2013
Dicebot
Dec 21, 2013
Dmitry Olshansky
Dec 21, 2013
Dicebot
Dec 21, 2013
Andrej Mitrovic
Dec 23, 2013
Marco Leise
Jan 07, 2014
Robert Schadek
Jan 07, 2014
Andrej Mitrovic
Jan 07, 2014
Dicebot
Dec 21, 2013
Dmitry Olshansky
Dec 21, 2013
monarch_dodra
Dec 21, 2013
Dmitry Olshansky
Dec 22, 2013
Paolo Invernizzi
Dec 22, 2013
Dmitry Olshansky
Jan 06, 2014
Martin Nowak
Jan 06, 2014
Kenji Hara
Jan 06, 2014
Kenji Hara
Jan 06, 2014
H. S. Teoh
Jan 06, 2014
Walter Bright
Jan 07, 2014
monarch_dodra
Jan 07, 2014
Timon Gehr
Aug 04, 2014
Martin Nowak
Dec 21, 2013
Martin Nowak
Dec 20, 2013
H. S. Teoh
Dec 19, 2013
Jacob Carlborg
Dec 19, 2013
Craig Dillabaugh
Dec 19, 2013
Martin Nowak
Dec 20, 2013
Andrej Mitrovic
December 18, 2013
http://chopapp.com/#fvepfd8 shows the number of dependencies (plus 1) for each module in phobos. Those include druntime dependencies.

With https://github.com/D-Programming-Language/phobos/pull/1768 dependencies would be generated automatically, which should be a good step toward reining in.

The zsh command I ran was  wc -w generated/**/*.deps | sort -nr.


Andrei
December 18, 2013
19-Dec-2013 01:06, Andrei Alexandrescu пишет:
> http://chopapp.com/#fvepfd8 shows the number of dependencies (plus 1)
> for each module in phobos. Those include druntime dependencies.
>

So the bill of using pretty much anything in Phobos is pulling in 87 modules. Pretty much what I feared it is.

-- 
Dmitry Olshansky
December 18, 2013
On 12/18/13 1:16 PM, Dmitry Olshansky wrote:
> 19-Dec-2013 01:06, Andrei Alexandrescu пишет:
>> http://chopapp.com/#fvepfd8 shows the number of dependencies (plus 1)
>> for each module in phobos. Those include druntime dependencies.
>>
>
> So the bill of using pretty much anything in Phobos is pulling in 87
> modules. Pretty much what I feared it is.

There are several directions we can take this.

1. Improve the compiler to handle imports lazily, i.e. an unused import is never opened. That's unlikely to help a lot of uses because most unqualified name lookups require all imports to be loaded (even after the name if resolved, the compiler must still look for ambiguities).

2. Push imports from top level into the entities (functions, classes etc) that use them.

3. Apply classic dependency management (break larger modules in smaller ones, accept some code duplication etc).

I favor (2).


Andrei


December 18, 2013
19-Dec-2013 01:40, Andrei Alexandrescu пишет:
> On 12/18/13 1:16 PM, Dmitry Olshansky wrote:
>> 19-Dec-2013 01:06, Andrei Alexandrescu пишет:
>>> http://chopapp.com/#fvepfd8 shows the number of dependencies (plus 1)
>>> for each module in phobos. Those include druntime dependencies.
>>>
>>
>> So the bill of using pretty much anything in Phobos is pulling in 87
>> modules. Pretty much what I feared it is.
>
> There are several directions we can take this.
>
> 1. Improve the compiler to handle imports lazily, i.e. an unused import
> is never opened. That's unlikely to help a lot of uses because most
> unqualified name lookups require all imports to be loaded (even after
> the name if resolved, the compiler must still look for ambiguities).
>
> 2. Push imports from top level into the entities (functions, classes
> etc) that use them.
>
> 3. Apply classic dependency management (break larger modules in smaller
> ones, accept some code duplication etc).
>
> I favor (2).
>

I'd add something that might help make (2) possible in case of templates.

4. Split modules at least into a package of with at least 2 parts:
- Meta (traits) - constraints, type definitions etc.
- API - functions, globals and other "meat" of the module.

One prime example is std.range - isInputRange, isForwardRange etc. need not to be "bought together" with all of range adapters and std.algorithm dependency.

-- 
Dmitry Olshansky
December 18, 2013
On Thu, Dec 19, 2013 at 01:47:26AM +0400, Dmitry Olshansky wrote:
> 19-Dec-2013 01:40, Andrei Alexandrescu пишет:
> >On 12/18/13 1:16 PM, Dmitry Olshansky wrote:
> >>19-Dec-2013 01:06, Andrei Alexandrescu пишет:
> >>>http://chopapp.com/#fvepfd8 shows the number of dependencies (plus 1) for each module in phobos. Those include druntime dependencies.
> >>>
> >>
> >>So the bill of using pretty much anything in Phobos is pulling in 87 modules. Pretty much what I feared it is.
> >
> >There are several directions we can take this.
> >
> >1. Improve the compiler to handle imports lazily, i.e. an unused import is never opened. That's unlikely to help a lot of uses because most unqualified name lookups require all imports to be loaded (even after the name if resolved, the compiler must still look for ambiguities).
> >
> >2. Push imports from top level into the entities (functions, classes
> >etc) that use them.
> >
> >3. Apply classic dependency management (break larger modules in smaller ones, accept some code duplication etc).
> >
> >I favor (2).

I vote for (2) as well.

And for the first part of (3): I think std.algorithm is due for a breakup. There is no reason why using find, for example, should pull in sorting algorithms, and why using sorting algorithms should pull in cartesianProduct.


> I'd add something that might help make (2) possible in case of
> templates.
> 
> 4. Split modules at least into a package of with at least 2 parts:
> - Meta (traits) - constraints, type definitions etc.
> - API - functions, globals and other "meat" of the module.
> 
> One prime example is std.range - isInputRange, isForwardRange etc. need not to be "bought together" with all of range adapters and std.algorithm dependency.
[...]

I've been saying this over and over: now we have package.d, let's make use of it. Jonathan has been working on splitting up std.datetime (though that has yet to materialize); I think std.algorithm and std.range are due, too.


T

-- 
"Hi." "'Lo."
December 18, 2013
On 12/18/2013 1:40 PM, Andrei Alexandrescu wrote:
> 1. Improve the compiler to handle imports lazily, i.e. an unused import is never
> opened. That's unlikely to help a lot of uses because most unqualified name
> lookups require all imports to be loaded (even after the name if resolved, the
> compiler must still look for ambiguities).
>
> 2. Push imports from top level into the entities (functions, classes etc) that
> use them.
>
> 3. Apply classic dependency management (break larger modules in smaller ones,
> accept some code duplication etc).
>
> I favor (2).

(1) is impractical for the reasons you mentioned.

I favor (2), and also (4):

4. Break kitchen sink modules like std.algorithm into one module per algorithm. This should not result in code duplication.

December 18, 2013
On 12/18/13 3:08 PM, Walter Bright wrote:
> On 12/18/2013 1:40 PM, Andrei Alexandrescu wrote:
>> 1. Improve the compiler to handle imports lazily, i.e. an unused
>> import is never
>> opened. That's unlikely to help a lot of uses because most unqualified
>> name
>> lookups require all imports to be loaded (even after the name if
>> resolved, the
>> compiler must still look for ambiguities).
>>
>> 2. Push imports from top level into the entities (functions, classes
>> etc) that
>> use them.
>>
>> 3. Apply classic dependency management (break larger modules in
>> smaller ones,
>> accept some code duplication etc).
>>
>> I favor (2).
>
> (1) is impractical for the reasons you mentioned.
>
> I favor (2), and also (4):
>
> 4. Break kitchen sink modules like std.algorithm into one module per
> algorithm. This should not result in code duplication.

That's (3), which enumerates a number of possible effects that may or may not overlap/

Andrei

December 18, 2013
On Wednesday, 18 December 2013 at 23:08:21 UTC, Walter Bright wrote:
> I favor (2), and also (4):
>
> 4. Break kitchen sink modules like std.algorithm into one module per algorithm. This should not result in code duplication.

That seems a little over the top. While I guess it's not necessarily a bad thing to increase modularity, users would have to pull in a large number of imports to do anything nontrivial. For example, when you want to use sort, find, splitter and swap all together, you either have the choice of doing:

import std.algorithm;

And pull in everything, or doing:

import std.algorithm.sort, std.algorithm.find, std.algorithm.splitter, std.algorithm.swap;

Or is there something I'm missing here?

Of course, another large boon would be to correct the implementation of:

import std.algorithm: sort, find, splitter, swap;

So that it actually works in a sane way as opposed to pulling in everything.
December 19, 2013
On Wednesday, 18 December 2013 at 21:40:08 UTC, Andrei Alexandrescu wrote:
> 1. Improve the compiler to handle imports lazily, i.e. an unused import is never opened. That's unlikely to help a lot of uses because most unqualified name lookups require all imports to be loaded (even after the name if resolved, the compiler must still look for ambiguities).
>
> 2. Push imports from top level into the entities (functions, classes etc) that use them.
>
> 3. Apply classic dependency management (break larger modules in smaller ones, accept some code duplication etc).
>
> I favor (2).
>
>
> Andrei

2 + 3 (breaking modules into packages part) should do the tricky as far as I can see. Lot of current dependency bloat comes from importing whole std.range / std.algorithm to use one or two utility functions in few places.

On topic of (2) I propose to add it to Phobos style guide and start enforcing during PR review.
December 19, 2013
On Thu, 19 Dec 2013 00:51:04 +0100, Meta wrote:

> On Wednesday, 18 December 2013 at 23:08:21 UTC, Walter Bright wrote:
>> I favor (2), and also (4):
>>
>> 4. Break kitchen sink modules like std.algorithm into one module per algorithm. This should not result in code duplication.
> 
> That seems a little over the top. While I guess it's not necessarily a bad thing to increase modularity, users would have to pull in a large number of imports to do anything nontrivial. For example, when you want to use sort, find, splitter and swap all together, you either have the choice of doing:
> 
> import std.algorithm;
> 
> And pull in everything, or doing:
> 
> import std.algorithm.sort, std.algorithm.find, std.algorithm.splitter, std.algorithm.swap;
> 
> Or is there something I'm missing here?
> 
> Of course, another large boon would be to correct the implementation of:
> 
> import std.algorithm: sort, find, splitter, swap;
> 
> So that it actually works in a sane way as opposed to pulling in everything.

Presumably there would still be a std.algorithm package module;  the
questions is: does
  import std.algorithm : joiner;
still work if std.algorithm is actually a package module and joiner is in
a std.algorithm.joiner module?
« First   ‹ Prev
1 2 3 4 5 6 7 8 9 10