April 30, 2022
On 4/30/2022 1:32 AM, Paulo Pinto wrote:
> Switching gears to ranges, we have Smalltalk-80 collections as one possible example,
> 
> https://www.researchgate.net/publication/2409926_Interfaces_and_Specifications_for_the_Smalltalk-80_Collection_Classes 

C++ went the iterator approach. Ranges in C++ occurred only after D did them.

Also, Lisp started out as an interpreted language. Native compilation came much later.

I'm interested in an example of a language that started out as a natively compiled language, and then added interpretation.

I know back in the 80's there were some C interpreters, but they were not combined with a native compiler. Nobody thought to put the chocolate and the peanut butter together.

No version of Fortran I ever used had CTFE.
April 30, 2022
On 4/30/2022 2:30 AM, Paulo Pinto wrote:
> D hasn't invented anything newer here, and regardless of the wishfull thinking that it did, you won't find any references to D as inspiration to those features in modern languages papers like HOPL, rather to those that have preceeded it.

You won't find any references to D as inspiration for static if in C++, either, despite the fact that Andrei, Herb, and I submitted a formal proposal for it for C++.
April 30, 2022
On 4/30/2022 10:27 AM, Walter Bright wrote:
> On 4/30/2022 12:05 AM, Paulo Pinto wrote:
>> On Friday, 29 April 2022 at 19:10:32 UTC, Walter Bright wrote:
>>> So why did other native languages suddenly start doing it after D did to the point of it being something a language can't skip anymore?
>> They didn't, they got inspired by those that preceded D, you just want to believe D was the cause.
> 
> The timing suggests strongly otherwise.
> 
> C++'s discovery that templates could be used for CTFE suggests otherwise, too. All those articles about it never mentioned just interpreting an ordinary function instead.
> 

There is this paper from 2007:

http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2235.pdf

which proposes extending constant folding to functions, as long as those functions are preceded by `constexpr` and consist of a single `return` statement. Recursion is prohibited. Only literal types permitted.

It couldn't even replace the use of template metaprogramming to compute values.

It's also a proposal. D released an implementation in 2007, that was way beyond n2235.
April 30, 2022

On Saturday, 30 April 2022 at 17:39:04 UTC, Walter Bright wrote:

>

I'm interested in an example of a language that started out as a natively compiled language, and then added interpretation.

https://crystal-lang.org/2021/12/29/crystal-i.html

April 30, 2022

On Saturday, 30 April 2022 at 17:39:04 UTC, Walter Bright wrote:

>

On 4/30/2022 1:32 AM, Paulo Pinto wrote:

>

Switching gears to ranges, we have Smalltalk-80 collections as one possible example,

https://www.researchgate.net/publication/2409926_Interfaces_and_Specifications_for_the_Smalltalk-80_Collection_Classes

C++ went the iterator approach. Ranges in C++ occurred only after D did them.

We're strange. IIRC Bjarne's third C++ book from 1998 already discusses a bit about ranges, albeit calling them "sequences". It shows a few examples how they can work, by pairing iterators into one type, and then goes on to other topics.

Spending any amount of time using Phobos ranges will reveal them as clearly superior to iterators in common usage. One would think that when the idea has been around at least 24 years, ranges would have long since displaced iterators as the recommended standard C++ construct. Yet no.

BTW, As I understand it ranges came to D at around 2008 or 2009. Out of interest, what was D's way of doing the same tasks before that?

April 30, 2022
On 4/30/2022 10:43 AM, Walter Bright wrote:
> On 4/30/2022 2:30 AM, Paulo Pinto wrote:
>> D hasn't invented anything newer here, and regardless of the wishfull thinking that it did, you won't find any references to D as inspiration to those features in modern languages papers like HOPL, rather to those that have preceeded it.
> 
> You won't find any references to D as inspiration for static if in C++, either, despite the fact that Andrei, Herb, and I submitted a formal proposal for it for C++.

As to why there aren't references to D as inspiration, and no references to Zortech C++'s seminal role in the early days of C++, consider this:

http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3613.pdf
April 30, 2022
On Saturday, 30 April 2022 at 20:05:14 UTC, Walter Bright wrote:
> On 4/30/2022 10:43 AM, Walter Bright wrote:
>> On 4/30/2022 2:30 AM, Paulo Pinto wrote:
>>> D hasn't invented anything newer here, and regardless of the wishfull thinking that it did, you won't find any references to D as inspiration to those features in modern languages papers like HOPL, rather to those that have preceeded it.
>> 
>> You won't find any references to D as inspiration for static if in C++, either, despite the fact that Andrei, Herb, and I submitted a formal proposal for it for C++.
>
> As to why there aren't references to D as inspiration, and no references to Zortech C++'s seminal role in the early days of C++, consider this:
>
> http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3613.pdf

I can't fathom what they were thinking when they wrote that paper. The reasoning in it is so bad that it's an outright disgrace to the C++ committee. Not saying they should have accepted the proposal, there were some good arguments, but as a whole it's ignorant to the point of appearing downright hostile. You really deserved much better than that.
April 30, 2022
On 4/30/2022 10:39 AM, Walter Bright wrote:
> On 4/30/2022 1:32 AM, Paulo Pinto wrote:
>> Switching gears to ranges, we have Smalltalk-80 collections as one possible example,
>>
>> https://www.researchgate.net/publication/2409926_Interfaces_and_Specifications_for_the_Smalltalk-80_Collection_Classes 
> 
> 
> C++ went the iterator approach. Ranges in C++ occurred only after D did them.

A bit more. C++ invented iterators as a generalization of pointers. D's contribution was ranges as a generalization of D's dynamic arrays.

Since then, ranges have found their way into C++ via Eric Niebler's contributions. I think the C++ ranges are a generalization of an iterator pair, which in my not-so-humble opinion is an inferior design as assembling one is not safe.

I am not claiming invention of the concept of an object that can iterate through a data structure, or pipeline programming.
April 30, 2022
On 4/30/2022 12:30 PM, Siarhei Siamashka wrote:
> On Saturday, 30 April 2022 at 17:39:04 UTC, Walter Bright wrote:
> 
>> I'm interested in an example of a language that started out as a natively compiled language, and then added interpretation.
> 
> https://crystal-lang.org/2021/12/29/crystal-i.html


14 years after D :-)
April 30, 2022
On 4/30/2022 12:33 PM, Dukc wrote:
> On Saturday, 30 April 2022 at 17:39:04 UTC, Walter Bright wrote:
>> On 4/30/2022 1:32 AM, Paulo Pinto wrote:
>>> Switching gears to ranges, we have Smalltalk-80 collections as one possible example,
>>>
>>> https://www.researchgate.net/publication/2409926_Interfaces_and_Specifications_for_the_Smalltalk-80_Collection_Classes 
>>>
>>
>> C++ went the iterator approach. Ranges in C++ occurred only after D did them.
> 
> We're strange. IIRC Bjarne's third C++ book from 1998 already discusses a bit about ranges, albeit calling them "sequences". It shows a few examples how they can work, by pairing iterators into one type, and then goes on to other topics.

There is little choice in C++ but to use a pair of iterators. The next step was to put them together into std::pair, but that simply went nowhere in C++ until Eric Niebler decided to do something about it.


> Spending any amount of time using Phobos ranges will reveal them as clearly superior to iterators in common usage. One would think that when the idea has been around at least 24 years, ranges would have long since displaced iterators as the recommended standard C++ construct. Yet no.

Iterators had gotten very, very entrenched in C++ by then.


> BTW, As I understand it ranges came to D at around 2008 or 2009. Out of interest, what was D's way of doing the same tasks before that?

D didn't have a metaprogramming way of doing that before.

Ranges based on dynamic arrays were a natural fit for D.