What makes a programming language "sticky"? What determines what languages grow and what languages die? According to Chris Hay, it's got nothing to do with how good the language is as a language. He says it depends on 3 things: 1) Raison d'être -- the original reason the language was created, 2) platform, 3) ecosystem.

Warning: Opinions.

"If we take a look at some of the other languages that are not on the list but will appear in some of the other stuff, things like Go which is created by the folks at Google, back in 2007, very similar reasons to Rust. A couple of different paradigms but very similar reasons. They hated C++, they wanted a simpler language, they wanted something that could deal with concurrency, and Go came off the back of that." -- No no no, Go and Rust were not created for similar reasons, not at all.

I actually like that this guy raises the subject of what he calls the "raison d'être". I've alluded to this before: one of my main theories of technology these days is that technologies never forget the reason they were originally invented, no matter how they are bent and twisted afterwards into doing something different. This is a lesson I've learned from PHP and Go and reflecting deeply on why they are the way they are and what they are and are not good for. I've had to use PHP at work for years, introduced Go on some small projects years ago, and only recently got authorization to use Go in the main project, which is otherwise a PHP monolith. The thing about PHP is that, you would think, since it was born as a language for making websites and has been continuously improved ever since, that it would be the best language for making websites... but it isn't. And it turns out to understand why, you have to discard the phrase "making websites" because it is too vague, and instead replace it with "web development" vs "web templating". It turns out PHP was born to do web templating. Go was born to do web development. And the more fundamental point I'm making here is that, when examining a technology's "raison d'être", you have to care about the details -- you have to care about the subtleties. You can't just do as this guy does in the video and read a sentence or two from the original founder(s) and call it a day. That's how you end up saying things like "Go was created for very similar reasons to Rust", which is just flat out wrong.

This is the point where I started banging out a long rant about PHP and Go and in the interest of saving time, I decided to just scratch that and jump straight to the conclusion: PHP was invented for web templating while Go was invented for web development, where we define the distinction as follows: Web development means writing the code for the actual logic of an application -- what data it stores and retrieves and by whom and who is able to access it, what data is moved across the network to and fro other parts of the internet, and what computations are done -- while web templating means the visual appearance of a web application, the "outer skin" -- the choice of fonts, the colors, the spacing and layout, the use of icons, etc. PHP remains to this day the best web templating language in existence and a ton of web templates, if they're not in straight HTML, are in PHP. But you are in for trouble if you try to go beyond templating to implementing the complete logic of your application. (By the way, if you go to the PHP website, it will tell you PHP is a "recursive" acronym (an acronym that contains itself) that stands for "PHP: Hypertext Preprocessor" -- but PHP originally stood for "Personal Home Page" -- much more indicative of its original purpose.)

Go, on the other hand, is the best language in existence for making any program that sits out on a server out on a network somewhere and answers requests from the network, whether they come from an end user, with say a browser or mobile phone, or another computer, such as through an API call. Go was invented to do precisely that (by Google which does a lot of that sort of thing) and this can't be said of any other language that is used to program servers. Java was invented for interactive TV systems, JavaScript was invented so people could add simple scripts to web forms with the Netscape browser, Python was invented to be a shell scripting language that's a "real" language, Ruby was invented to combine object-oriented concepts with Lisp-like functional concepts, and so on.

It might be worth expanding slightly on that list. Most companies using PHP switched to Java after their PHP codebases became unmanageable, most famously Facebook. Java's "write once run anywhere" philosophy was conceived because it was conceived as a language to run on TV set top boxes made by lots of different manufacturers, and given that, it's current use as a language for Android phones, also made by lots of different manufacturers, isn't too far from its original raison d'être -- better than programming servers. JavaScript was put in as a language for web forms, but fortuitously the guy who came up with it based in on Scheme (modified to use curly braces like Java because "Java" was all the rage at the time), which made it a sufficiently powerful language that real, large applications could be built with it. I think the only reason it's ended up on the server is because "front end" programmers who were doing everything in JavaScript on browsers (because they had to) wanted to use the same language on servers to keep their lives simple (even though nobody should ever use JavaScript on servers). Ruby wasn't conceived as a web language at all and only took off with Rails, the web framework (and as noted in the video, has declined as the functionality of Rails has been replicated in all other languages). Python was conceived as a way of writing shell scripts with a "real" programming language, and it's current use as a "glue" language for "gluing together" functionality provided by massive C++ packages like PyTorch is maybe not too dissimilar to the basic idea of a shell scripting language, which is to glue together Unix commands with simple logic.

Anyway, this brings me to Rust. Rust was born at Mozilla by a developer working on the web browser itself who was frustrated by the difficulty of writing C++ code without bugs -- especially the kind of horrid memory-management bugs that are especially hard to track down. I'm going to skip going into detail of the technical features of the language that address this, like I am for all the languages to try to keep this short, but suffice to say Rust has a unique memory-management system that addresses "lifetime management" issues (memory isn't leaked because the programmer forgot to free it, or freed twice, etc) and "concurrency" issues (race conditions, etc), in such a way as to not sacrifice performance compared with C++ (the language the browser was written in) and have deterministic real-time performance -- unlike a garbage-collected language like Go -- in Go's use case the garbage collector is ok because Go programs sit on a server somewhere out on a network and answer requests from the network, and that usually involves allocating some memory to process some data and generate a reply, which all gets freed up when the request is done.

I know I sound like I'm picking on the guy in the video but I've learned these subtitles really matter. He thinks Rust and Go were created for similar reasons, and maybe that's true in some superficial way, but when you look at the details, you realize the reasons for their invention are completely different and you shouldn't use Rust to make a web application that runs on a server and you shouldn't use Go to write a web browser from scratch. (Or a video game engine or anything else that requires high-performance, multithreading, and real-time constraints.) Technologies remember what they were born to do forever.

Maybe his latter two points -- platform and community -- hold greater merit. I don't have much to say about them so I guess I'll just let you watch the video and let his comments on those matters stand.

One of the things he mentions is Python in data science and it's really true, Python really dominates that space. Most of the work is done in Jupyter Notebooks, which are excellent for interacting with data and writing and playing with code to interactively explore data. But this concept was actually pioneered by Mathematica and the Wolfram language. And since this is the Wolfram language's "raison d'être" right from its inception way back in the 80s, you would expect the Wolfram language to dominate this space, but the company charges a lot of money for Mathematica, and kept the Wolfram language proprietary. I haven't used it so I can't say if there's some subtlety that would have kept the Wolfram language from taking over the world of data science had it been open source. Assuming there wasn't any, then Wolfram left the door open for Python to come in a take over.

is Rust and Go the new Ruby and PHP? what makes programming languages sticky and why they die - Chris Hay

#computerscience #programminglanguages