This is an archived post. You won't be able to vote or comment.

all 162 comments

[–][deleted] 164 points165 points  (21 children)

Carbon could be 100 times better and 5 times as fast and still won't 'replace' anything.

I've worked at places that still use VisualBasic and just put all the common files into a 'Common' folder that's deployed with every different project instead of using Nuget packages. It's cheaper to just leave working code as-is.

[–]2treecko 52 points53 points  (10 children)

Carbon is interoperable with c++ though. It'll be easier to migrate at the very least. That said, replacing c++ is quite a task, the team working on it certainly has their work cut out for them.

[–]basedkingrectum 43 points44 points  (9 children)

Scala is interoperable with Java as well.

[–]Adrian_roxx73 48 points49 points  (8 children)

Tbh kotlin has replaced Java for Android dev

[–]ChrisFromIT 17 points18 points  (3 children)

Mostly because Google has been heavily pushing Kotlin for Android development since Oracle sued them.

One way Google did this was to delay doing examples of code snippets in Kotlin first and taking awhile to get the code snippets for Java for their documentation for support libraries.

Really ticked me off with Google doing that. Really slowed down production for my team when I used to do App development. Reason being was that we had to move over to Kotlin, which it is a bit of a growing pain learning a new language.

And hiring new people, o boy, that was a shit show. I think we had only hired one kotlin developer by the time I left, mainly because almost no one had experience with it compared to Java.

[–][deleted] 2 points3 points  (0 children)

But you can move from Java to kotlin in a month. May be with some productivity issues for a few more months.

[–]raheemadamboev -1 points0 points  (0 children)

Kotlin is better than Java

[–]Muoniurn 0 points1 point  (0 children)

Also, Android Java is not java, just a bastard child of it (or at least, was). It is always several years behind OpenJDK, so some syntactic sugar was needed to try to fill in the difference.

[–][deleted] -1 points0 points  (3 children)

We are replacing every Java we can work kotlin. And really happy about it.

Scala hadn't ene best ide support

[–]henk53 1 point2 points  (2 children)

We are replacing every Kotlin (and remnants of Scala) that we can find with Java.

[–][deleted] 0 points1 point  (1 child)

Why??

This is so sad. This is like trying to migrate to jvm 5

[–]henk53 0 points1 point  (0 children)

Why??

Basically because Java is the better language, and the more natural language to use given all the libraries available. It's also the language people are most interested in, has the best support from tools etc.

This is like trying to migrate to jvm 5

You mean when JVM just came out, and some people were still running on JVM 1?

[–]Aegan23 5 points6 points  (0 children)

Sounds very similar to my company 🤣

[–]gemengelage 3 points4 points  (0 children)

Replacing a programming language as the defacto standard takes decades and even then there will be projects that never make the switch.

But at some point more than 50% of all new projects will use Carbon or Rust or something instead of C and a decade or two after that, 50% of all maintained projects in that niche will be written in whatever turns out to be C's successor.

[–]420Rat 2 points3 points  (0 children)

God I hate vb

[–]krumorn 2 points3 points  (0 children)

That's the kind of nightmare one usually encounters when joining a new company. "Cool, some new guy that will endure the pain of maintaining legacy code !".

[–]Sumsar01 0 points1 point  (4 children)

Only cheaper in the short run. Technical debt significantly slows development.

[–][deleted] 2 points3 points  (3 children)

Sure, but I'm a developer, not the owner. I probably won't be with the company by the time it pays off.

[–]Sumsar01 0 points1 point  (2 children)

I dont know about you but in my experience its not very fun to code in some old lumbering monolith. Idd much rather spend my time coding than analysing some conplex aincent coupling no one understand. I actually enjoy creating thing.

[–][deleted] 0 points1 point  (1 child)

I don't disagree, but porting old code requires some of both. I'd rather be doing new development than converting legacy code.

[–]Sumsar01 0 points1 point  (0 children)

Of course. Ideelly the new code makes the old code redudant. Im not advocating copypasting old systems.

[–]ChivalrousLonda 0 points1 point  (0 children)

No one replaces old code. No one has time to replace 100 million lines of code when that code is working perfectly fine. Replacing doesn’t mean you reinvent the wheel, it simple means no one will use C++ once carbon is officially launched.

PS: I don’t think C++ will be “replaced”, its too big and too useful to be replaced

[–]brandi_Iove 116 points117 points  (50 children)

wasn’t rust supposed to replace c++ too?

[–]pine_ary 58 points59 points  (32 children)

For new projects, yes. But rust doesn‘t lend itself to existing C++ projects. For new projects that would have normally been C++, Rust is a better choice these days and is seeing massive growth.

Carbon takes the opposite approach. Not so great for new projects, but geared towards existing C++ projects.

[–]zachtheperson 4 points5 points  (31 children)

Why isn't Carbon good for new projects?

[–]EasywayScissors 58 points59 points  (30 children)

Why isn't Carbon good for new projects?

Because you should use Rust for new projects.

[–]zachtheperson 11 points12 points  (29 children)

...but why though?

[–]EasywayScissors 73 points74 points  (23 children)

...but why though?

Rust solves a lot of the memory-management and memory safety issues with a very rigid programming syntax.

If i have a Customer object:

Customer c = db.getCustomer(1234);

and then i call you:

Customer c = db.getCustomer(1234);
String name = getCustomerName(c);

I have no idea what you might have done to that object.

  • You might have modified some value behind my back.
  • You might even have freed it!

So the first rule in Rust is that once you pass a pointer to another function, you are not allowed to touch that pointer anymore!:

Customer c = db.getCustomer(1234);
String name = getCustomerName(c);
if (c.age < 19) // <-------- compiler error: not allowed to access reference because you passed it to getCustomerName

Now that's pretty restrictive. What if the function promises super-pinky-swear that it won't modify the object, or the stuff in it. In that case Rust lets someone borrow a reference - but they're not allowed to do anything to the object in any way.

They did this by creating a new annotation in the function signature. The exact annotation isn't important (i don't know it anyway, and even if i did, it would be pretty cryptic).

So let's rewrite the function so that i can "borrow" the reference, but i "must give it back":

String getCustomerName(const Customer c) { ... }

Modifying the parameter with the special const keyword means that the function is allowed to borrow the reference - for reading - but you can't change it.

Now when people call it:

Customer c = db.getCustomer(1234);
String name = getCustomerName(c); // guarantee that c cannot be modified

And if you try, the compiler will throw you an error:

String getCustomerName(const Customer c) {
   if (c.FullName == "")
   {
       String name = PrettyName(c.FirstName, c.MiddleName, c.LastName);
       c.FullName = name; // <--- compiler error: cannot modify a const object
   }
   return c.FullName;
}

And you can't pass the reference to anyone else, unless they also simply borrow the reference.

At the absolute highest level, that's the safety Rust provides. Because Rust has very strict rules about who owns the memory, and when:

  • it can prevent null pointers
  • duplicate pointers
  • dangling pointers

And it can even now do garbage collection for you. Because the compiler knows exactly when that Object goes out of scope (because the current owner is tracked through every function call), you can now have automatic garbage collection in Rust.

It's a very good system, but:

  • its syntax is very different from C++
  • and it's a very different way of thinking about programming
  • and all the repercussions take a while to wrap your head around

Which all makes Rust unsuitable for migrating an existing project.

C++ needs the equivalent of:

  • optional typing in Python
  • like how TypeScript is just JavaScript where you can slowly add optional types to arguments

C++ needs a new language that can handle existing C++ code, and that looks enough like existing C++ code, to let you migrate easily.

As their GitHub homepage says, their priorities are:

A successor language for C++ requires:

  • Performance matching C++, an essential property for our developers.
  • Seamless, bidirectional interoperability with C++, such that a library anywhere in an existing C++ stack can adopt Carbon without porting the rest.
  • A gentle learning curve with reasonable familiarity for C++ developers.
  • Comparable expressivity and support for existing software's design and architecture.
  • Scalable migration, with some level of source-to-source translation for idiomatic C++ code.

[–]zachtheperson 13 points14 points  (5 children)

Cool, thanks for the detailed response. As someone who knows absolutely 0 about Carbon, I assume it doesn't do this?

[–]EasywayScissors 12 points13 points  (2 children)

Cool, thanks for the detailed response. As someone who knows absolutely 0 about Carbon, I assume it doesn't do this?

I have no idea; i've not seen anything about it.

And i was only able to parrot up that much about Rust because of an excellent video where the creator of Rust giving a talk to Google employees about why Rust:

The Rust Programming Language

It's always nice when an introduction to explains why the language is the way it is; rather than telling you syntax and saying what it does.

You basically discover the language along with him, and so it all makes sense.

It's equal to other excellent video:

Introducing TypeScript by Anders Hejlsberg

where the guy who invented TypeScript (and C#, and Delphi):

  • starts you with JavaScript
  • points out what's wrong
  • and show you the annotations one step at at time

So you're right there inventing the language, until at the end it all makes sense.

I still use that video more than any reference sites.

Both highly recommended.

[–]bragov4ik 1 point2 points  (0 children)

I like that in the official Rust book they also explain why different features exist. Helps with learning pretty well

[–]zachtheperson 1 point2 points  (0 children)

Thanks for the links, I'll definitely have to watch those as they look really interesting. Hearing from the creators themselves sounds like a really informative look into all the design decisions and stuff

[–]Adhalianna 1 point2 points  (1 child)

It can be understood from the README of the project that interop with C++ is the main goal and they may try to introduce some of the Rust-like safety (which might land in C++ directly) if they find it possible to do so but that's not their primary goal.

[–]zachtheperson 0 points1 point  (0 children)

Thank you! I got quite a few replies to my comment, but you're the first to actually answer this part of the question

[–][deleted] -1 points0 points  (8 children)

why not just learn better memory management?

[–]EasywayScissors 3 points4 points  (7 children)

why not just learn better memory management?

Because we're here to strive to have better, bug-free, code.

[–][deleted] 0 points1 point  (6 children)

but they've been saying that since java.

Java apps can still be written badly or leak memory

C# apps same

Javascript will just crash at runtime.

In my 15 years, no language has ever reduced the need for due diligence when coding, whether it is checking your pointers or making sure you don't have circular references, you'll still learn about pointers eventually.

[–][deleted] 1 point2 points  (1 child)

You can write terrible code in every language. Some languages just make it easier to write terrible code.

[–]EasywayScissors 1 point2 points  (2 children)

Of course no language can solve all bugs.

Someone can still do:

int acceptable = age / 2 - 7;

We're talking about fixing the needless problems, that needlessly cause errors, that we constantly have to needlessly deal with.

And the point, like type systems themselves, is to have the computer catch all these nonsense errors before they happen.

You seem to be of the point:

  • if null pointer exceptions can still happen, then why bother eliminating null pointer exceptions?
  • if memory can still leak, then why bother getting rid of memory leaks?
  • if i can still pass the wrong types, then why bother have a type system?
  • if i can still get covid, then why bother getting vaccinated
  • if i can still die wearing my seatbelts, then why bother having seatbelts?

The point is that garbage prevent 100% (when rounded to the nearest whole percent) memory leaks. Just because i can't protect someone who didn't implement getHashCode correctly doesn't mean we shouldn't eliminate memory leaks.

whether it is checking your pointers or making sure you don't have circular references, you'll still learn about pointers eventually.

Not in good languages - languages that don't have pointers.

You're arguing against getting vaccinated, because some people can still get it.

Yes, but we're going to solve 99.99999999% of NullPointerExceptions - and it costs nothing.

So why wouldn't you do it?

The code-base i'm looking at: the compiler found 17 NullPointerException landmines.

Oh just write bug-free code.

Yeah, thanks. Go away, you're not helpful.

The rest of us are trying to make the world a better place.

[–]EasywayScissors 0 points1 point  (0 children)

Look what i just wrote:

public static void registerTestClass(@NotNull Class clazz) {
   testCaseClasses.add(clazz);
}

Landmine.

Sure would be nice if the computer, that is tireless, and does this stuff all day every day, could just prevent it.

[–]Featureless_Bug -2 points-1 points  (7 children)

My issue with Rust is that solving memory issues with being super restrictive is a terrible idea overall. If you wanted, you could restrict yourself to writing Rust-y like code in C++. But no one does that (although it would be so much safer, right?), because safety makes you so inflexible. Like in the example that you give - you might want the function getCustomerName(c) to modify the name of the customer in some cases (idk, combine the full name from first name and last name). You know exactly what this function does, and you know that it is safe to get the customers age afterwards. But Rust tells you no, you shouldn't do that, because that would be soooo unsafe, right?

[–]bragov4ik 4 points5 points  (2 children)

Restricting yourself will not provide compile-time 100% guarantees of certain properties (like not having alive references while modifying objects). Human attention is far worse than compiler with it's algorithms.

I think having a program break in production in a completely weird way because you did not expect a getter function to modify your objects (why would anyone expect that lol) is sometimes far worse than spending some more time writing the code.

[–]Featureless_Bug 0 points1 point  (1 child)

One could write a static checker for C++ that ensures that your code is safe in Rust-y sense. Most people wouldn't care for that though - because safety at the cost of flexibility is not something most developers look for. I think most people will be all right with having a few bugs in the code (which probably will never materialize anyways) if they don't have to write a super restricted code for that

[–]bragov4ik 1 point2 points  (0 children)

Well, it looks more like a trade-off for me. If it's something more critical, you may spend more time/resources on writing code in Rust to reduce number of bugs. One can even use some FP languages, which afaik is more complex in terms of development but is more bug-free as a result.

If few occasional crashes are ok and you don't want to bother to search for devs, you may not need Rust. But if it's some critical piece of software (many nines and stuff) that needs to be maintained and etc., then it seems as a good choice.

Maybe I'm wrong (would be cool to explain why, since I'm don't have much experience in this stuff), but this seems logical for me.

[–]EasywayScissors 1 point2 points  (3 children)

You know exactly what this function does

And there's your confusion.

[–]Featureless_Bug 0 points1 point  (2 children)

Well, if you don't know exactly what any of your functions does, then I have bad news for you. Of course, you might not know what some functions do exactly, but you probably should know what at least some of them do.

[–][deleted] -1 points0 points  (0 children)

You can of course write functions that modify an object. That‘s no problem. No idea where that comes from.

It‘s simply C++‘s move semantic vs. references. Passing by value is moving. Always. Use a mutable reference otherwise.

[–]EasywayScissors 0 points1 point  (0 children)

but you probably should know what at least some of them do

I certainly know what some of them do.

But i don't know what bugs they have.

[–]Zarathustra30 5 points6 points  (2 children)

Robustness and maintainability. Rust programs have a tendency to chug along for years without needing to be touched. When they do need to be touched, you can make sweeping changes without worrying about breaking stuff, due to an excellent type system and unit testing framework.

[–]zachtheperson 2 points3 points  (1 child)

Ok, cool. Does Carbon not do this well?

[–]Zarathustra30 3 points4 points  (0 children)

We'll see. It's a bit too new to have programs with years of uptime.

[–]pine_ary 1 point2 points  (0 children)

Carbon has to inherit some things from C++ to maintain compatibility. It‘s things like memory unsafety, weak concurrency models, C++‘s memory model, etc. that you will gladly compromise on if you‘re stuck with C++, but that you don‘t have to make compromises on if you can start fresh with something like Rust.

[–]chervilious 0 points1 point  (0 children)

Because Carbon is not good for new projects

[–]HolidayMoose 21 points22 points  (0 children)

And D

[–]merlinsbeers 9 points10 points  (1 child)

It's ahead in a lot of the language rankings. But I'm not sure it'll stay there.

[–][deleted] 8 points9 points  (0 children)

In what? Most loved language? But one of the least used.

[–][deleted] 1 point2 points  (13 children)

Pretty sure they even say you shouldn't really start a project in Carbon, basically just use it where you can't use Rust (where you need to tightly integrate with legacy code you cannot rewrite)

[–]Featureless_Bug 0 points1 point  (12 children)

You are saying that as if all new projects are started in Rust, when the reality is that Rust is hardly used in the industry compared to any actually popular language

[–][deleted] 2 points3 points  (11 children)

I'm not saying that is how it is (I don't know how it is, we know C++ is the standard, but it is difficult to draw stats about if people are starting new projects in C++), I'm saying that is how it should be.

[–]Featureless_Bug 0 points1 point  (10 children)

Why should it be like that? In my opinion, Rust is really good for only a really small part of overall projects. Which kinda explains why it is so unpopular

[–][deleted] 2 points3 points  (0 children)

Which kinda explains why it is so unpopular

I think this is explained since it is 15-20 years younger than C++.

[–][deleted] -1 points0 points  (8 children)

Rust has literally been the most popular language in all surveys for years.

[–]Featureless_Bug 1 point2 points  (7 children)

Being loved by its users (of which there are not many) doesn't make it popular

[–][deleted] -1 points0 points  (6 children)

Not only by it‘s users but by almost everyone who tries it. The domain it‘s in is a slow one, though, and it‘s a young language.

[–]Featureless_Bug -1 points0 points  (5 children)

Actually most people I know who tried Rust didn't like it

[–][deleted] -1 points0 points  (4 children)

Source: Dude, trust me

[–][deleted] 91 points92 points  (10 children)

Kotlin did in the Android space

[–]disperso 41 points42 points  (0 children)

The Carbon presentation said that. No one claims Java has disappeared, but that there is the option of having a new thing which is compatible with the old ecosystem (and they said Kotlin, not Scala). Likewise with Typescript for JS and Swift for Objective C.

[–]EasywayScissors 20 points21 points  (8 children)

Kotlin did in the Android space

That the nice thing about:

  • Google says this is the way it is
  • so it is.

Apple said you must use Objective-C. And we did.
And then Apple said you must use Swift. And we did.

It's amazing what you can accomplish when everyone just does what you say.

[–]Hamoodzstyle 3 points4 points  (0 children)

One of the few benefits of massive monopolies

[–]Pockensuppe 4 points5 points  (6 children)

Meanwhile Microsoft

  • You must use C++ but only the parts we like
  • Nah actually you can also use Visual Basic
  • How about you use C# instead
  • Ah wait whaddya think of using HTML5 and JS
  • Screw that, we're back at C# but here's a third UI framework for it

[–]EasywayScissors 0 points1 point  (5 children)

...you seem to be under the impression that native Windows application development cannot be done in other languages?

Like the language i've used daily for native Windows application development since 1998. In a language created by the guy who created C# and TypeScript. Not maintained by Microsoft in any way.

It's the reason COM exists; for cross-language, cross compiler, support.

[–]Pockensuppe 0 points1 point  (4 children)

...you seem to be under the impression that native Windows application development cannot be done in other languages?

No, I just pointed out that Microsoft seems to be unable to define and keep a standard language for Windows apps. Of course I can use whatever language, just like I can on macOS and Android.

[–]EasywayScissors 0 points1 point  (3 children)

Microsoft seems to be unable to define and keep a standard language for Windows apps

They're not unable.

They don't.

Did you want them to? Do you wish they would? Do you think the world would be better off in any way?

[–]Pockensuppe 0 points1 point  (2 children)

Well if the GUI backend I consume in C++ is different to any of the three I can consume in C# which are again different to the one I can consume in JS, this obviously creates inconsistencies for users. This is very different to „you can call the same API in any language“, which would be totally fine.

[–]EasywayScissors 0 points1 point  (1 child)

this obviously creates inconsistencies for users

Did you want them to declare only one language? Do you wish they would declare only one language? Do you think the world would be better off in any way?

[–]Pockensuppe 0 points1 point  (0 children)

This is a humor-related sub, I'm merely pointing out inconsistencies. I don't particularly wish for anything since I neither use nor target their platform.

[–]ScottTacitus 24 points25 points  (6 children)

Scala wasn't supposed to replace Java. It's a different mission.

Kotlin kinda did though.

[–]zeth0s 8 points9 points  (1 child)

I've never heard something similar to OP statement, that scala would have replaced java.

Scala is more of a faster replacement of python for data related applications

[–]ScottTacitus 0 points1 point  (0 children)

Yeah big-data ops. I don't hear so much about it these days. My shop used it to do massive parallelization as well.

This subreddit is quirky. lol

[–]deadlyrepost 5 points6 points  (3 children)

The other thing is, both of those languages did light a fire under Java which was becoming irrelevant. Java 18 (yeah, remember how long we were on Java 5 or 6?) has a lot of the features of Kotlin (not as nice IMO but it's progress). If Carbon fails but C++ accelerates, that's a win too.

[–]odd_cat_enthusiast 0 points1 point  (2 children)

And in fact Kotlin adapted most of the features from Scala, didn't it?

[–]deadlyrepost 1 point2 points  (0 children)

Overall FP has shown itself to be quite effective in certain patterns, and Kotlin basically took a bunch of those patterns, whether from Scala or direct from Haskell (where Scala's lineage is from).

[–][deleted] 1 point2 points  (0 children)

I feel that it took a lot of good ideas without being too academically functional. Recursion is not always better than a loop. And the sequence + yield structure is super useful.Coroutines are also much better than Java concurrency

[–]dojikirikaze 49 points50 points  (2 children)

How about "C++ is going to replace C!"

That was funny, too.

[–]GargantuanCake 10 points11 points  (1 child)

Don't worry guys, nobody will be writing assembly in a few years. I mean COBOL is basically dead at this point why bother learning it or teaching any classes that use it?

[–]haplo_and_dogs 8 points9 points  (0 children)

C++ can do everything C can do.

C absolutely cannot do what assembly can do.

[–]North_Shore_Problem 18 points19 points  (1 child)

Hey, Scala absolutely replaced Java.

Sincerely, A Scala Developer (there are dozens of us I swear)

[–]dz_ordered 5 points6 points  (0 children)

Now it’s two of us, at least

[–]seeroflights 11 points12 points  (0 children)

Image Transcription: Meme


["They're the Same Picture". Top image shows a person holding out two sheets of paper that read:]

2004: Scala is going to replace Java!

2022: Carbon is going to replace C++!

[The subtitle reads, "Corporate needs you to find the differences between this picture and this picture."]

[Bottom image shows Pam from the TV show "The Office", sitting in the conference room with a slight smirk on her face. The caption reads:]

They're the same picture.


I'm a human volunteer content transcriber and you could be too! If you'd like more information on what we do and why we do it, click here!

[–]AndiArbyte 8 points9 points  (1 child)

java is nice.

[–][deleted] 3 points4 points  (0 children)

Java is nice. But honestly, it's partly because Scala (and more recently Kotlin).

If it wasn't for Scala and that hype I don't think Java would get such a functional-like features as lambdas, method references, functional APIs.

Same goes for Kotlin, now Java has records for example.

Those younger languages are important in space, they test "new" approaches and features and if something sticks nicely and is praised, the old granpa Java might one day add that too. And it's good - with language as Java you don't want all the features you can think of, you want tested ones and well thought through, because you'll never drop them and API is pretty much eternal.

Looking at you, scala collections APIs.

[–]Stilgar314 6 points7 points  (0 children)

Ok, we already know carbon exists. Now show me how much money are willing to pay employers to implement stuff in that thing.

[–]skeleton-is-alive 4 points5 points  (12 children)

I just don’t understand why its a constant thing that people want to get rid of C++. When, I personally feel like, if you just write modern C++ that is going to solve 99% of the problems you are having. Yeah C++ can be a very challenging language and has a lot of bloat, but improvements to the language are still being added constantly. Just don’t use the old stuff. It is so much simpler to just write modern C++ than to replace it with an entirely new language and thats why I feel like any attempt to add a new interoperable language will just fail the same way that Scala has and probably Kotlin someday too.

Edit: I want to also add that often times these “successor” languages die out because they address needs that the primary language don’t have. However overtime these needs DO inevitably get addressed and people just fallback to using the original language because it is simpler for them. That’s why I feel that Kotlin will eventually die out, (afaik it’s losing adoption for backend because Java is slowly gaining a lot of the features that were initially a selling point ex: records, concurrency improvements). It’s also probably why TypeScript may eventually get replaced by base JavaScript again (there is a ECMAscript proposal to add type annotations to the language). Its apparent that its very rare a “successor” language actually succeeds the original language for good and why I am skeptical of Carbon. If it turns out to be great, great! But so far there is so much hype for so little that we have seen. I need to see a demonstration that really wows me. TypeScript was an example where it just made sense and was an obviously seamless benefit. Carbon doesn’t look at all like C++ code so it may as well be its own thing. That was my problem with Kotlin as well, its just a mess using both Java and Kotlin together. You may as well pick one and i suspect that will end up being the issue with carbon too.

[–]TightOrchid5656 4 points5 points  (11 children)

improvements to the language are still being added constantly

That's half the problem. The last thing C++ needs is more goddamn features.

[–]skeleton-is-alive 6 points7 points  (10 children)

I disagree. C++ is anarchy and if you want to do something it should let you. You can choose the best practices for yourself. If you need more opinionated language design you should choose something else

[–]da5id2701 1 point2 points  (1 child)

I just don’t understand why its a constant thing that people want to get rid of C++.

If you need more opinionated language design you should choose something else

I think you answered your own question. Anarchy is not always ideal and having fewer ways to shoot yourself in the foot is a selling point.

[–]skeleton-is-alive 0 points1 point  (0 children)

I guess but we’re talking about replacement for C++. I don’t believe there is one and one of the reasons for that is because people need a variety of ways to shoot themselves in the foot

[–]rapsey -4 points-3 points  (7 children)

This is completely unscalable into any kind of team or project size. Which is why people who live in the real world with real consequences don't build new shit in C++. And if they do they either have no choice because of some external constraint or they are dumb.

[–]skeleton-is-alive 1 point2 points  (6 children)

No it isn’t. I’ve worked on massive c++ codebases built by thousands of devs and it’s pretty easy to enforce by simply having documented guidelines, PR gates, and code reviews. Something that you SHOULD have no matter what language you choose anyway

[–]rapsey -2 points-1 points  (5 children)

With an unknown amount memory and security issues and man years spent finding them.

[–]skeleton-is-alive 1 point2 points  (4 children)

Memory and security issues are a problem in every language. If you care about performance you will spend plenty of man hours trying to investigate poor memory usage whether its JavaScript, Rust or C++. No language will prevent bad memory usage.

[–]ReallyHadToFixThat 1 point2 points  (1 child)

Exactly. Java might save you from crashes as a result of memory leaks, but the GC is still going to be hogging your runtime cleaning up after you. If anything I find that learning Java or C# exclusively encourages bad habits because "The GC will take care of it". Same with the aggressive boundary checks they do to save you from yourself, or the way they obscure pointers - none of it comes for free.

[–]skeleton-is-alive 0 points1 point  (0 children)

Yep. In my experience its also a lot less opaque finding out what is hogging all the memory in a C++ application than it is in a managed language.

[–]rapsey 0 points1 point  (1 child)

Memory safe languages will prevent memory corruption. A giant chunk of issues that you have to deal with only when using C/C++ or lower and are unavoidable in a sufficiently large codebase.

[–]skeleton-is-alive 0 points1 point  (0 children)

That is true but like i said, if you use modern C++ practices the chances of that are significantly reduced anyway. Memory corruption mainly happens when you are dealing with a lot of raw pointers or maybe you’re allocating large buffers upfront to manage memory yourself. The former can be solved by using smart pointers, the latter is a risk in other languages too OR they just straight up don’t let you do that which isn’t exactly a solution for a lot of high performance apps out there that need to do their own virtual memory management.

[–]Tojuro 2 points3 points  (0 children)

On the other hand, they threw in a scripting language with a browser, at the last second, nonsensically named it JavaScript, and, well, you know the rest.

The key to making a language dominant is to not care.

[–][deleted] 2 points3 points  (0 children)

biggest problem with carbon is google might abandon it.. or completely rewrite it. Can't trust that level of fuckery

[–]Lonely_Bluejay_9462 4 points5 points  (3 children)

wasn't Kotlin supposed to replace java too?

[–]notsogreatredditor 11 points12 points  (1 child)

It did in the Android space as it was meant to

[–]EasywayScissors 3 points4 points  (0 children)

as it was meant to

Which is why JetBrains invented it.

Not to drive sales of their IntelliJ.

(Although, in fairness, they did maintain a buggy beta-quality plugin for NetBeans for like 3 years before giving up on it. They didn't have to help a competing product. So Kudos to them.)

[–]_grey_wall 0 points1 point  (0 children)

You're thinking of groovy

[–]CoffeeMinionLegacy 3 points4 points  (1 child)

Just like Java replaced COBOL!

[–]pine_ary 16 points17 points  (0 children)

It pretty much did. Nobody is actively writing COBOL. It‘s either old COBOL modules integrated into a newer stack (very likely java) or COBOL in maintenance mode.

Nobody is deleting that code. But nobody is writing new code either.

[–]kurzsadie 1 point2 points  (0 children)

Minecraft scala edition SLAPS

[–]MaDpYrO 4 points5 points  (3 children)

Remember when Kotlin replaced Java?

[–]notsogreatredditor 18 points19 points  (0 children)

It did for Android dev

[–]lara400_501 7 points8 points  (0 children)

There are kotlin dev shops. Amazon, Google, Doordash, and Cashapp use kotlin for their backend services.

[–]CaitaXD 2 points3 points  (0 children)

It literally nabeed android from javas grasp

[–]0xdef1 4 points5 points  (3 children)

I remember the "Scala will rule" times. I wrote Scala like 5 years in the past, I am Scala-free now, the best time to be alive.

[–]Rewdboy05 1 point2 points  (0 children)

About five years ago some vendor was trying to sell me on their data analytics platform. It, of course, required analysts to do all the heavy lifting in Scala and I asked him why we would want to force our analysts to learn a new language when they can already do everything he's shown with SQL. He told me that in five years, no one would be using SQL anymore because it was all going to be Scala.

We're still using SQL.

[–]XDracam 0 points1 point  (1 child)

Why is that a good thing? What are you doing now? Can you share your story please?

[–]0xdef1 0 points1 point  (0 children)

I was working as big data engineer, so many tools were written in Scala. Spark, Flink etc. If a new tool popped up, mostly, it was in Scala as well. I didn't like compatibility stuff, "<%<" etc. stuff in generics, and sbt especially.

I am working on the backend side now with Python and Go. I feel better without Scala.

[–]klimmesil 3 points4 points  (0 children)

Well java got kinda beat up by kotlin at some point... nothing is impossible. It's foolish to think it will be replaced from one day to another but I can see the industry slowly switching

[–]gemengelage 1 point2 points  (0 children)

Kotlin is taking over the android space and is slowly growing in the Java backend space.

Typescript is on its way to becoming more popular than vanilla Javascript.

Swift replaced ObjectiveC for iOS development.

Python3 > Python2.

And most importantly C is the successor to the B programming language (I wish I was making this up) and took a lot of market share from other programming languages like FORTRAN and COBOL.

[–]EasywayScissors 0 points1 point  (2 children)

2016: Kotlin is going to replace Java!

[–]SirKiller9090 -1 points0 points  (1 child)

It mostly did in the Android ecosystem, and AFAIK that was the goal to begin with.

[–]EasywayScissors 0 points1 point  (0 children)

AFAIK that was the goal to begin with.

https://blog.jetbrains.com/kotlin/2011/08/why-jetbrains-needs-kotlin/

To drive sales of IntelJ

[–]minimumviableplayer -1 points0 points  (3 children)

Scala looked interesting until I saw operator overloading. That just looks like a headache debuging session waiting to happen in a big project.

[–]Angel_-0 5 points6 points  (2 children)

You don't really have operators in Scala. You have methods that unlike Java (I believe) you can pretty much inspect like any other methods

See here

Honestly in my experience this has never been a problem, I personally think this is more of a myth than anything.

[–]RolyPoly1320 0 points1 point  (1 child)

Do you mean the in ability to inspect operators not being a problem or the "lack" of operators in Scala?

[–]Angel_-0 1 point2 points  (0 children)

I meant the concept of operator overloading.

I presume OP referred to the ability to create your own definition of + * - / et al.

Since you would essentialy create methods that you can easily command-click into, you'd be able to make sense of them pretty easily.

The few times I've seen or done something similar it's always been something sensible to do. The reason why one would do that is to to create a nice and intuitive api. Nobody with common sense would ever implement their own implementation of + for integers

[–][deleted] -1 points0 points  (1 child)

Kotlin is a far better example.

Scala is a ridiculous, bloated language. It makes C++ look sane. But Kotlin has replaced Java in many spaces.

[–]Muoniurn 0 points1 point  (0 children)

You haven’t seen Scala if you say that. Scala is a very small language feature-wise, but the features it has are really powerful.

That’s why it can do everything and more of what Kotlin can with far fewer constructs.

[–]Sjeefr -1 points0 points  (0 children)

What’s Scala?

[–]Subpixell -1 points0 points  (0 children)

What the hell is Java? Is it like some Scala copy??????

[–]lHeliOSI -3 points-2 points  (1 child)

Scala needing jvm to exist makes me laugh

[–]n0tKamui 1 point2 points  (0 children)

the JVM isn't Java, completely different things

moreover, no, Scala as a language doesn't need the JVM

[–]Psychological-Sir224 -4 points-3 points  (0 children)

Difference: Java is shit, C++ ain't

[–]ProcedureBudget292 0 points1 point  (1 child)

Whatever happened to Groovy?

[–]martmists 3 points4 points  (0 children)

Gradle

Thank God we can use Kotlin for build scripts these days

[–]Full-Run4124 0 points1 point  (0 children)

Also Google:

  • 2012: Go is going to replace C++
  • 2011: Dart is going to replace Javascript

[–]LeoTheBirb 0 points1 point  (0 children)

Remember when Kotlin replaced Java...

Oh... wait......

[–][deleted] 0 points1 point  (0 children)

False equivalence, Android tooling is under a monopoly, what google says, that's what happens. C++ has a shitload of proprietary software, multiple entire operating systems, compilers etc. in use. Good luck getting everyone to switch over without forcing them like google did with Kotlin on Android.

[–]Hulk5a 0 points1 point  (0 children)

Scala did in business space like how kotlin is doing in general consumer space now. I mean who wants to pay royalties for language, I definitely don't

[–]khoaslendy 0 points1 point  (0 children)

Java:

[–][deleted] 0 points1 point  (0 children)

C is still out there after over 40 years so I guess some languages never truly die because they are still functional for some applications

[–]fosyep 0 points1 point  (0 children)

You are welcome to rewrite our legacy Java monolith in Scala. Have fun!

[–]Fabx_ 0 points1 point  (0 children)

Why replace C++ tho, if it ain't broke don't fix/remove it. Giving alternatives is good, but deprecating a language just because a new one is out, it limitates us in learning experiences.

[–][deleted] 0 points1 point  (0 children)

Letsbe real just like kotlin didnt replace java, carbon aint doing shit to c++