How can we increase adoption of c/c++ alternatives?
-
Continuing the discussion from Spend $1,500 to save $150:
Maybe we should fund a project to make a new programming language that will replace C and C++. We shall call it Stop. (Because it will stop people making classic memory allocation and use-after-free mistakes of course.)
There are already 3 relatively new alternatives to c/c++ that I can think of: D, Rust, and Go. Ada, a much older language is also type-safe and suitable for systems programming. Haskell is not suitable for systems programming, but could be used for application programming. So rather than make yet one more c/c++ replacement that won't be adopted, why not find out why the others aren't used more than they are and fix that?
-
Going up from C/C++ to something less bare metal has two consequences.
- You limit your ability to do certain things, varying by language. Garbage collection being the obvious candidate.
- The less retarded a language is, the greater the likelihood of its adoption by people who shouldn't use it. PHP being the obvious candidate.
Go always struck me as a straight-up NIH language which should never just exist in the first place.
-
Once @ben_lubar wakes up, you're getting play.golang.org snippet that prints out all the reasons you're wrong.
-
Fix Mono and let C# take over.
-
Once @ben_lubar wakes up, you're getting play.golang.org snippet that prints out all the reasons you're wrong.
Unless I'm wrong, and I'm never wrong... @ben_lubar is already awake and plotting how to mentally scar me with just such a thing.
-
Once @ben_lubar wakes up, you're getting play.golang.org snippet that prints out all the reasons you're wrong.
-
You limit your ability to do certain things, varying by language. Garbage collection being the obvious candidate.
Ada doesn't have garbage collection but does support pointers.
@Arantor said:The less retarded a language is, the greater the likelihood of its adoption by people who shouldn't use it. PHP being the obvious candidate.
lolwat? Or did you mean "The more retarded a language is..."? Or "The less of a learning curve the language has..."?
-
http://www.cs.uwm.edu/~cs654/asn/cool-manual.pdf
This language has garbage collection and it only runs on MIPS.
-
No, the less retarded a language is - i.e. the more sane and easy to use it is - the more people will use it, meaning the greater unwashed will jump on it.
Most of the current PHP crowd simply couldn't cope if you threw, say, C at them. But if you had a language that gave them all the power of C with the "ease of use" of PHP... hell will break loose.
-
-
I think we're using different definitions of the word "retarded". You really mean "accessible" or "newbie-friendly". I meant this kind of retarded.
-
+1 etc.
-
Well, yes, but PHP is not nearly as popular is because of its many many flaws. It's popular because it's relatively accessible compared to the competition.
Give them a language as easy to get into, with less flaws, and you have a nightmare on your hands.
-
I will burn for this, but the problem is C++.
More specifically how much C++ is like C (to the point every C program is a valid C++ one).Remove malloc and free from C++ and you're golden.
-
Once @ben_lubar wakes up, you're getting play.golang.org snippet that prints out all the reasons you're wrong.
http://play.golang.org/p/ccx-JDTuQC
+1, was not disappointed.
-
Use Python syntax! You have to manage memory and whitespace.
-
Problem solved. We can all go home now.
-
kinda looks like morse-code-code to me
Filed Under: ...---...
-
++++++++[>+>++>+++>++++>+++++>++++++>+++++++>++++++++>+++++++++>++++++++++>+++++++++++>++++++++++++>+++++++++++++>++++++++++++++>+++++++++++++++>++++++++++++++++<<<<<<<<<<<<<<<<-]>>>>>>>>>>--.++<<<<<<<<<<>>>>>>>>>>>>>>-.+<<<<<<<<<<<<<<>>>>>>>>>>>>>>>----.++++<<<<<<<<<<<<<<<>>>>.<<<<>>>>>>>>>>>>>>++.--<<<<<<<<<<<<<<>>>>>>>>>>>>>---.+++<<<<<<<<<<<<<>>>>>>>>>>>>+.-<<<<<<<<<<<<>>>>>>>>>>>>>>----.++++<<<<<<<<<<<<<<>>>>>>>>>>>>>>----.++++<<<<<<<<<<<<<<>>>>>>>>>>>>>>>+.-<<<<<<<<<<<<<<<.
-
I think what the world needs is Postscript that compiles to js.
-
I think what the world needs is Postscript that compiles to js.
Oh. Ooooh. And you can embed it in a PDF.
-
Well, yes, but PHP is not nearly as popular is because of its many many flaws. It's popular because it's relatively accessible compared to the competition.
Give them a language as easy to get into, with less flaws, and you have a nightmare on your hands.
That's why I advocate banning all programming languages except Haskell and Ada.
-
That's why I advocate banning all programming languages except Haskell and Ada.
You seem to think this will fix things.
Filed under: the world really needs more shitty Haskell and Ada programmers
-
Shitty programmers will lose their patience with Ada pretty quickly and won't be able to get a Haskell program of any size to compile.
EDIT: These are not exactly the most friendly languages.
-
Shitty programmers will lose their patience with Ada pretty quickly and won't be able to get a Haskell program of any size to compile.
Their attempts to complete this will result in the worst code you can imagine.
-
So if you forbid them, someone will just make a compiler to them that removes the need to do it right.
Like the amount of fucktardery that is CoffeeScript or even Iced CoffeeScript which "compile" to JS.
-
So if you forbid them, someone will just make a compiler to them that removes the need to do it right.
So their unmaintainable heaping piles of code will at least be type safe and not have any buffer overflows. That's still an improvement.
-
You don't get buffer overflows in PHP either, so that's already 50% of the way there... really not helping your case here
-
So their unmaintainable heaping piles of code will at least be type safe and not have any buffer overflows. That's still an improvement.
I could see someone creating a snippet to mock VB6's Variant to handle all data types.
-
Proof of concept or it didn't happen.
Filed under: do you even Haskell, bro?
-
http://qt-project.org/doc/qt-4.8/qvariant.html
Well... close.
-
Proof of concept or it didn't happen.
Filed under: do you even Haskell, bro?
Just because we are not (well, I'm not) smart enough to Haskell does not mean we won't see utter bastardisations of it.
If it is even remotely physically possible, someone will do it.
-
How can we increase adoption of c/c++ alternatives?
You'd have to somehow compel c++ programmers to use another language for a while. They'd never consider it unless they has no choice. Once they've done it, they'll never want to go back.
Almost any language could be a C++ killer, so long as you first kill the undying loyalty of Cplusplusers.
-
-
-
And I PHP. What of it?
-
I... whatever is necessary these days.
To the poor soul that inherits some of my code: I'm sorry. I'm so, so sorry. But I had a week and Stack Overflow...
-
You guys are right. I would have to get
unsafeCoerce
taken out of Haskell first.
-
You guys are right. I would have to get
unsafeCoerce
taken out of Haskell first.Presumably by force.
-
Didn't someone here say that "XML is like violence. If it's not working for you, you're not using enough"?
-
Until they find
unsafeCoerce
andunsafePerformIO
. And then we're in a worse spot than just using C in the first place.Edit: Oops. That was covered. I'll think of something witty to place here.
-
Haskell isn't that hard.
The thing about it is that it's very "TIMTOWDI". In fact, I like to compare it to Perl in that regard. There's lots of "syntactic" patterns for doing things. But they all represent the same underlying idea.
If I was helping somebody learn the language, I'd send them to:
- A Gentle Introduction to Haskell : basic language reference
- Learn You a Haskell : Basic usage reference
- What I Wish I Knew When Learning Haskell : Comprehensive ecosystem reference
I learned it from the Gentle Intro and reading libraries to get a grasp on the idioms.
-
More specifically how much C++ is like C (to the point every C program is a valid C++ one).
Not any more; they're diverging. True C programmers think this is a great idea.
-
Go always struck me as a straight-up NIH language which should never just exist in the first place.
The stuff they do with channels is quite interesting. Otherwise, meh.
-
How to increase adoption of c/c++ alternatives?
Stop using C or C++
Pretty simple, really. As @Twatwood shows us, it's perfectly possible to misuse any language you want to the point of being insecure.
-
But... but I like Qt! Sure, it's C++ at it's core, but it barely feels like it.
-
It's not GTK, that should be enough.
-
Strongly disagree. I develop in many languages, choosing the one that will IMPO provide the maximum ROI for the use-case/situation. C/C++ is still a common choice for many projects.
-
There are already 3 relatively new alternatives to c/c++ that I can think of: D, Rust, and Go. Ada, a much older language is also type-safe and suitable for systems programming. Haskell is not suitable for systems programming, but could be used for application programming. So rather than make yet one more c/c++ replacement that won't be adopted, why not find out why the others aren't used more than they are and fix that?
Are any of these alternatives compatible with the vast amount of libraries that are written in C/C++? If you give people some way to interop with them without having to write a DLL wrapper with C functions, it reduces the incentive. Of course, that would require C++ to offer a stable ABI, which while an awesome goal, will likely happen when the pits of Hell open to spit out flying frozen pigs.
You'd have to somehow compel c++ programmers to use another language for a while. They'd never consider it unless they has no choice. Once they've done it, they'll never want to go back.
Almost any language could be a C++ killer, so long as you first kill the undying loyalty of Cplusplusers.
I'm your counterexample. Almost everything I touch at the day job is in C#, and yet I still feel C++ was the correct choice for my main personal project (a fairly non-trivial multiplayer game). If you want to do game programming in not-C++, your options are mainly to bend over and accept Unity (which has already been discussed) or some other vendor lock-in, or pray that someone has an up-to-date wrapper for the engine of your choice.
If you're rendering a web page with data from a database, a few milliseconds here and there are no big deal. If you have to finish computing physics, AI, rendering, netcode, etc. for a non-trivial amount of entities in under 17 milliseconds (to maintain 60 FPS), stack semantics and deterministic destruction start to become a lot more appealing than every object being a heap allocation to be disposed of by some garbage collector that's "smarter than you."
Granted, simple games that don't need to scale aggressively (like platformers, card games, etc.) can get away with looser constraints. On the other hand, try building a craft in Kerbal Space Program with 500+ parts and observe the resulting slideshow.
Remove malloc and free from C++ and you're golden.
Or just don't use them. If you're doing it right, modern C++ should look and feel very much like Java or C#. Actively choosing to write C in C++ is a major WTF.
Fix Mono and let C# take over.
I would be happy to let C# do so when it offers me RAII, deterministic destruction and access to the wealth of C++ game libraries without having to maintain a wrapper for each one.
-
If you have to finish computing physics, AI, rendering, netcode, etc. for a non-trivial amount of entities in under 17 milliseconds (to maintain 60 FPS), stack semantics and deterministic destruction start to become a lot more appealing than every object being a heap allocation to be disposed of by some garbage collector that's "smarter than you."
If either language had sane parallelism or a better memory model, those other two things would be a lot less significant.I would be happy to let C# do so when it offers me RAII, deterministic destruction
You'll switch to c# when they add theusing
statement?access to the wealth of C++ game libraries without having to maintain a wrapper for each one.
Of course, that would require C++ to offer a stable ABI, which while an awesome goal, will likely happen when the pits of Hell open to spit out flying frozen pigs.
In the same post you complain about vendor lock-in.