I have a plan.. I really DO

Ecstatic Coder ecstatic.coder at gmail.com
Fri Jun 29 12:32:46 UTC 2018


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...


More information about the Digitalmars-d-announce mailing list