Re: vibe.d and my first web service

2020-08-20 Thread Ben via Digitalmars-d-learn

On Thursday, 13 August 2020 at 09:54:06 UTC, Mr. Backup wrote:
And as soon as I came across it, I wanted to use it in my 
project. But it has many packages for the same things, but 
these packages are unfinished. Everyone creates their own. You 
start comparing them and don't know what to choose for your job 
and then you find out that you should have chosen another and 
then find out that you should have written it yourself. And 
then I finally done it in golang in a while. I think the dlang 
community should focus on creating a quality standard library.


We live in the 21st century where there are web technologies 
everywhere around us, so I think that the http package should 
be part of a standard library.


People have been pushing for that for years but the answer in D ( 
and some other languages ) always tend to be the same.


"We do not want to bloat the standard library". In reality it 
comes down to: "We do not want the responsibility of maintaining 
a lot more code".


So the buck gets pushed to the community and if its not a big 
community, you will see a of people starting projects. It works 
for them on their projects and then it get abandoned as they move 
to new languages or have no time.


If we look at Go or Crystal or ... a lot of the reason why people 
pick up those languages, boils down to "its easy to get some 
output". A few lines of code and it makes people feel successful 
and they move on to the next step and forward from their on. 
Growing more into the languages.


In D's case, we enjoy the constant Vibe.D warning hell ( when it 
did not break outright with specific D versions! ). That not only 
scares away people, it also makes development annoying when your 
constantly spammed with warnings and you can not see what is 
vibe.d's warnings and what is your code's warnings!


And vibe.d is on the front pages, as the prime example for people 
to try out D.

o_O

Anyway, its a dead argument, go back in time to see that same 
suggestion in 2017, 2015, 201... And people argued about it, 
people telling other "no" and new users kept enjoying the vibe.d 
issue train ( among other issues ) while leaving fast. And then 
people keep wondering why a lot of people do not stick around and 
run towards Go or other languages ... I wonder why D has 
popularity issues.


Having some issues using Generator's yield with an interface

2015-11-02 Thread Ben via Digitalmars-d-learn
When I create a generator using an interface (or abstract class) 
I must cast the concrete instance to the interface. Why does the 
Generator not know that B is a implementation of the interface of 
A?


/// Test Code
interface A {}
class B : A{}

// Fails
auto testGen1 = new Generator!A({
yield (new B());
});

// Succeeds
auto testGen2 = new Generator!A({
yield ( cast(A) new B());
});