May 01, 2022
On 5/1/2022 6:44 PM, claptrap wrote:
> On Sunday, 1 May 2022 at 18:09:16 UTC, Walter Bright wrote:
>> On 5/1/2022 9:31 AM, claptrap wrote:
>>> And 99.9% of the time you're listening to AutoTuned vocals you dont even know.
>>
>> It's gotten to the point where I can tell :-)
> 
> How do you know when you cant tell? You dont, you just assume because you spot it sometimes you can always tell, you cant.

It leaves artifacts, and its use changes the style of singing.


> and the thing about singers being better in the 70s, it's not true, it's just that we've forgotten 90% of the music and we only remember the good stuff. It's natural selection. 20 or 30 years from now people will say the same about the 2010s, because all the crap will have been forgotten and only the good stuff remains. There's a name for it but I cant remember what it is.

Survivorship bias, yes, it's a real thing.


> I mean seriously look up the charts for a specific week in the 70s, or 80s or whatever, most of it was awful. But we just remember the stuff that stood the test of time.

There were a lot of awful songs, sure. But that's not what I'm talking about. I'm talking about the voice quality of the singer. It's not just hazy old memories of mine - this stuff is all available to listen to today at the click of a mouse, and the recordings are as high quality as today. You can hear and compare for yourself. May I suggest Roberta Flak, Karen Carpenter, Madonna, Robert Plant, Greg Lake, Jamie Somerville.

I've heard music executives on documentaries say they no longer look for good singers, because they can fix their singing electronically. They look for someone who looks good and has charisma.

Singers today are autotuned and electronically "sweetened". It just doesn't sound natural.

(An extreme form of this is thrash metal singers who run their voices through a guitar effects pedal(!) but I'm not talking about that. There's also vocorder use, but that isn't trying to make the singer sound better.)
May 02, 2022

On Monday, 2 May 2022 at 01:42:19 UTC, Walter Bright wrote:

>

On 5/1/2022 1:39 PM, Max Samukha wrote:

>

I don't quite understand why you insist on native code. Do compilers to bytecode count? There used to be a language called Nemerle (https://en.wikipedia.org/wiki/Nemerle), which had been mentioned on these forums many times, long before D got CTFE. The earliest mention I found is https://forum.dlang.org/post/ca56h1$2k4h$1@digitaldaemon.com. It had very powerful macros, which could be used as compile time functions, AST macros, and whatnot. The language is now dead because it was too good for humans.

Nemerle targeted C#'s bytecode system. I.e. it's an interpreter.

A language designed for interpretation does not distinguish between compile time and run time. While the program is executing, it can generate more code, which the interpreter executes. If the language is successful, it'll often get a native code generator to speed it up. The compiler is part of the runtime of the language.

A language designed for native compilation draws a hard distinction between compile time and run time. You'll see this in the grammar for the language, in the form of a constant-expression for compile time, and just expression for run time. The constant-expression does constant folding at compile time. The runtime does not include a compiler.

D is the first language I know of, designed for native compilation, with constant-expressions, that extended the evaluation of constant-expressions with the ability to execute functions at compile time. There's no compiler in the runtime. D does not support compiling code at runtime.

To clarify, if the runtime of a language includes a compiler, that is in the interpreted class of languages (even if they jit to native code), and it is not an example of what D's CTFE is doing. Lisp, Java, C# and apparently Nemerle fall into this category.

To show D is not the first, I request an example of a language designed for native compilation, that does not include a compiler in the runtime, that has constant-expressions in the grammar that must be computed at compile time and can execute ordinary functions at compile time.

C++ came closest to the mark with its Turing-complete templates.

This is an odd division to me. The way I do it in my lang is to just treat compiler runtime as a separate compilation target. Interpretation, code generation, it's all backend concern. But that still gives me the sort of "run program code at compiletime" capability that I think Nemerle aims at (though I've never used it), without any interpretation, just by targeting parts of the program at a backend that can be loaded back during the compilation run. And I think that's fundamentally a cleaner model than CTFE, because it doesn't rely on, in effect, embedding an entirely separate codepath for constant folding that reimplements deep parts of the compiler; instead, there is only one path through the compiler, and the split happens cleanly at the back-end ... and one backend just happens to be invoked by the compiler itself during compilation to get a function pointer to directly call.

One problem of doing it this way is that it makes static if very awkward. You're trying to evaluate an expression, but you want to access local "compiletime variables" - so you need to compile the expression being tested in an odd context where it lives in a function, "but not really" - any access to local variables triggers a special error, because the expression is really semantically at something like toplevel, it just syntactically lives inside a function. That's why for now, I just use constant folding like D for static if. (Also, I'm dog slow and I'm trying to limit the amount of macro compilation roundtrips. Gonna switch to an interpreter backend some time - for a speedup. LLVM makes good code, but its performance is painful.)

But I still think this is fundamentally the right way to think about CTFE. The compiler runtime is just a backend target, and because the compiler is a library, the macro can just recurse back into the compiler for parsing and helper functions. It's elegant, it gets native performance and complete language support "for free", and most importantly, it did not require much effort to implement.

May 02, 2022

On Monday, 2 May 2022 at 03:53:11 UTC, Walter Bright wrote:

>

I've heard music executives on documentaries say they no longer look for good singers, because they can fix their singing electronically. They look for someone who looks good and has charisma.

Madonna is a prime example of that though... but it is true that the charts contain overproduced music, or worse, there is much less variation of style in the chart tops now than in the 80s. But if you move out of the top you find singers like Yeba and Angelina Jordan that are the real deal in terms of talent.

May 02, 2022

On Sunday, 1 May 2022 at 13:35:46 UTC, Guillaume Piolat wrote:

[..]

>

slices
Go and Rust had it from the start, Nimrod got them etc.
I unfortunately lack the time to do a complete research about prior, because it seems surprising to me no other native language had them before D. I have a strong feeling that like other successful features, the experience of D was strongly influencing other designs.

I discovered recently that one of the first language to have slices was BASIC. Not Microsoft derived Basics but the lowly Sinclair BASIC had something conceptually very close to slices.

From wikipedia

Unlike the LEFT$(), MID$() and RIGHT$() functions used in the ubiquitous Microsoft BASIC dialects for home computers, parts of strings in Sinclair BASIC are accessed by numeric range. For example, a$(5 TO 10) gives a substring starting with the 5th and ending with the 10th character of the variable a$. Thus, it is possible to replace the LEFT$() and RIGHT$() commands by simply omitting the left or right array position respectively; for example a$( TO 5) is equivalent to LEFT$(a$,5). Further, a$(5) alone is enough to replace MID$(a$,5,1).

and what's not mentioned in the wikipedia is that the slicing also worked as lvalue. ´a$(5 TO 7)="12"´ was possible.

May 02, 2022
On 5/1/2022 11:15 PM, FeepingCreature wrote:
> [...]

It's a cool way to make it work. But I don't think it changes the nature of what I was talking about.
May 02, 2022
On Sunday, 1 May 2022 at 19:43:42 UTC, monkyyy wrote:
> On Sunday, 1 May 2022 at 18:09:16 UTC, Walter Bright wrote:
>> [...]
>
> The children now love luxury; they have bad manners, contempt for authority; they show disrespect for elders and love chatter in place of exercise. Children are now tyrants, not the servants of their households. They no longer rise when elders enter the room. They contradict their parents, chatter before company, gobble up dainties at the table, cross their legs, and tyrannize their teachers.

Yes, we had 2.5 millennia to correct that impression ;-)
May 02, 2022
On Monday, 2 May 2022 at 07:05:00 UTC, Walter Bright wrote:
> On 5/1/2022 11:15 PM, FeepingCreature wrote:
>> [...]
>
> It's a cool way to make it work. But I don't think it changes the nature of what I was talking about.

That's fair, I'm kind of jumping in on the tail end of the discussion. So I'm probably missing a lot of context. I guess I just wanted to highlight that having compiletime in-language macros doesn't commit you to a compilation model that weakens the compiletime/runtime boundary. Anyway, I just have a hard time of seeing how the CLR target relates to this. Just because Nemerle targeted the CLR doesn't make it an interpreted language with regard to CTFE, because targeting the CLR doesn't actually buy you any simplicity in this. You can compile to code that is then loaded back into the running context just as easily on x86 as on CLR. For the purpose of compiler design, the CLR is just a processor, no?
May 02, 2022
On Sunday, 1 May 2022 at 20:31:14 UTC, Walter Bright wrote:
> On 5/1/2022 6:35 AM, Guillaume Piolat wrote:
>> **slices**
>>     Go and Rust had it from the start, Nimrod got them etc.
>>     I unfortunately lack the time to do a complete research about prior, because it seems surprising to me no other native language had them before D. I have a strong feeling that like other successful features, the experience of D was strongly influencing other designs.
>
> D slices date back to 2001 or so. I don't know any language before that that had such a thing as part of the language. Of course people would do it in ad-hoc manners.
>

As mentioned in my other comment, Sinclair BASIC had something very close to it (and I think HP had the same thing in their BASIC interpreters).


May 02, 2022
On Monday, 2 May 2022 at 07:04:31 UTC, Patrick Schluter wrote:
> On Sunday, 1 May 2022 at 13:35:46 UTC, Guillaume Piolat wrote:
>
> [..]
>> [...]
>
> I discovered recently that one of the first language to have slices was BASIC. Not Microsoft derived Basics but the lowly Sinclair BASIC had something conceptually very close to slices.
>
> [...]

OMG, that's true! My first programming tool was the Spectrum

Thank you Patrick, you made my day! :-P


May 02, 2022

On Sunday, 1 May 2022 at 21:00:23 UTC, Ali Çehreli wrote:

>

I think the authors desperately held on to one idea that they could prove to be correct. One truth does not make all their points correct.

I believe the chose "if constexpr" because it doesn't significantly alter language semantics and compiler internals. C++ already had #ifdef, so the I personally don't find a need for more than "if constexpr". The concept of "if constexpr" also has a valuable advantage when writing a library: the compiler can type check all branches.

The primary advantage, IMHO, for D to have "static if" rather than "if constexpr" is that a static for loop becomes trivial to implement. So this is an advantage the D is likely to retain.