What language is the best substitute for C++?

What language is the best substitute for C++?

>Rust
>D

I want something as powerful as C++ without having to learn a bunch of shit.

>I'm coming from Java

Other urls found in this thread:

botbot.me/mozilla/rust-gamedev/2016-04-03/?msg=63428185&page=3
dpaste.dzfl.pl/76f8e6cd207f
dpaste.dzfl.pl/6e43091ff55c
dpaste.dzfl.pl/85d691d8c651
twitter.com/SFWRedditImages

C

C++.
It's not hard if you use a sane framework like qt.

what is the purpouse? Web service? Some embedded shit?

Take a look at golang. It's not completely OO but you can work with it. It's currently a meme language but it's hella popular and it is taking off like crazy. Syntax is similar to the C/Java paradigm

If you follow the Rust way you _will_ learn new things or die cursing the borrow checker.
The path is narrow, but it will lead you to destination.

Go's syntax is Oberon-2 (descendant of Pascal) with some of the more verbose keywords shortened. The only thing C like about it is the curly braces.

Programming in it *feels* like Oberon too, very unlike C or C++ which probably explains why it's gotten little traction in those camps.

>Rust
Only if you like SJW's. Rust is cancer incarnate.

>without having to learn a bunch of shit
Only C/C++ then

>taking off like crazy
Thats what I thought when I wrote a bunch of shit on it 6 years ago.

D has a required garbage collector, so it's not comparable to C++.

You can disable it with a `nogc` annotation but then it infects everything like the `pure` annotation does, and then you can't use any library ever made, and can't use most parts othe stdlib.

I'm personally betting on Rust.

There may be some SJWs, but most Rust people just ignore them.

Personally I had an argument against an SJW retard because another guy clearly from Sup Forums used the word "fag".

So the guy started arguing with the SJW, I started bringing linguistical arguments and inapplicability of the code of conduct in the channel in which the discussion was taking place, because the SJW had requested the guy to be banned.

Long story short, he was banned because he was nobody, I wasn't because I made and maintain a dozen crates.

Just don't go there to stir shit up, or make a name for yourself before stirring shit up and you'll be fine.

From a PLT point of view Rust is glorious.

I need dem logs.

They're publically logged I think, but I'm not going to disclose who I am on here, if you want to search for it you can find it, good luck.

>Rust

SJW cuck language

botbot.me/mozilla/rust-gamedev/2016-04-03/?msg=63428185&page=3

pretty boring desu

Golang is SJW infested too.

And it's not like you're not a known Sup Forums shitposter.

Of course, what did you expect?

That's totally not me!

>What language is the best substitute for C++
>I'm coming from Java

D has full Java-style OOP, so you may want to start with that and move on to Rust if you find that you don't like D.

Also depends on whether you want an SJW-cuck language (Rust) or an anti-SJW language (D).

Python running on PyPy

Good stuff.

>What language is the best substitute for C++?
C++11.

>garbage collection

>Not C++17

>It can be disabled, there are many other techniques that use stack allocation or allocators instead, and you can annotate your code to statically ensure that no GC allocations will happen.

Does it have good type inference?

>I want something powerful
>without learning
Go home pajeet

>thus making most libraries useless

Don't worry. I'm developing a new language right now that will solve your problems. It'll be ready in a year.

The saviour has spoken!!!

Depends on what you mean by good. It's not Haskell-level where you don't have to write any types at all and the compiler magically figures it out.

Here is an implementation of the Shunting Yard algorithm:
dpaste.dzfl.pl/76f8e6cd207f

Project Euler Longest Collatz Sequence problem:
dpaste.dzfl.pl/6e43091ff55c

A little more "functional" style, finding the sum of the digits in 2^1000:
dpaste.dzfl.pl/85d691d8c651

I don't claim to be a good programmer. This is just an idea of what D looks like in practice.

Actually I lied. It will only solve my problems.

C-style languages really need to die. Just look at that fucking ugly way to declare a tuple.

It's specific to D, not because it's a C-based language. The community for a long time has wanted built-in tuples to be beautiful and usable, like in Python:

(int, double) getPair()
{
return (0, 0.0);
}

(i, d) = getPair();

assert(i == 0 && d == 0.0);


There was a proposal a few years ago to add syntax like this but it has been in limbo for a long time and nobody's had the desire to try and push it through.

Is that so. I can only imagine how the parser for that must look like. A parser for a Rust-like language is very easy to write with at most one token lookahead necessary.

D's grammar is context-free but I believe it requires unlimited lookahead due to constructs like:

auto array = [0, 1, 2];
auto arraySlice = array[1..2]; //Slice syntax requires unlimited lookahead


But I'm not very familiar with the specifics. It's more or less similar to Rust's syntax with a few key differences.

One of the differences is the proposed syntax for tuple destructuring. Since it's not clear if `(` starts simply an expression in parenthesis or a tuple pattern you already need infinite lookahead when a line starts with `(`.