[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y ] [Search | Free Show | Home]

Proper debate: Dlang vs C++.

This is a blue board which means that it's for everybody (Safe For Work content only). If you see any adult content, please report it.

Thread replies: 149
Thread images: 14

File: d4.gif (7KB, 804x252px) Image search: [Google]
d4.gif
7KB, 804x252px
Which one is more productive?
Which one is easy to avoid exceptions?
Is C++ too big to learn (with all the libraries)?
Is D more easy tool to use?
Which one is easier to build scalable programs?

No C meme masters please. I want to pick a language for my personal project (text-editor)
>>
Both are shit, try APL
>>
>>59257519
have you considered C?
>>
>>59257519
>Is D more easy tool to use?
No one knows that because no one uses that
>>
File: d lang.png (909KB, 1280x720px) Image search: [Google]
d lang.png
909KB, 1280x720px
>>
>>59257557
yes hence I made this tread
>>
>>59257519
>Which one is more productive?
Either

>Which one is easy to avoid exceptions?
Either

>Is C++ too big to learn (with all the libraries)?
No

>Is D more easy tool to use?
No, lack of a considerable community and lack of development makes it a non-trivial tool to use.

>Which one is easier to build scalable programs?
Either

D is honestly a good concept, but the development of it is too stagnant and the committee's reluctance to make the GC optional ensured the development of more "modern" languages such as Go and Rust.
>>
@59257519
both are garbage
>>
>>59257646
>>59257595
Get out.
>>
File: D.jpg (42KB, 512x512px) Image search: [Google]
D.jpg
42KB, 512x512px
>>59257699
no
>>
Rustfag here
pick your poison:
template <typename ReturnType, typename... Args>
function<ReturnType (Args...)> memoize(function<ReturnType (Args...)> func)
{
map<tuple<Args...>, ReturnType> cache;
return ([=](Args... args) mutable {
tuple<Args...> t(args...);
return cache.find(t) == cache.end()
? cache[t] : cache[t] = func(args...);
});
}

auto memoize(F)(F func)
{
alias ParameterTypeTuple!F Args;
ReturnType!F[Tuple!Args] cache;
return (Args args)
{
auto key = tuple(args);
return key in cache ? cache[key] : (cache[key] = func(args));
};
}
>>
>>59257519
C++ is a complete disaster in every way

D might be better, but it never caught on. Compiler optimization will be worse and it will have worse library support as a result.

Overall, C++ is a necessary evil, unless you want to work in C, Ada or some other ancient language. If you don't care about performance, then feel free to go with a meme language like Java, rust or Haskell; they all might be easier for you to work with than C++.
>>
>>59257881
Rust is faster than C++
>>
>>59257914
If C++ is slower than C in a language benchmark, then the person who wrote the benchmark is not taking advantage of the performance benefits of C++. In that case, there's no point of using C++.
>>
>>59257948
Many idiomatic C++ constructs make it slower than C in real world code. I agree the compile time optimization potential given by templates should make it faster for benchmarking but that's what it is, a benchmark and nothing more.
>>
D is superior to C++
>>
>>59258009
>Many idiomatic C++ constructs make it slower than C in real world code
yeah, that's one of the main reasons I hate C++.
>>
>>59257881
>Compiler optimization will be worse and it will have worse library support as a result.
literally both of these are not true
>>
>>59258093
the language is less used, so less effort is put into the compiler.

the language can't use C++ libraries (as far as I'm aware), so it'll have less library support than C++.
>>
>>59258143
>the compiler.
D has three compilers
>>
>>59258255
>he forgot a letter. better correct him
and probably none of them have had as much effort put into front end optimization as GCC, Clang or ICC.
>>
>>59258343
LLVM is actively developed and LDC is very active
>>
>>59258387
LLVM is not a compiler front end, and clang is probably a lot more active. People get paid to work on clang. No one is going to do that for D.
>>
File: rust-logo.png (24KB, 209x208px) Image search: [Google]
rust-logo.png
24KB, 209x208px
I'M YOUR GOD NOW
>>
>>59258143
>the language can't use C++ libraries

You can directly call any piece of c/++ with a simple extern.
>>
>>59258592
I'm on it, senpai
>>
>>59258872
>>59258592
Forgot the picture
>>
>>59257519
It's called "DLang" because that's the noise the compiler makes when it crashed.
>>
>>59257881
Haskell is one of the fastest languages
>>
File: rustled.png (191KB, 534x306px) Image search: [Google]
rustled.png
191KB, 534x306px
>>59259567
>>
>>59259617 (bait)
>>
>>59259685
He's right though. It depends on the compiler you use.
>>
>>59257519
Golang
>>
File: fast-reliable-typed.png (3MB, 1920x1080px) Image search: [Google]
fast-reliable-typed.png
3MB, 1920x1080px
>>59257551
>Both are shit, use Rust

FTFY, you cis scum.
>>
>>59260799
Was there a rust meme picture contest?
>>
>>59257519
>Is D more easy tool to use?
Nobody uses D. Last I heard, Facebook did something with it but I'm pretty sure they're back to using the JVM or something.
>>
File: 1480813260117.png (235KB, 754x512px) Image search: [Google]
1480813260117.png
235KB, 754x512px
>>59260821
I know it may be hard for you to face and accept reality; with all the effort and time you've put in mastering your chosen language. However, reality is what it is, and currently, Rust pretty much obsoletes older system languages.

The sooner you accept it, anon. The better you'll feel.
>>
Rust is hard man
>>
>>59261002
What sort of retard does one have to be to say this?
>>
>>59261065
The type of retard to be bad at Rust, apparently.
>>
>>59261065
you know it's hard when you see hello world needs a macro
>>
>>59261076
Not just at Rust, he must be pretty bad at even the most basic activities needed to sustain life. Which is why I'm curious as to how he is still alive.
>>59261079
Is this really what your kind believes? I'm really sorry for you.
>>
>>59260958
I'm genuinely asking about the image, you faggot.
>>
>>59261002
That, I can attest to. It's by far the hardest cs subject I learned in recent years. Took me a couple of months to gain enough understanding to do something useful.

But after that, it's all down hill. In my honest opinion, the productivity gains alone is well worth the time and effort invested.
>>
>>59261113
Why do pre teens get so angry for no reason??
>>
>>59261133
it's the only place they can get angry without being beaten
>>
>>59261142
>>
>>59261130
Are you genuinely retarded?
>>
>>59257863
Wow, Rust looks like garbage. I'll try D, thanks.
>>
>>59261154
Fuck off kid
>>
>>59261158
the one above is C++, you idiot
>>
File: 1464769260386.jpg (18KB, 186x210px) Image search: [Google]
1464769260386.jpg
18KB, 186x210px
>>59261158
>I'll try D
>>
>>59261163
How about you actually answer the question?
>>
>>59261205
>>>/global/rules/2
>>
>>59261211
Are you fucking moronic?
>>
>>59261217
>>59261205
>>59261113
>>59261154
Fuck off
>>
>>59261205
No, not that I'm aware of.
>>
>>59261228
>>59261231
Holy shit you're all fucking retarded
>>
>>59257519
Language: D is better.
Compiler: C++ wins by a hard to compare amount.

I hope some day that D catches up and C++ goes away.
>>
>>59261243
what about Rust? Genuinely asking.
>>
>>59261239
I like beating kids. Drop by anytime and I'll snap your tiny neck
>>
File: 1488577937023.png (81KB, 512x288px) Image search: [Google]
1488577937023.png
81KB, 512x288px
>>59261259
>>
>>59261239
>>59261231
>>59261228
>>59261217
>>59261211
>>59261205
>>59261166
>>59261158
>>59261154
>>59261142
>>59261133
fuck you guys for spamming this thread, eliminating quality contributions like >>59261188
>>
>>59261260
You're an animal.
>>
>>59261259
D might not be winning the game, but Rust was never even a player.
>>
>>59261287
Why
>>
>>59261301
Think about it. Outside of /g/ and maybe a couple other very niche social media websites, have you ever even seen it mentioned? Does anyone talk about it in real life? Ever?
>>
>>59257519
The whole C++ vs D marketing is honestly my biggest problem with D. D shouldn't be targeting C++ developers that want as much performance as possible(at least while it has a garbage collector). It should target the Java and Python developers by bragging that it's almost as fast as C++* while begin just as convenient. Hell it's even possible to machine translate Java to D. D could in theory have access to Java Standard Library.

* C++ and D are equal except in memory management.
>>
>>59261259
I like Rust more than C++. It's memory safe. It has a lot of money behind it (unlike D) that's making the compiler perform well.
Rust has more money behind it than D, which is a big deal.

Rust is already a fairly new language, yet its performance is often comparable or better to C++.

I think D is very beautiful to read. Very clear. But Rust does have a ton of features in the language that I think are just new and take some time to get used to rather than just being plain disgusting and bad like in C++.

D could potentially outperform C++ on top of being memory safe and easier to write/read, but not unless someone dumps a billion dollars into it.
Still... a good first language to learn and use as a hobby. Skills you learn in it will translate to another language.
>>
>>59261333
Mozilla and servo is going to it, do you know what servo is?
>>
>>59261333
Yes. In common IT news sites and magazines, actually. And some fucko web meme companies like Google and Dropbox use it. Unfortunately, that makes it the wrong userbase.
>>
>>59261336
That's the general problem of D, from day 1. They lack a clear goal.
>>
>>59261362
>>59261369
All right, outside of 4chan, some very niche social media websites, some magazines nobody reads, and some inconsequential companies that could disappear tomorrow without anybody noticing, has anyone ACTUALLY heard of this vaporwave meme language that will never get out of beta?
>>
>>59261381
I doubt Google and Dropbox will go out of business without anyone noticing.
Nice mental gymnastics.
>>
>>59261381
I don't think I hear about Linux outside 4chan as much, do you think pewdiepie should advertise Rust for it being good?
>>
>>59261379
The goal was to just make a better C++ pretty much.
As a LANGUAGE it's good. But that's about all it is. That's not enough to get people to switch.
It needs money behind it to make a good compiler and to get people using it.

Programming languages are a meme.
>>
>>59261333
Uhhh as a programmer, I hear or see something about Rust at least 100x more than D, while I'm not really following either.
>>
>>59261452
>Programming languages are a meme.
True, true.
>>
>>59261339
>D is memory safe
Please tell me how true it is
>>
>>59261486
You write a program in Rust, and you compile. If there are issues, the compiler won't finish and will tell you about them.

Your program will run as you intended in writing it. It won't segfault.

There are ways to explicitly write unsafe code in Rust, but the language makes it very clear you're doing that in an unsafe block. IMO, that's a good way to handle it.
>>
>>59261540
I love rust, trust me. Problem is it doesn't have a book for my level of skill (intermediate)

D has this http://ddili.org/ders/d.en/Programming_in_D.pdf
It's a fantastic book, written just for me. However Rust books think I already know a fair amount of other languages

If a proper introductory book publishes I'll buy it in a heartbeat
>>
>>59261339
>I think are just new
wrong. most of them have been around for a while now.
>>
Everyone in here just needs to shut the fuck up, put on your big boy clothes, and learn java like a fucking professional dev. done.
>>
>>59261622
Not him but I believe rust is a good collection of the goodies found in random languages
>>
I'm impressed. The thread was spiraling out of control just a couple of minutes ago, and now it's back with proper discussions and shit.

Will my post jinx it?
>>
>>59261645
yeah, that's probably true. just saying that a lot of it isn't new at all.
>>
>>59261622
I meant the syntax for the features are rather different.

Rust is pretty much a hodgepodge of things learned from other languages.
>>
File: delet_this.png (202KB, 535x314px) Image search: [Google]
delet_this.png
202KB, 535x314px
>>59261634
>>59261653
delet this
>>
>>59261634
this
>>
why are people so against arbage collection? the compaction phase can give great performance boosts to long running applcations
>>
>>59261720
I'm not against it
>>
>>59261634
>learn a language that's almost as slow as Python and doesn't even have proper functioning closures just because it's what "professionals" used for a while

>>59261720
Because GC without some fancy neural network and machine learning isn't there yet. The performance is worse than properly clearing memory yourself.

But that is something I like about D. It has BOTH. You can try to manually uncommit memory optimally, and if there are any scraps you miss the GC will collect it without too much of a hit.
>>
>>59261540
>If there are issues, the compiler won't finish and will tell you about them
If it detects every issue, which is not guaranteed.
>Your program will run as you intended in writing it
Semantic correctness is a way bigger problem than memory checking, which is available with any modern tool.
The main problem with Rust is they don't understand (or lie on purpose) what "safety" actually means.
>>
>>59261720
Unfortunately the user feedback loop isn't a long running application.

More seriously, languages that actually have a premium ultra HDready 4k deluxe nonshit GC application come with some annoying ecosystem. For example, JVM and .Net, end of the list.
>>
>>59261741
>>learn a language that's almost as slow as Python and doesn't even have proper functioning closures just because it's what "professionals" used for a while

Java runs more fucking code in the world than any other language, little child. You want a job and to stop living in your mommy's attic? Install Eclipse and fucking get learning.

Programming languages arent some kind of high art to be enjoyed. They're meant to get things done and ship products.
>>
>>59261776
Not him, I'm not looking to get paid here. I just want a good language to build my application with.

Setting up IDE is trivial too.
>>
>>59261776
>Java runs more fucking code in the world than any other language
[citation needed]

JS probably does. kek
>>
>>59261855
But I thought Javascript is a web form of Java?
>>
File: 1484056017938.png (205KB, 3340x3176px) Image search: [Google]
1484056017938.png
205KB, 3340x3176px
>>59261874
Oh you are right then
>>
>>59257519
Why not Ada SPARK with the Ravenscar profile?
>>
>>59261874
I really should have said ECMAScript instead.

I've been got.
>>
>>59261898
How many cybershekel would Adacore want for it?
>>
>>59261932
It's Free Software.
>>
Should I learn Rust if I despise OOP?
>>
>>59261971
yes
>>
>>59261971
I strongly dislike Rust but at least there's no OOP in it so you can try.
>>
>>59261874
>web form of Java

Oh man, Java applets. They were once the future.
>>
>>59261945
Can I write MIT licensed software with it?
Do I need to write annoying annotations for SPARK to prove?
>>
>>59262008
I think RuneScape 2 was an applet at some point.
Main reason I wanted to learn it desu
>>
>>59257519
>(with all the libraries)?
Literal why. You just need to know the ones that are in the domain you need.

That said, I've seen some D code and it seems quite reasonable as a language. But it also feels a lot like C++/C#.
>>
>>59262466
>But it also feels a lot like C++/C#.
So in other words it's garbage?
>>
>>59262514
>look at my edgy no argument post
I see you
>>
>>59262514
What do you prefer?
>>
>>59261720
The problem with GC is that it doesn't solve memory leaks in all cases but DOES in all cases increase overhead. If you're good enough to design and write software without leaking memory, you don't need it anyway. It's a hacky solution that in many cases works well enough.
>>
Just posting to say that there is no benchmark that shows C++ slower than rust. Every single one that "shows" this just implements an algorithm in a super shit way in c++ and then implements it in the best way possible "oh fuck I spent months optimizing" in D.

D never took off because no one wants to write in D when they can just learn C/C++ and use one hundred billion libraries to do everything for them with a little glue.
>>
>>59262684
>The problem with GC is that it doesn't solve memory leaks in all cases but DOES in all cases increase overhead.
Agreed

>If you're good enough to design and write software without leaking memory, you don't need it anyway
This has proven not be the case for most developers worldwide. Hence the adoption of languages that have GC.
>>
>>59262716
>Just posting to say that there is no benchmark that shows C++ slower than rust.
There is
>Every single one that "shows" this just implements an algorithm in a super shit way in c++
You are free to contribute to the competing C++ code in one of them, and I can tell you you can't be any faster

>no one wants to write in D when they can just learn C/C++ and use one hundred billion libraries to do everything
D provides the best C/C++ library calls there is
>>
>>59262730
Right, without a doubt it has been awful for decades but modern theoretical language features are actually coming about to solve the problem. Rust is the first I know about but whether or not it is a success some future language will succeed using those features because they're actually important.
>>
>>59262716
Adding to >>59262744
https://benchmarksgame.alioth.debian.org/u64q/compare.php?lang=rust&lang2=gpp
>>
>>59262764
All these benchmarks are for short running code and neatly dodge around the GC that exists when you implement something for a massively concurrent multi-user environment.

GC hits are unavoidable at a certain point and absolutely wreck server side performance when they occur.
>>
>>59262810
>GC
what
>>
>>59258343
>>59258452
Jesus fuck, both dmd and ldc are actively being worked on
Also D can interface with C++
>>
>>59262845
D is garbage collected in practice.

GC hits when you have concurrent users quickly become gigantic drains on the system's performance.

Just because you are a retard who writes D without using the GC doesn't mean anything.
>>
>>59262878
You were talking about rust at first here >>59262716
>>
>>59262904
holy fuck I'm drunk.
>>
>>59257519
Yes, use D if you don't mind the GC
People meme about it being ded, even though it is still quite active, moreso than Rust, maybe less than Go
>>
>>59262546
Anything procedural.
>>
>>59260838
https://dlang.org/orgs-using-d.html
Remedy Games is starting to switch over to it
ebay uses it
I'm sad OpenMW didn't continue using it, but nobody would join the project
>>
>>59262955
Imperative-procedural?
>>
>>59262955
Can you not write functional code with Dlang?
>>
>>59263031
I don't know to what extent, but it provides a pure keyword as well as various functions in std.algorithm and std.functional that can be used to write some functional code.
>>
>>59262979
As I said, anything procedural.
>>59263031
Where did I say anything about functional code? It can certainly be non-procedural just like imperative code.
>>
>>59263086
>anything procedural.
Rust is your friend. D as well.
>>
>>59263093
>Rust
Already learning it.
>D
I won't lower myself to the level of using a language which has official support for OOP.
>>
File: 1456043328392.gif (1MB, 303x307px)
1456043328392.gif
1MB, 303x307px
>>59263137
How are you finding Rust so far?
>>
File: 1462713695132.jpg (130KB, 766x864px) Image search: [Google]
1462713695132.jpg
130KB, 766x864px
>>59263208
It's pretty good. I don't know why most people say it has ugly syntax, I like it a lot.
>>
>>59263311
Its syntax is definitely better than what C++ often looks like.
It just has some oddities here and there that seem pointless. Like the exclamation after the name of the function you're calling but before the params.
But I don't know much about it yet.
>>
>>59263476
>he exclamation after the name of the function you're calling
that's actually a macro
macros need ! to be distinguished from functions
>>
>>59263476
>>59263509
It's in D too,
int s = 15;
float t = to!float(s);
>>
>>59263509
>>59263522
huh what.
What's the point of a macro? Just to not have scope and to not have function call overhead?
>>
>>59263522
Different use in D, that's for denoting a type parameter for a function
>>
>>59263522
>>59263582
>>59263597
D uses !( ) for templates instead of < >. They claim its easier to parse.
>>
>>59263582
macros in rust are pretty hardcore, they're handled separately in the AST
>>
>>59261452
>The goal was to just make a better C++ pretty much.
with a gc...
>>
>>59265724
GC is optional
>>
>>59265909
I think you meant to say:
GC is """optional"""
>>
>>59265909
and exceptions in c++ are "optional" too.
>>
>>59257551
L'aide au logement ?
>>
>>59266009
>>59266014
It actually is optional.
Thread posts: 149
Thread images: 14


[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y] [Search | Top | Home]

I'm aware that Imgur.com will stop allowing adult images since 15th of May. I'm taking actions to backup as much data as possible.
Read more on this topic here - https://archived.moe/talk/thread/1694/


If you need a post removed click on it's [Report] button and follow the instruction.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com.
If you like this website please support us by donating with Bitcoins at 16mKtbZiwW52BLkibtCr8jUg2KVUMTxVQ5
All trademarks and copyrights on this page are owned by their respective parties.
Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
This is a 4chan archive - all of the content originated from that site.
This means that RandomArchive shows their content, archived.
If you need information for a Poster - contact them.