5 ms·
I can't wait for the time when we will use C++ in the browser and JS on the backend. Oh the irony.
by adamnemecek 14y ago
I can't wait for the time when we will use C++ in the browser and JS on the backend. Oh the irony.
- derefr 14y agoTurns out we need performance on the front-end, and ease-of-development on the backend, not the other way 'round. Really, though, the strong motivating consideration is that while backend code scales horizontally (i.e. you can throw money at an app and get more concurrency), the user only has one computer, so you have to optimize frontend code for performance. If we could just pay money to make users' computers faster I guarantee we wouldn't be worrying about browser JITs. :)
- adamnemecek 14y agoI mean, I understand the reasons and more than anything I'm excited. But it's still one of the things that if you time traveled to the 90's and told some developers about the future, they'd lock you up in a mental asylum.
- arthurrr 14y agoIf you traveled back to the 90's, it would be a good fictional story about computing dystopia. In fact, it is still a good story about computing dystopia. But it's no longer fiction.
- ErikCorry 14y agoActually if you are using C++ on the server there would be an argument for using it in a sandbox like NaCl. After all, you don't want to get pwned on the server any more than the user wants to get pwned by a web game.
- PommeDeTerre 14y agoC and C++ are already being heavily used on basically all servers. Linux, the BSDs, the various commercial UNIX systems, OS X, and Windows all make very heavy use of C, and also C++ in some cases. Apache, nginx, lighttpd, and many other web servers are written in C or C++. The same goes for the major database systems commonly used today. The main interpreters for languages like PHP, Python, Perl, and Ruby are written in C. Even if you're using a Java implementation of those languages, or some other language that targets the JVM, the runtime you're using is most likely written using C and C++. So I find it kind of silly to hear Ruby and PHP advocates say how it's "dangerous" to use C or C++ for server-side development. Their preferred stacks are already essentially all C and C++! The amount of C and C++ code powering their applications dwarfs the amount of Ruby or PHP code they might have written.
- jeremyjh 14y agoWell, it would be dangerous to let those developers write application code in C++.
- PommeDeTerre 14y agoTrue, but the other languages don't necessarily help with that, either. PHP doesn't prevent programmers from writing code susceptible to SQL injection attacks. Ruby doesn't prevent programmers from writing poorly-performing web apps that are brought down or rendered unusable with a even minimal level of traffic. It's dangerous to let those kind of developers write any code.
- eru 14y agoYou can make C safe, it just takes lots of effort, as you see in the software you mentioned. Other languages may require less effort to write safe programmes in.