In the age of microservices and networking in general, were D is at?

ryuukk_ ryuukk_ at gmail.com
Sun Sep 13 21:08:51 UTC 2020


On Sunday, 13 September 2020 at 20:57:47 UTC, Seb wrote:
> On Sunday, 13 September 2020 at 19:58:46 UTC, ryuukk_ wrote:
>> I forgot to add, but i personally volunter is starting the 
>> work on a better std.net solution
>>
>> I'm not super experienced, but i think i can improve things, 
>> better than nothing? :D
>> 
>> What's preventing from having HTTP Server/Client, Socket with 
>> proxy support in the std lib?
>
> We had this debate many, many times. There are _no_ plans to 
> add anything to Phobos, it's essentially frozen for the same 
> reasons as in all many other languages (e.g. stability >> 
> features).
>
> tl;dr of these discussions:
> - Use https://code.dlang.org/packages/requests for a HTTP client
> - Use https://code.dlang.org/packages/vibe-d for a HTTP server
>
> Also, we aren't alone in our views here, see e.g. 
> https://github.com/psf/requests/issues/2424.
>
>> A base where everyone could share expertise, and anyone could 
>> build middleware, on a same common base!
>
> And then you want to fix/improve the API, but can't because you 
> would break the world.
> Dub is _superior_ because it always semantic versioning and the 
> community has figured out common bases e.g. 
> https://code.dlang.org/packages/eventcore
>
>> And the expenrience there can varry a lot depending on the 
>> user (how he look for dub packages, google, github, code.dlang 
>> etc etc)
>> Couldn't the default experience be better?
>
> It's on the front page of dlang.org:
>
> ---
> #!/usr/bin/env dub
> /+ dub.sdl:
> dependency "vibe-d" version="~>0.9.0"
> +/
> void main()
> {
>     import vibe.d;
>     listenHTTP(":8080", (req, res) {
>         res.writeBody("Hello, World: " ~ req.path);
>     });
>     runApplication();
> }
> ---
>
> How could we improve that experience?


After reflection and your post demonstrates that it is not an 
issue at all

What i'm after thought is the phsycological part of it, getting 
started now involves having to consume a dependency, just to get 
an http listener

If we look at things on a global scale, it doesn't matter since 
you usually need the whole middle ware

But if you look much smaller scale, people who just want to 
test/experiment

Having a simple way to create a listener, without having to add 
packages to a project, feels much better (look at GO, getting 
started with ease is key)



>
>> Hmm, out of the box the experience is super poor
>
> If using dub packages is hard or has a poor experience, then 
> you/we should work on improving that experience.
> Ideas (and PRs) on this topic are always welcome.


DUB is AWESOME, i wouldn't use D that much without a proper 
package manager, and DUB is perfect for that!

It's just the fact that it's something you have to pull to get 
started, on top of downloading the whole dmd + dub, it feels not 
needed, hence the need of something in the std lib

Maybe i am just overthinking it, but yes you have a point, and i 
exaggerate a little bit on the "out of the box experience"



More information about the Digitalmars-d mailing list