January 07
On Thursday, 4 January 2024 at 03:12:48 UTC, Don Allen wrote:
> as opposed to something like Haskell or even Rust -- "here's a new way to think about computer programming")

Haskell is not a new way to think about programming. Its history can be traced back to at least to https://en.wikipedia.org/wiki/ISWIM, which is 1966.
January 07

On Sunday, 7 January 2024 at 11:54:16 UTC, bomat wrote:

>

On Thursday, 4 January 2024 at 03:12:48 UTC, Don Allen wrote:

>

I view this development positively. The constant strife I've observed as a latecomer to D, but as someone who has done and managed software development for a very long time, was clearly not healthy or accomplishing anything other than wasting peoples' energy, because it wasn't converging. This divorce will hopefully allow the disagreements to be resolved on technical merits.

Also being a newcomer to the language, I quite agree. While it's sad to see a split in a language that is already niche as it is, I try to see the positive sides (as Abdulhaq wrote, forking is better than quitting), and I hope that everyone can gain new insights by having a direct comparison between different approaches.

I'd much rather Adam put his time into a fork, rather than the more common approach where he'd post here under various names, make ridiculous claims, and vandalize the discussions. If you're new, you may not have seen the many posts from someone that doesn't like private at the module level.

Whether there are useful insights from this or any other fork will depend on what they do with it. If there's too much incompatibility of code, due to breaking changes, it won't have much effect. There's already Nim, Rust, Go, Zig, etc., to compare with and the forks will in each case be just another language.

> >

That D hasn't taken over the world is beside the point; good things aren't always popular, e.g., Scheme, and sometimes bad things are very popular, e.g., Windows, JavaScript, C/C++.

Now this is the point where I have to totally disagree with you. It doesn't suffice for a system to be well designed and great to use "in theory", there must also be tooling, documentation, thousands if not millions of samples, and an active community.

Not really. Those things come after the userbase gets large. I was using Python in the 1990s and I can assure you that the growth did not come because of good tooling, documentation, or code samples. Similarly, I was using R when you used Emacs or a plain text editor, the documentation was similar to Linux man pages, and you asked questions on a mailing list with Brian Ripley. Only after it took off did they build RStudio. What both languages had was a small, dedicated group of users that were willing and able to build useful things with the language.

January 07

On Sunday, 7 January 2024 at 11:54:16 UTC, bomat wrote:

>

And yet, I feel like Zig is already getting more attention than D. Just my impression, I'm not going to speculate why that is.

I'll do it for you, d is a c++ killer not a c killer, zig will probably win the c killer race because it has a ton and different platforms and is working on a new libc, meaning zig and basically no one else can make breaking changes to fundamental things.

And d is a template hell with the most features and fastest compile time, but doesnt actually ship a completed data structures and algorithms project and honestly copies too many of stl's mistakes.

January 07

On Sunday, 7 January 2024 at 11:54:16 UTC, bomat wrote:

>

On Thursday, 4 January 2024 at 03:12:48 UTC, Don Allen wrote:
[snip]

> >

That D hasn't taken over the world is beside the point; good things aren't always popular, e.g., Scheme, and sometimes bad things are very popular, e.g., Windows, JavaScript, C/C++.

Now this is the point where I have to totally disagree with you. It doesn't suffice for a system to be well designed and great to use "in theory", there must also be tooling, documentation, thousands if not millions of samples, and an active community.

I said nothing about good tooling, documentation, etc. Of course those are necessary for something to be "good", which I'd point out, was my definition of "good", as "My opinions, of course" was intended to convey.

>

Otherwise it will not feel safe to embrace it - certainly not for companies, but to a lesser extent for every single developer.
If you look at your list of examples again - regardless if you deem them "good" or "bad" - this is something that every single one of them has, and which their competitors don't.
If you google for a problem/question you have with any of the mentioned things, you are very likely to find a viable solution.

In short, in order for something to be successful, it already has to be successful. This is a paradox that has been written about a lot and by much smarter people than me, and it is mysterious to most why some few projects have achieved to get over this hump while millions of others haven't.

It all depends on how you define "successful". If you define success as having a huge user community, then your paragraph above applies. I would argue that there are alternative ways to measure success. Is Scheme a success? OpenBSD? JS Bach? I say emphatically "yes" (especially regarding Bach) and yet all of them have user communities orders of magnitude smaller than their most popular competitors.

>

This brings me back to the beginning of my post where I lamented the split of an already niche language. Again, I hope that the motto "unity is strength" does not apply in this case and that everyone keeps open minded enough to profit from each other.

January 07
On 1/7/2024 1:22 AM, Paolo Invernizzi wrote:
> The whole point is, well, let's move on and simplify it!

Of course!


> DIP1036 could allow us to do that, with better library code and more encapsulation, your proposal simply can't do that without what you call 'more burden'.

I asked the question if adding a template call constituted an "undue" burden. What it does do is send a clear visual signal that the default behavior of istring is being adjusted.

> Long story short: in our codebase, we will stick with mixins with your proposal merged, on the contrary, we will use DIP1036 functionalities if merged.

Using DIP1036 for string interpolation means that for using it for sql calls means:

1. if something other than core.interpolation is imported at the global level, it will apply to all users of istring in that module, not just the ones calling sql functions. It means calling writeln with istrings won't do what is expected, and this is not visually apparent by looking at the code, nor is it checkable by the compiler.

2. an alternative would be locally importing core.interpolation or arsd.sqlite as required for each scoped use of istrings.
January 07
D has been used by several companies to make money with, that they've said would have been much more difficult to do with other languages.

That's one great definition of success!
January 07

On Sunday, 7 January 2024 at 09:04:16 UTC, Walter Bright wrote:

>

On 1/6/2024 9:35 PM, H. S. Teoh wrote:

>

Noteworthy is the fact that the competing string interpolation proposals
are not immune to this sort of SQL injection attack, because premature
conversion of the i"" literal to string would result in a successful
injection.

The same technique of having a template take the generated tuple and modifying it as it sees fit works with DIP1027, too. I posted an example here in the last debate about this.

...

It's true that in order for this to work,

db.execi(i"INSERT INTO sample VALUES ($(id), $(name))");

would need to be written as:

db.execi(xxx!(i"INSERT INTO sample VALUES ($(id), $(name))"));
>
where `xxx` is the thoroughly unimaginative name of the

...

So 1027 is equivalently good in this aspect as long as programmers are conscientious in their definition and use of a typing convention?

Unless 1036e is believed to be very difficult to implement correctly, or has nasty cross dependencies that could cause problems later, this would seem to be a bad trade (hypothetical? simplification of implementation in exchange for making things harder for users).

January 07

On Sunday, 7 January 2024 at 18:51:40 UTC, Walter Bright wrote:

>

On 1/7/2024 1:22 AM, Paolo Invernizzi wrote:

>

The whole point is, well, let's move on and simplify it!

Of course!

>

DIP1036 could allow us to do that, with better library code and more encapsulation, your proposal simply can't do that without what you call 'more burden'.

I asked the question if adding a template call constituted an "undue" burden. What it does do is send a clear visual signal that the default behavior of istring is being adjusted.

>

Long story short: in our codebase, we will stick with mixins with your proposal merged, on the contrary, we will use DIP1036 functionalities if merged.

Using DIP1036 for string interpolation means that for using it for sql calls means:

  1. if something other than core.interpolation is imported at the global level, it will apply to all users of istring in that module, not just the ones calling sql functions. It means calling writeln with istrings won't do what is expected, and this is not visually apparent by looking at the code, nor is it checkable by the compiler.

  2. an alternative would be locally importing core.interpolation or arsd.sqlite as required for each scoped use of istrings.

It seems you have a fundamental misunderstanding of what DIP1036 is, so here's a quick explanation: i"$​(str) has $​(num) items." becomes

AliasSeq!(
    InterpolationHeader(),
    InterpolatedExpression!"str",
    str,
    InterpolatedLiteral!" has ",
    InterpolatedExpression!"num",
    num,
    InterpolatedLiteral!" items.";
    InterpolationFooter(),
)

InterpolationHeader, InterpolatedExpression, InterpolatedLiteral, and InterpolationFooter are defined in core.interpolation, which doesn't need to be imported in order to use interpolated strings.

Not arsd.sqlite, nor any other library, defines their own interpolated strings. Importing a library does not and cannot change the behavior of interpolated strings, that is a misunderstanding. Library functions simple take in the interpolated string using a vararg template and do literally whatever they want with it, since they're given all the information about the interpolated string, including the evaluated expressions that were inside the string.

January 07
On 1/6/2024 9:35 PM, H. S. Teoh wrote:
> import lib.sql;

Where is this file?
January 07
On Sunday, 7 January 2024 at 20:03:03 UTC, Walter Bright wrote:
> On 1/6/2024 9:35 PM, H. S. Teoh wrote:
>> import lib.sql;
>
> Where is this file?

I think it's this one: https://github.com/adamdruppe/interpolation-examples/blob/master/lib/sql.d

From the Adam's examples: https://github.com/adamdruppe/interpolation-examples/

Matheus.