Re: DIP 1027---String Interpolation---Format Assessment

2020-02-27 Thread Walter Bright via Digitalmars-d-announce
On 2/27/2020 3:44 AM, aliak wrote: Btw: Swift does this for string interpolation and it works very well -> https://www.hackingwithswift.com/articles/178/super-powered-string-interpolation-in-swift-5-0 I don't know Swift, but this looks like the "generate strings and concatenate them"

Re: The Serpent Game Framework - Open Source!!

2020-02-27 Thread Steven Schveighoffer via Digitalmars-d-announce
On 2/27/20 5:29 PM, aberba wrote: There's this ongoing open source game framework by Ikey. I knew him to be a diehard C guru (from the Solus Project) but is now rocking D, hence Serpent. Check is out and support if you can, please. I don't know how he does it but Ikey can code stuff like

The Serpent Game Framework - Open Source!!

2020-02-27 Thread aberba via Digitalmars-d-announce
There's this ongoing open source game framework by Ikey. I knew him to be a diehard C guru (from the Solus Project) but is now rocking D, hence Serpent. Check is out and support if you can, please. I don't know how he does it but Ikey can code stuff like crazy.

Re: DIP 1027---String Interpolation---Format Assessment

2020-02-27 Thread H. S. Teoh via Digitalmars-d-announce
On Thu, Feb 27, 2020 at 11:26:37AM -0800, Walter Bright via Digitalmars-d-announce wrote: [...] > Magic types are not simple and inevitably lead to unexpected corners > and unresolvable problems. *cough* associative arrays *cough* [...] For all the trouble they've given us, built-in AA's is one

Re: [OT] Re: DIP 1027---String Interpolation---Format Assessment

2020-02-27 Thread H. S. Teoh via Digitalmars-d-announce
On Thu, Feb 27, 2020 at 02:20:14PM -0500, Steven Schveighoffer via Digitalmars-d-announce wrote: > On 2/27/20 1:42 PM, H. S. Teoh wrote: > > Making CTFE AAs usable at runtime is somewhat of a different beast, > > though. The main problem is that you need to be able to instantiate the > > binary

Re: DIP 1027---String Interpolation---Format Assessment

2020-02-27 Thread Walter Bright via Digitalmars-d-announce
On 2/27/2020 6:32 AM, Petar Kirov [ZombineDev] wrote: I'm not sure where exactly you draw the line, but I would say that C# follows C's syntax about as much as D does. C# is very different from C. D is not so different, and close enough that DasBetterC is very viable. Hindsight being 20/20,

Re: DIP 1027---String Interpolation---Format Assessment

2020-02-27 Thread Aliak via Digitalmars-d-announce
On Thursday, 27 February 2020 at 18:19:03 UTC, Adam D. Ruppe wrote: On Thursday, 27 February 2020 at 17:41:12 UTC, Petar Kirov [ZombineDev] wrote: [...] Right, that actually is what my old proposal was (and I fought for it on the first few pages of the last thread), and this is very close

Re: [OT] Re: DIP 1027---String Interpolation---Format Assessment

2020-02-27 Thread Steven Schveighoffer via Digitalmars-d-announce
On 2/27/20 1:42 PM, H. S. Teoh wrote: Making CTFE AAs usable at runtime is somewhat of a different beast, though. The main problem is that you need to be able to instantiate the binary representation of a runtime AA (the main hash table, and each of the buckets) at compile-time, and do so in a

Re: DIP 1027---String Interpolation---Format Assessment

2020-02-27 Thread Walter Bright via Digitalmars-d-announce
On 2/27/2020 1:45 AM, Rainer Schuetze wrote: The string buffer could also be stack allocated or manually managed with malloc/free by the string interpolation type. It's quite a big deal to make that work, and does not address the inherent inefficiency of it. printf, for all its faults, is

Re: [OT] Re: DIP 1027---String Interpolation---Format Assessment

2020-02-27 Thread H. S. Teoh via Digitalmars-d-announce
On Thu, Feb 27, 2020 at 10:11:07AM -0500, Steven Schveighoffer via Digitalmars-d-announce wrote: [...] > Large hidden invisible types are not the problem (look at normal > dynamic arrays, the large hidden type built into the runtime is a huge > success I think). The problem is that the compiler

Re: DIP 1027---String Interpolation---Format Assessment

2020-02-27 Thread Meta via Digitalmars-d-announce
On Thursday, 27 February 2020 at 18:07:19 UTC, Arine wrote: On Thursday, 27 February 2020 at 09:34:23 UTC, Walter Bright wrote: On 2/26/2020 7:41 AM, Arine wrote: Yah, what's unwanted about that? 1. unwanted extra string allocation 2. poor performance 3. doesn't work with printf 4. doesn't

Re: DIP 1027---String Interpolation---Format Assessment

2020-02-27 Thread Adam D. Ruppe via Digitalmars-d-announce
On Thursday, 27 February 2020 at 17:41:12 UTC, Petar Kirov [ZombineDev] wrote: auto s = new_type!( "hi ", spec(null), ", you are visitor ", spec("%2d") )(name, count); I.e. the referenced arguments are passed to the constructor of new_type. Right, that actually is what my old

Re: DIP 1027---String Interpolation---Format Assessment

2020-02-27 Thread Arine via Digitalmars-d-announce
On Thursday, 27 February 2020 at 09:34:23 UTC, Walter Bright wrote: On 2/26/2020 7:41 AM, Arine wrote: Yah, what's unwanted about that? 1. unwanted extra string allocation 2. poor performance 3. doesn't work with printf 4. doesn't work with writef 5. non-default formats require extra temp

Re: DIP 1027---String Interpolation---Format Assessment

2020-02-27 Thread Petar via Digitalmars-d-announce
On Thursday, 27 February 2020 at 14:58:20 UTC, Adam D. Ruppe wrote: On Thursday, 27 February 2020 at 14:32:29 UTC, Petar Kirov [ZombineDev] wrote: 2. Have the new type implicitly convert to printf-style args. I think this is what Adam is proposing. While nice to have, I don't think it's

Re: [OT] Re: DIP 1027---String Interpolation---Format Assessment

2020-02-27 Thread jmh530 via Digitalmars-d-announce
On Thursday, 27 February 2020 at 15:11:07 UTC, Steven Schveighoffer wrote: [snip] We're going very off topic here, but I wanted to address this. Large hidden invisible types are not the problem (look at normal dynamic arrays, the large hidden type built into the runtime is a huge success I

Re: DIP 1027---String Interpolation---Format Assessment

2020-02-27 Thread SealabJaster via Digitalmars-d-announce
On Thursday, 27 February 2020 at 15:12:23 UTC, Adam D. Ruppe wrote: error: cannot implicitly convert argument of type interpolated tuple to type string. Tip: use `.idup` to explicitly convert it to string. Oh, that pretty much sorts out my problem there, sorry if I glanced over it being

[OT] Re: DIP 1027---String Interpolation---Format Assessment

2020-02-27 Thread Steven Schveighoffer via Digitalmars-d-announce
On 2/27/20 9:32 AM, Petar Kirov [ZombineDev] wrote: An example of this is the built-in associative array, which has a series of fairly intractable problems as a result. Another example is the built-in complex type in D, which turned out to be a bad idea - a much better one is building it as a

Re: DIP 1027---String Interpolation---Format Assessment

2020-02-27 Thread Adam D. Ruppe via Digitalmars-d-announce
On Thursday, 27 February 2020 at 14:47:55 UTC, SealabJaster wrote: At that point, it begs the question of why even bother having string interpolation. I encourage you to read my document too: https://github.com/dlang/DIPs/pull/186 It addresses all these concerns. Walter's proposal is dead.

Re: DIP 1027---String Interpolation---Format Assessment

2020-02-27 Thread Adam D. Ruppe via Digitalmars-d-announce
On Thursday, 27 February 2020 at 14:32:29 UTC, Petar Kirov [ZombineDev] wrote: 2. Have the new type implicitly convert to printf-style args. I think this is what Adam is proposing. While nice to have, I don't think it's necessary. You can read my document for more detail

Re: DIP 1027---String Interpolation---Format Assessment

2020-02-27 Thread rikki cattermole via Digitalmars-d-announce
On 28/02/2020 3:47 AM, SealabJaster wrote: Similarly, as far as I can tell even with the adjustment of making these strings their own special type, something as simple (for other languages as): ``` void f(string a, string b) { /*...*/ } int foo = 20; string bar = "lalafell"; f(i"You are a

Re: DIP 1027---String Interpolation---Format Assessment

2020-02-27 Thread SealabJaster via Digitalmars-d-announce
On Thursday, 27 February 2020 at 09:30:30 UTC, Walter Bright wrote: You can make it behave like all those other languages simply with: f(format("hello $a")); At that point, it begs the question of why even bother having string interpolation. I'd like to imagine that most

Re: DIP 1027---String Interpolation---Format Assessment

2020-02-27 Thread Adam D. Ruppe via Digitalmars-d-announce
On Thursday, 27 February 2020 at 09:34:23 UTC, Walter Bright wrote: On 2/26/2020 7:41 AM, Arine wrote: Yah, what's unwanted about that? [snip] You're arguing against a strawman. The other poster's comment was showing a likely problem with the (rejected) dip 1027, that our new proposal

Re: DIP 1027---String Interpolation---Format Assessment

2020-02-27 Thread Petar via Digitalmars-d-announce
On Thursday, 27 February 2020 at 09:30:30 UTC, Walter Bright wrote: On 2/27/2020 12:27 AM, Petar Kirov [ZombineDev] wrote: I'm well aware that allocation is inevitable if we want this behavior. My argument is that this behavior is so ubiquitous that not following it would be surprising to much

Re: DIP 1027---String Interpolation---Format Assessment

2020-02-27 Thread Paolo Invernizzi via Digitalmars-d-announce
On Thursday, 27 February 2020 at 09:30:30 UTC, Walter Bright wrote: On 2/27/2020 12:27 AM, Petar Kirov [ZombineDev] wrote: I'm well aware that allocation is inevitable if we want this behavior. My argument is that this behavior is so ubiquitous that not following it would be surprising to much

Re: DIP 1027---String Interpolation---Format Assessment

2020-02-27 Thread aliak via Digitalmars-d-announce
On Thursday, 27 February 2020 at 09:34:23 UTC, Walter Bright wrote: On 2/26/2020 7:41 AM, Arine wrote: Yah, what's unwanted about that? 1. unwanted extra string allocation 2. poor performance 3. doesn't work with printf 4. doesn't work with writef 5. non-default formats require extra temp

Re: DIP 1027---String Interpolation---Format Assessment

2020-02-27 Thread Nicholas Wilson via Digitalmars-d-announce
On Thursday, 27 February 2020 at 09:45:06 UTC, Rainer Schuetze wrote: On 27/02/2020 01:20, Walter Bright wrote: On 2/26/2020 3:13 AM, Petar Kirov [ZombineDev] wrote: In all other languages with string interpolation that I'm familiar with, `a` is not passed to the `i` parameter. All rely on a

Re: DIP 1027---String Interpolation---Format Assessment

2020-02-27 Thread Rainer Schuetze via Digitalmars-d-announce
On 27/02/2020 01:20, Walter Bright wrote: > On 2/26/2020 3:13 AM, Petar Kirov [ZombineDev] wrote: >> In all other languages with string interpolation that I'm familiar >> with, `a` is not passed to the `i` parameter. > > All rely on a garbage collected string being generated as an >

Re: DIP 1027---String Interpolation---Format Assessment

2020-02-27 Thread Walter Bright via Digitalmars-d-announce
On 2/26/2020 7:41 AM, Arine wrote: Yah, what's unwanted about that? 1. unwanted extra string allocation 2. poor performance 3. doesn't work with printf 4. doesn't work with writef 5. non-default formats require extra temp strings to be generated

Re: Beta 2.091.0

2020-02-27 Thread Mathias Lang via Digitalmars-d-announce
On Thursday, 27 February 2020 at 09:05:47 UTC, JN wrote: "Class deallocator have been deprecated in v2.080.0 (see ), and turned into an error in v2.087.0. They have now been completely removed from the language, and the parser won't recognize them anymore." missing a link after the see

Re: DIP 1027---String Interpolation---Format Assessment

2020-02-27 Thread Walter Bright via Digitalmars-d-announce
On 2/27/2020 12:27 AM, Petar Kirov [ZombineDev] wrote: I'm well aware that allocation is inevitable if we want this behavior. My argument is that this behavior is so ubiquitous that not following it would be surprising to much more people, than if D didn't follow C's Usual Arithmetic

Re: Blog post on calling C from Python via D

2020-02-27 Thread Atila Neves via Digitalmars-d-announce
On Wednesday, 26 February 2020 at 20:57:53 UTC, H. S. Teoh wrote: On Wed, Feb 26, 2020 at 08:45:31PM +, Atila Neves via Digitalmars-d-announce wrote: On Wednesday, 26 February 2020 at 17:39:14 UTC, jmh530 wrote: > On Wednesday, 26 February 2020 at 14:51:06 UTC, Atila Neves > wrote: > >

Re: DIP 1027---String Interpolation---Format Assessment

2020-02-27 Thread Walter Bright via Digitalmars-d-announce
On 2/26/2020 10:38 PM, FeepingCreature wrote: On Thursday, 27 February 2020 at 03:50:35 UTC, Walter Bright wrote: On 2/26/2020 4:46 PM, Adam D. Ruppe wrote: But DIP1027 had a fatal flaw: it made type safety impossible. I don't see how that is true. Because it turned a format string into a

Re: Beta 2.091.0

2020-02-27 Thread JN via Digitalmars-d-announce
On Wednesday, 26 February 2020 at 12:17:43 UTC, Martin Nowak wrote: Glad to announce the first beta for the 2.091.0 release, ♥ to the 55 contributors. http://dlang.org/download.html#dmd_beta http://dlang.org/changelog/2.091.0.html Due to updating several components in the build pipeline,

Re: DIP 1027---String Interpolation---Format Assessment

2020-02-27 Thread Petar via Digitalmars-d-announce
On Thursday, 27 February 2020 at 00:20:27 UTC, Walter Bright wrote: On 2/26/2020 3:13 AM, Petar Kirov [ZombineDev] wrote: In all other languages with string interpolation that I'm familiar with, `a` is not passed to the `i` parameter. All rely on a garbage collected string being generated as