I have a plan.. I really DO

Bauss jj_1337 at live.dk
Fri Jun 29 16:57:00 UTC 2018


On Friday, 29 June 2018 at 12:32:46 UTC, Ecstatic Coder wrote:
> On Friday, 29 June 2018 at 10:06:12 UTC, bauss wrote:
>> On Friday, 29 June 2018 at 08:43:34 UTC, Ecstatic Coder wrote:
>>> As you know, I'm convinced that D could be marketed as the 
>>> perfect language to develop native web servers and mobile 
>>> applications, and have its core libraries somewhat extended 
>>> in thqg direction, like Go and Crystal which allow 
>>> "plug'n'play" web server development for instance
>>
>> D allows for plug n' play web server development too.
>
> Then this should be more advertised...
>
> For instance :

> https://crystal-lang.org/
>
> The FIRST paragraph of text of Crystal's web page is :
>
> "Syntax
>
> Crystal’s syntax is heavily inspired by Ruby’s, so it feels 
> natural to read and easy to write, and has the added benefit of 
> a lower learning curve for experienced Ruby devs.
>
> # A very basic HTTP server
> require "http/server"
>
> server = HTTP::Server.new do |context|
>   context.response.content_type = "text/plain"
>   context.response.print "Hello world, got 
> #{context.request.path}!"
> end
>
> puts "Listening on http://127.0.0.1:8080"
> server.listen(8080)
> "
>
> So the FIRST thing you learn about Crystal is that the standard 
> library already gives you all you need to program a simple 
> "hello world" web server.
>
> The Go standard library is also known to provide the same 
> building blocks :
>
> package main
>
> import (
> 	"fmt"
> 	"net/http"
> )
>
> func main() {
> 	http.HandleFunc("/", func(w http.ResponseWriter, r 
> *http.Request) {
> 		fmt.Fprintf(w, "Hello, you've requested: %s\n", r.URL.Path)
> 	})
>
> 	http.ListenAndServe(":80", nil)
> }
>
> Both are batteries-included for web development. That's why 
> many developers don't feel the need to use thirdparty 
> frameworks to implement their microservices...
>
> So if it's also the case for D, then sorry for my mistake...

Sorry. My misunderstanding.

I thought you meant there were no frameworks that could be used 
as plug n play for web development.

For this to ever happen std.socket needs to be deprecated already 
and rewritten so D can have a standard http module.

I don't really see that happening though.

However I agree with the third party libraries to an extended, 
but it's not really an issue. All developers will end up with 
third party dependencies in one way or another, especially for 
web development. Like you'll most likely end up with some kind of 
JavaScript library, some sass/less compiler etc.

If you're a web developer with no dependencies then youre either 
reinventing the wheel (could cause trouble in the long run, if 
your implementations aren't correct.) Or your application just 
isn't more than a hobby project.

Most enterprise projects will have dependencies outside standard 
libraries and that is true for ex. Go too.

You also have to remember that D has a very different philosophy.


More information about the Digitalmars-d-announce mailing list