D for Web Development?
Wulfklaue via Digitalmars-d-learn
digitalmars-d-learn at puremagic.com
Fri Jun 9 03:25:02 PDT 2017
On Thursday, 8 June 2017 at 07:32:44 UTC, Michael Reiland wrote:
> Hey guys,
>
> I'm looking for a web solution that's:
> 1. Supported on Linux
First tier: D, Rust, Go, .netCore
Second tier: Nim, Crystal, ... plenty of choices :)
Not advised for Linux: Swift... Unless you go for a pure Swift
framework, the basic Linux support is horrible.
> 2. Statically typed,
> 3. Reasonably performant,
Micro benchmarks, the root of all evil:
https://github.com/kostya/benchmarks
But they show a trend in regards to D. With LDC almost always in
the top 5. Comparable speed / memory usage to C/C++.
> 4. Reasonably productive.
Unless you go with a very exotic langue, most of them are
productive. Try Brainf*ck :)
> 5. Simplicity (in terms of infrastructure and the language
> itself).
Go ... defiantly the most simple. Until you start doing some
advanced work and then the skill level also needs to increase.
And the whole lacking generics, meta programming etc ... It
becomes a issue faster then you think. Like i said, it depends on
what you want to write. For pure web, Go is not a bad choice.
D is more if people already have some C/C++ background. Java or
PHP sure ... you can adapt also from there. The learning curve is
harder the Go but not that much.
> The contenders as I see them are .Net Core, Go, and D.
>
> I know next to nothing about Go and D and I've never attempted
> to use .Net Core.
Go: Great amount of plugins. But the language is limiting. Good
for web development and smaller tasks. Great Cross compile
support. Go and Rust have about the most easy cross platform
compile support. Something that i find missing in D.
.Net Core: Very mature ( if you use the 2.0 version ) but ...
memory usage... Say hello to Java. And not exact the most
performend.
> I'd like to evaluate D, but since I'm so ignorant I thought I'd
> post here for people's thoughts.
>
> It seems as though vibe.d is the most prevalent framework, and
> even has a book about it here:
> https://www.amazon.com/D-Web-Development-Kai-Nacke/dp/178528889X/
>
>
> A few questions:
>
> - Is vibe.d the recommended way of doing web work?
Or write your own. You much more experience that way. Look at
vibe.d and other frameworks there code for hints.
> - Is that book worth purchasing?
No idea...
> - Does D have a good library for accessing Postgres? I see
> several listed but I don't know what the most stable would be
> for production:
> https://wiki.dlang.org/Libraries_and_Frameworks#Databases
>
> - Why is D a better solution than Go or .Net Core? Is there
> something else you would recommend given what I'm looking for?
Faster then Go, way faster then .Net Core. Way better memory
usage then .Net Core.
D's GC seems to be also better then .Net Core. And you can run
without GC if needed in specific functions ( @nogc ).
Is D the best, no ... no language is the best
- The manual needs work ( there is a better more overview able
one under /Library but most new people like me do not know it )
- Cross platform compile needs work
- Some other minor stuff like editor support is a bit weak. But
that is also a issue with other "new" languages.
But its very feature complete, has all the big boy toys, multiple
compilers to fit your need ( dmd for fast compiling, LDC for
actual production = 2 a 3 times faster ).
If you want stable, features complete, somewhat "boring" then its
D for sure. Do not expect to see every buzz word like Swift with
constantly changing APIs and unstable changes. It just is a bit
boring *lol* ... hard to explain. Its a work language not a hype
language.
> Here's my take on the last one.
>
> .Net Core is still immature and probably the most complex in
> terms of infrastructure setup/maintenance.
Incorrect... .Net Core 2.0 is fairly future complete. You can run
the preview version without issue. I ran the beta from months ago
and everything worked like a charm. Its fairly easy to setup on
Linux. It just has other issues if you care about performance and
memory usage. That might change if the CoreRT cpp compiler ever
comes out but that may take years before its really stable. And
interacting with C libraries somewhat funky. No manual memory
management...
Every language has issues.
> And my impression is that Go vs D in the web space is more
> about personal preference than any particular advantage, and
> I'm coming from C++ so I think D would be more my cup of tea.
It looks like you made up your mind and just need reaffirming. I
know the feeling :)
You have only looked between .Net Core, Go and D.
Trust me when you have done the list of D, Rust, Go, .netCore,
Crystal, Nim, Haxe, Crystal, Jai, Odin or even try to write your
own lexer/parser in LLVM, then you know there is no perfect
language. And yet i ended up with D despite no C/C++ background.
But given your C++ background, D is a perfect fit. In my honest
opinion. But with every language, the first steps are the most
difficult until you get going.
The biggest issue is that D is so feature complete but somewhat
bad at drawing people at its future.
Go: you think Coroutines.
Rust: you think manual memory management, safe.
Nim: Meta programming...
D ... it has ... well, everything and more but because it has it
all, it has no one thing that people talk about all the time.
If somebody tells you "defer". You think Go, maybe Swift. You do
not think scope(exit) what does the exact same thing in D. Go:
Coroutines ... D: fibers ( technically not 100% the same but
close ). Etc ...
Anyway, lunch break is almost over. I hope this helped you with
your choice. Pick what fits for your project.
More information about the Digitalmars-d-learn
mailing list