| Thread overview | |||||||
|---|---|---|---|---|---|---|---|
|
August 19, 2015 An Unusual Idea: import std; | ||||
|---|---|---|---|---|
| ||||
I just got an idea:
What about providing a top-level package.d in std?
import std;
// use potentially everything in Phobos:
// with having to care about which import to use
- This would make complete working tutorials even smaller
- And newbies could easier experiment will all the aspects of D
Yes I'm aware of the linker-code-bloat this produces and yes should of course never be used in production code and yes I'm aware of the linking problem with C-wrapper libraries such as curl. Maybe they could be excluded here?
I still it's a cool feature I would like to have when experimenting with D in small test programs.
Destroy!
| ||||
August 19, 2015 Re: An Unusual Idea: import std; | ||||
|---|---|---|---|---|
| ||||
Posted in reply to Per Nordlöw | On Wednesday, 19 August 2015 at 13:32:03 UTC, Per Nordlöw wrote:
> I just got an idea:
>
> What about providing a top-level package.d in std?
Further, it would be a powerful showcase for the semantically aware D user-experience, enabled by its unique parsing performance.
The parsing overhead on my machine is somewhere between 0.5 and 1 second.
| |||
August 19, 2015 Re: An Unusual Idea: import std; | ||||
|---|---|---|---|---|
| ||||
Posted in reply to Per Nordlöw | On Wednesday, 19 August 2015 at 13:45:32 UTC, Per Nordlöw wrote:
> The parsing overhead on my machine is somewhere between 0.5 and 1 second.
I recall that Andrei has mentioned plans on further DMD optimizations that will delay lexing and/or parsing of templates until they are referenced. Only the matching ending brace of the template definition will be searched for during the primary scanning of each source file. The rest is cached as a strings associated with the corresponding template symbol until it is referenced/instantiated.
| |||
August 19, 2015 Re: An Unusual Idea: import std; | ||||
|---|---|---|---|---|
| ||||
Posted in reply to Per Nordlöw | http://forum.dlang.org/post/mmntkn$9ta$1@digitalmars.com ? | |||
August 20, 2015 Re: An Unusual Idea: import std; | ||||
|---|---|---|---|---|
| ||||
Posted in reply to Kagamin | On 08/19/2015 10:19 AM, Kagamin wrote: > http://forum.dlang.org/post/mmntkn$9ta$1@digitalmars.com ? More specifically: https://github.com/Abscissa/scriptlike/blob/master/src/scriptlike/std.d import scriptlike.std; I'd really like to see this happen though, as it would make scriptlike a lot easier to import in a versioning-safe, cross-machine way: https://github.com/D-Programming-Language/dub/issues/103 Or at the very least, this: https://github.com/D-Programming-Language/dub/issues/657 | |||
Copyright © 1999-2021 by the D Language Foundation
Permalink
Reply