ings.
However, I would like to write idiomatic D code, not "C++ in D".
Is there any guide for this? If not, I would like to say that I
think having one would be very useful.
Assuming a lack of an extensive guide could someone please just
give me the cliff notes on how to D properly?
away by just looking
up a few basic syntax/standard library things.
However, I would like to write idiomatic D code, not "C++ in
D". Is there any guide for this? If not, I would like to say
that I think having one would be very useful.
Assuming a lack of an extensive guide could someo
few basic syntax/standard library
things.
However, I would like to write idiomatic D code, not "C++ in D". Is
there any guide for this? If not, I would like to say that I think
having one would be very useful.
Assuming a lack of an extensive guide could someone please just give me
the
On 01/10/2014 02:52 PM, NoUseForAName wrote:
I would like to write idiomatic D code, not "C++ in D".
I like this style:
http://wiki.dlang.org/Component_programming_with_ranges
Ali
away by just looking
up a few basic syntax/standard library things.
However, I would like to write idiomatic D code, not "C++ in
D". Is there any guide for this? If not, I would like to say
that I think having one would be very useful.
Assuming a lack of an extensive guide could someo
On Friday, 10 January 2014 at 23:16:10 UTC, Kelet wrote:
foreach(immutable i = 0; 0..20) OR
Oops, meant
foreach(immutable i; 0..20)
away by just looking
up a few basic syntax/standard library things.
However, I would like to write idiomatic D code, not "C++ in
D". Is there any guide for this? If not, I would like to say
that I think having one would be very useful.
Assuming a lack of an extensive guide could someo
On Friday, 10 January 2014 at 23:16:10 UTC, Kelet wrote:
- Many of the examples on Rosetta Code are well-written
http://rosettacode.org/wiki/Category:D I think bearophile did
many of them.
Contributing to Rosetta Code is a great way to learn idiomatic
code. Write one of the missing programs [
away by just looking
up a few basic syntax/standard library things.
However, I would like to write idiomatic D code, not "C++ in
D". Is there any guide for this? If not, I would like to say
that I think having one would be very useful.
Assuming a lack of an extensive guide could someo
On Friday, 10 January 2014 at 22:52:36 UTC, NoUseForAName wrote:
[snip]
Wow, that is a lot of information to process. Thanks everyone!
In
https://www.youtube.com/watch?v=nVzgkepAg5Y
Andrei describes his proposal for STL `Expected` planned to be
included in C++20.
Have anybody converted the C++ proposal to idiomatic D, yet?
Hopefully without the pointer-legacy which unfortunately was
allowed into `std:optional`.
Andrei
Over time, what is considered "idiomatic D" has changed, and nowadays it
seems to be leaning heavily towards range-based code with UFCS chains
using std.algorithm and similar reusable pieces of code.
D (well, DMD specifically) is famed for its lightning speed compilation
times.
So th
On Thursday, 16 August 2018 at 20:37:33 UTC, Per Nordlöw wrote:
In
https://www.youtube.com/watch?v=nVzgkepAg5Y
Andrei describes his proposal for STL `Expected` planned to be
included in C++20.
Have anybody converted the C++ proposal to idiomatic D, yet?
Hopefully without the pointer-legacy
On Thursday, 16 August 2018 at 20:37:33 UTC, Per Nordlöw wrote:
In
https://www.youtube.com/watch?v=nVzgkepAg5Y
Andrei describes his proposal for STL `Expected` planned to be
included in C++20.
Have anybody converted the C++ proposal to idiomatic D, yet?
Hopefully without the pointer-legacy
On Tuesday, 28 August 2018 at 10:18:29 UTC, John Colvin wrote:
I get the feeling from the talk that Andrei has some opinions
about how it should be done that aren't completely in line with
what has been proposed for the C++ standard.
Anyhow my implementation at
https://github.com/nordlow/phob
On Wednesday, 5 July 2017 at 20:12:40 UTC, H. S. Teoh wrote:
I vaguely remember there was talk about compressing symbols
when they get too long... is there any hope of seeing this
realized in the near future?
Yes there is.
Rainer Schuetze is quite close to a solution. Which reduces the
symb
On Wednesday, 5 July 2017 at 20:12:40 UTC, H. S. Teoh wrote:
I vaguely remember there was talk about compressing symbols
when they get too long... is there any hope of seeing this
realized in the near future?
LDC has an experimental feature replacing long names by their
hash; ldc2 -help:
...
On Wednesday, 5 July 2017 at 20:32:08 UTC, Stefan Koch wrote:
Yes there is.
Rainer Schuetze is quite close to a solution. Which reduces the
symbol-name bloat significantly.
See https://github.com/dlang/dmd/pull/5855
A table in the comments [1] shows a significant reduction in
bloat when c
On Wed, Jul 05, 2017 at 09:18:45PM +, jmh530 via Digitalmars-d wrote:
> On Wednesday, 5 July 2017 at 20:32:08 UTC, Stefan Koch wrote:
> >
> > Yes there is.
> > Rainer Schuetze is quite close to a solution. Which reduces the
> > symbol-name bloat significantly.
> > See https://github.com/dlang/
On Wednesday, July 05, 2017 13:12:40 H. S. Teoh via Digitalmars-d wrote:
[...]
> IOW, the very range-based idiom that has become one of the defining
> characteristics of modern D is negating the selling point of fast
> compilation.
>
> I vaguely remember there was talk about compressing symbols whe
On 2017-07-05 22:12, H. S. Teoh via Digitalmars-d wrote:
Over time, what is considered "idiomatic D" has changed, and nowadays it
seems to be leaning heavily towards range-based code with UFCS chains
using std.algorithm and similar reusable pieces of code.
It's not UFCS per say
On Thursday, 6 July 2017 at 12:00:29 UTC, Jacob Carlborg wrote:
On 2017-07-05 22:12, H. S. Teoh via Digitalmars-d wrote:
[...]
It's not UFCS per say that causes the problem. If you're using
the traditional calling syntax it would generate the same
symbols.
[...]
Yeah, it's usually all t
On Thu, Jul 06, 2017 at 01:32:04PM +, Atila Neves via Digitalmars-d wrote:
> On Thursday, 6 July 2017 at 12:00:29 UTC, Jacob Carlborg wrote:
[...]
> > Yeah, it's usually all these D specific compile time features that
> > is slowing down compilation.
> >
> > DWT and Tango are two good examples
On Wednesday, 5 July 2017 at 20:32:08 UTC, Stefan Koch wrote:
On Wednesday, 5 July 2017 at 20:12:40 UTC, H. S. Teoh wrote:
I vaguely remember there was talk about compressing symbols
when they get too long... is there any hope of seeing this
realized in the near future?
Yes there is.
Rainer
On 7/5/17 5:24 PM, H. S. Teoh via Digitalmars-d wrote:
On Wed, Jul 05, 2017 at 09:18:45PM +, jmh530 via Digitalmars-d wrote:
On Wednesday, 5 July 2017 at 20:32:08 UTC, Stefan Koch wrote:
Yes there is.
Rainer Schuetze is quite close to a solution. Which reduces the
symbol-name bloat signifi
On Fri, Jul 07, 2017 at 09:32:24AM -0400, Steven Schveighoffer via
Digitalmars-d wrote:
> On 7/5/17 5:24 PM, H. S. Teoh via Digitalmars-d wrote:
> > On Wed, Jul 05, 2017 at 09:18:45PM +, jmh530 via Digitalmars-d wrote:
> > > On Wednesday, 5 July 2017 at 20:32:08 UTC, Stefan Koch wrote:
[...]
>
On Wed, Jul 05, 2017 at 09:45:55PM -0600, Jonathan M Davis via Digitalmars-d
wrote:
[...]
> In this case, I think that it's more that Voldemort types are biting
> us than that ranges are biting us (though the Voldemort types are
> typically ranges, so in practice, using ranges ends up biting you).
On 7/13/17 3:23 PM, H. S. Teoh via Digitalmars-d wrote:
Today, I decided to sit down and refactor my code. I've heard tell that
Voldemort types tend to cause an explosion in symbol size, and today I
thought it'd be interesting to see just how big of a difference this
actually makes.
I could not
On Thu, Jul 13, 2017 at 04:16:50PM -0400, Steven Schveighoffer via
Digitalmars-d wrote:
[...]
> http://www.schveiguy.com/blog/2016/05/have-your-voldemort-types-and-keep-your-disk-space-too/
>
> I was surprised as well at the reduction. I only noticed the problem
> because when I was debugging my
On Thu, Jul 13, 2017 at 03:27:31PM -0700, H. S. Teoh via Digitalmars-d wrote:
> On Thu, Jul 13, 2017 at 04:16:50PM -0400, Steven Schveighoffer via
> Digitalmars-d wrote:
> [...]
> > http://www.schveiguy.com/blog/2016/05/have-your-voldemort-types-and-keep-your-disk-space-too/
> [...]
>
> Whoa. I
On Friday, 14 July 2017 at 22:45:44 UTC, H. S. Teoh wrote:
On Thu, Jul 13, 2017 at 03:27:31PM -0700, H. S. Teoh via
Digitalmars-d wrote:
[...]
[...]
Here's a further update to the saga of combating ridiculously
large symbol sizes.
[...]
You will be excited to hear that my template work wi
On Fri, Jul 14, 2017 at 03:45:44PM -0700, H. S. Teoh via Digitalmars-d wrote:
[...]
> Here's a further update to the saga of combating ridiculously large
> symbol sizes.
[...]
>.wrapWithInterface // <--- type erasure happens here
[...]
Some further thoughts about type erasure and UFCS
On Friday, 14 July 2017 at 22:45:44 UTC, H. S. Teoh wrote:
Result: 8MB executable size (!).
Of course, this comes at a runtime cost of an added level of
indirection (now you have to call a virtual function through
the interface to integrate with earlier components in the
pipeline). But at a
On Friday, 14 July 2017 at 22:45:44 UTC, H. S. Teoh wrote:
Here's a further update to the saga of combating ridiculously
large symbol sizes.
So yesterday I wrote a new module that also heavily uses UFCS
chains. My initial draft of the module, once I linked it with
the main program, particular
On Saturday, 15 July 2017 at 11:10:32 UTC, Enamex wrote:
On Friday, 14 July 2017 at 22:45:44 UTC, H. S. Teoh wrote:
[...]
I have some stupid questions:
- What does everyone mean when they say 'symbol' here? I'm
probably misunderstanding symbols gravely or it's something
that DMD in particul
ushed as a great way to encapsulate the range
types that result from function calls and really shouldn't be used by name
makes the situation that much worse. So, idiomatic D code currently results
in very large symbol names, and while in many cases, you don't notice, some
people (like H.S. Te
On Saturday, 15 July 2017 at 15:58:12 UTC, Jonathan M Davis wrote:
On Saturday, July 15, 2017 11:10:32 Enamex via Digitalmars-d
wrote:
[...]
The issue has to do with how each invocation of a range-based
function tends to result in a new template instantiation, and
it's common practice in D to
On Saturday, 15 July 2017 at 15:58:12 UTC, Jonathan M Davis wrote:
int[] a;
auto b = a.map!(a => a / 2)();
pragma(msg, typeof(b));
then it prints out
MapResult!(__lambda1, int[])
If you have
int[] a;
auto b = a.map!(a => a / 2)().map!(a => a)();
pragma(msg, typeof
On Monday, 17 July 2017 at 12:51:37 UTC, jmh530 wrote:
On Saturday, 15 July 2017 at 15:58:12 UTC, Jonathan M Davis
wrote:
int[] a;
auto b = a.map!(a => a / 2)();
pragma(msg, typeof(b));
then it prints out
MapResult!(__lambda1, int[])
If you have
int[] a;
auto b = a.m
On 7/14/17 7:30 PM, H. S. Teoh via Digitalmars-d wrote:
On Fri, Jul 14, 2017 at 03:45:44PM -0700, H. S. Teoh via Digitalmars-d wrote:
[...]
Here's a further update to the saga of combating ridiculously large
symbol sizes.
[...]
.wrapWithInterface // <--- type erasure happens here
On Sat, Jul 15, 2017 at 07:11:54PM +, Enamex via Digitalmars-d wrote:
[...]
> All that time I'd assumed that 'symbols' as linkers used them were
> constant length :T
They may have been once upon a time, many decades ago. :-D But modern
linkers support symbols of arbitrary length (well, up to
On Monday, 17 July 2017 at 18:42:36 UTC, H. S. Teoh wrote:
Besides the symbol problem though, does the template
instantiation explosion problem imply as many duplicated
function bodies corresponding to the new type symbols?
That's a different, though somewhat related, issue. I have
some idea
Hello everyone!
Well, this is actually a "talk proposal for someone else". I'd be the
audience, not the speaker.
TITLE: D Programming in D (Or: Writing idiomatic D code)
ABSTRACT: Every language has its own sanctified idioms. Beginners
learning a new language tend to use th
On Wednesday, 21 November 2012 at 18:42:55 UTC, Leandro Motta
Barros wrote:
Well, this is actually a "talk proposal for someone else". I'd
be the
audience, not the speaker.
TITLE: D Programming in D (Or: Writing idiomatic D code)
+1
I'd like to add, maybe put some focus
On Wednesday, 21 November 2012 at 22:47:02 UTC, Joshua Niehus
wrote:
On Wednesday, 21 November 2012 at 18:42:55 UTC, Leandro Motta
Barros wrote:
Well, this is actually a "talk proposal for someone else". I'd
be the audience, not the speaker.
TITLE: D Programming in D (Or: Writ
On Wednesday, 21 November 2012 at 18:42:55 UTC, Leandro Motta
Barros wrote:
TITLE: D Programming in D (Or: Writing idiomatic D code)
ABSTRACT: Every language has its own sanctified idioms.
Beginners
learning a new language tend to use the idioms of the languages
they
already know in the new
On 11/22/2012 03:13 AM, Era Scarecrow wrote:
Perhaps a part on how to properly use D without involving the GC.
... perhaps a part on keeping memory use effectively under control _with_ the
GC? (Avoiding all those dangling references, etc...:-)
47 matches
Mail list logo