That doesn't seem right. There are plenty of languages that are born from platforms, but I'm skeptical that its anywhere near the majority. Some platformless examples from the top of my head
- Java
- Rust
- Python
- C++
- Go
- Lua
In my opinion: C is not popular because of Unix. Unix is popular because it's written in C. The same is arguably true of Kubernetes. Neither docker nor k8s drove mainstream adoption of Go. Go did that with it's own properties, the same is true of Rust and C etc.
> Functional programming is less popular because no major successful platform has adopted a functional language as the preferred language.
The question here though is why?
The author argues because FP is unwieldy for the general software case (which I assume is enterprise CRUD apps). And I have to agree: State management is a huge part of CRUD apps.
------
EDIT: I am not presuming K8s is popular because of Go. The argument here is the success of the platform and choice of language are related, not directly consequential. K8s could have been written in rust and would probably be as popular because of its feature set
C++ was the easiest way to write kinda-OO code and use C libraries. Then it became de-facto standard for gamedev and desktop app programming.
In Linux world it's still the case that if you want to write a desktop app you should write it in C/C++. Use any other language and you will struggle against the dependency management and package managers forever.
Python is the only clear example of succeeding without a platform out of these languages, and the fact that after decades still Python is less popular than PHP shows that historic accidents and having a good platform is more important than any quality of the language.
On the other hand Perl is dead so maybe it's not as bad :)
This may be because Python lends itself to bring used in integrated environments such as Jupyter.
That's not how it got its popularity. Applets died very soon (the novelty lasted like 1-2 years), and feature-phone apps were never a big thing. Unlike e.g. mobile apps that quickly overtook the desktop, feature-phone J2ME apps at the time were a peanuts business (and there were other ways, like native APIs from Palm, Blackerry, and Windows mobile edition - of yore, not their post-iPhone smartphone OS).
Java, even back in 2000, was big in the enterprise space and remained so (which is why Sun quickly emphasized that and let the applet sdk languish).
I do agree in a very general sense, but there are definitely a few good options or there for desktop software.
For example, Lazarus/FreePascal is one of the best solutions for writing GUI apps even nowadays. It's a shame that it's dead as far as market share is concerned, even if it has a community around it, is open source and still receives regular updates with pretty good platform support.
Though i guess you could say the same about any technology stack that produces executables that are for the most part statically linked and don't complicate dependency management.
Of course, Java with Swing also hasn't disappeared anywhere and is still perfectly capable of producing most desktop software as long as there is any sort of a JDK or JRE on the device. There's also JavaFX/OpenJFX which is supposed to be more modern, but I've experienced more issues with it in comparison to Swing.
I would have avoided python if I could... But I can't avoid numpy/scipy etc etc
RubyGems was the package manager that was really amazing and changed everything IMO. pip didn’t even exist until almost a decade later after that.
[+] to clarify, I was a somewhat experienced programmer, this was one of the final year projects, for distributed systems or parallel computing I believe. A simple system without doubt, but still, a system not a "hello world". Something that I wouldn't have expected to work on first try, had it been written in C.
But of course although it's the default in Java, and not provided out of the box in Python, I also wrote some web framework stuff that adds these runtime errors to Java (by using Reflection to make decisions at runtime instead) and I've seen Python code with more type safety that would tell you earlier that there's a problem. So it's ultimately not only a matter of programming language although that does definitely set the tone.
C++ was the preferred application development language on Windows.
Python is popular because of the numeric and ML ecosystem.
I'm still confused by the cycle of
- You can run Java applets in a web browser!
- Ew. Time to stop doing that.
- I've had a brilliant idea! We need a bytecode-based VM in the browser so a web page can run arbitrary code.
- I'll call it "WebAssembly".
- You can run Java applets in a web browser!
-> Yeah, so? There are all crap, slow to start, big on resource bloat, slow to draw, and don't offer much).
-> Ew. Time to stop doing that.
Then 15+ years passed, during which JS became the dominant way to build CRUD/Enterprise/form-based/and more apps, got big features (from WebRTC to an embedded DB, and from accelerated canvas and 2D graphics to MIDI). And it even hit big on the server too.
Then: - I've had a brilliant idea! We need a bytecode-based VM in the browser so a web page can run arbitrary code.
WebAssembly, is faster than Java Applets was back then, has easier ties to the DOM for UI (as opposed to being a sandbox), can be used to supplement conventionally written web apps, and is not tied to a single company.
So, quite a lot of differences due to time, and also in the characteristics of the technologies involved.
So these comparisons frankly make no sense as every such shortcoming could have been easily fixed in 20 years.
Yes, but it was even more hard to make Java applets run with any acceptable speed in 1997, which is what mattered for their deprecation. Understadingly people didn't just say "let's suffer them for 10 years until the hardware catches up to make them tolerable".
>Also, webassembly still doesn’t have proper bindings to the DOM
Yes, but still better than what applets had :-)
>So these comparisons frankly make no sense as every such shortcoming could have been easily fixed in 20 years.
It would make even less sense for people in 1997-1999 to stick with applets because "such shortcomings will be easily fixed in 20 years". People use what works now, or at least offers a serious advantage despite the shortcomings. Java applets then didn't offer much.
It’s funny because that is essentially what happened. Other than flash (which suffered essentially from the same shortcomings as applets, but at least had a productive environment to create them), there was nothing that replaced these technologies for many years to come. Canvas rendering came much later and only with much more recent browsers did it have acceptable performance. It is not accident that many people long for the old web which was strangely more interactive in some cases than what we have today.
Don’t get me wrong, java applets were shitty. But we sort of threw it all away instead of fixing it, which in hindsight seems to have been an easier road (since the JVM has always been the state of the art runtime, and JS engines had to catch up from zero). DOM integration into an object oriented language would have been much easier than what webassembly does through JS bindings, and lack of security was frankly more of a mindset back then, and the jvm could have been sandboxed just as “easily”* as js engines are.
* it is a hard thing to do, but it happened to JS engines because the money was there. Integrating the JVM with proper sandboxing would have required less money/energy.
That's the big difference.
I think that's backwards. I was there. Aside from a few e.g. banking and government applets one was forced to use and a couple of exceptions, applets never got anywhere and died fast.
Enterprise Java became what Java is all about very very soon. Java landed in 1996. Servlets/Tomcat landed in 1998.
By 2000 there was plenty of enterprise Java development - in fact that was the year MS created its own Java copy, in the form of C#/.NET after having tried to extend their version of Java for the Windows platform.
I don't know any technical details here, but from a user perspective Shockwave did turn into Flash. The Flash file extension "swf" even stands for "ShockWave Flash".
Shockwave was somewhat similar to Flash, but it was developed for the "multimedia" CD-ROM's, which meant the files was generally too big for online. Flash was much more compact which is why it won out.
Flash was originally called FutureSplash, if I recall correctly. When Macromedia bought it they rebranded it to fit their general branding theme, hence the confusion. Flash wasn't really intended to be an app platform, it started out as a vector animation format, but later they added scripting using a dialect of JavaScript called ActionScript.
Most users ended up with the Flash plugin but not the Shockwave plugin. Macromedia Director was huge in its day - my first programming job involved writing Lingo - but it died out pretty quick when the internet started taking off.
So had the renaming taken place now in stead of twenty years ago, it would be called F7lash in stead of just Flash.
From my perspective, Python became popular as the simplest and friendliest general scripting language along the lines of Perl or TCL, and the easiest for somebody familiar with other languages like C or Java to pick up.
If I wanted to do something just a bit too fiddly for a shell script, I'd reach for Python (and still do, although I've recently started using Node too).
Perl initially became popular as the best text-wrangling language for CGI scripts and the like, but (I think) was a bit too weird to be a general-purpose hit for the masses like Python. Likewise Tcl/Tk was great for whipping up quick UIs, but both parts seemed a little too weird to stand on their own.
Ruby was another strong contender; I think Python was already too well-established to be displaced by Ruby, but Ruby found its audience via Rails (which I'm guessing is better than Django).
Hmm, are you sure? I’m not saying you’re wrong, because I’m not sure myself! I heard of Django before I ever heard of Rails but that doesn’t mean much.
Wikipedia suggests they were released at around the same time -- Django started slightly earlier, Rails open sourced earlier.
ColdFusion and JSP and PHP were dominant for a long time before Rails as well.
Hopefully it will start replacing C going forward but in that space Rust is competing with Zig and Nim.
Two languages almost nobody uses. It doesn't seem likely it's actually competing with them in that case.
[1] https://github.com/nim-lang/Nim/wiki/Organizations-using-Nim
I see this point come up often, but it doesn’t really line up with my own experiences. I find the explicit state control in functional languages makes it much easier to write enterprise CRUD.
Had UNIX been written in PL/I, Mesa or BLISS, those languages would be "C" today.
https://en.wikipedia.org/wiki/BLISS
https://www2.cs.arizona.edu/classes/cs520/spring06/bliss.pdf
Like C, isn't it? Assignments return values! Still feels weird AF to those of us who started on BASIC and Pascal.
Go got popular because it was a Google thing and everyone fanboyed hard over that.
But no one else does
On a more serious note. I decided to read Delphi documentation recently because I’m old enough to hear a lot about it, but not quite old enough to write anything in it. It had discriminated unions. It did! I can’t imagine my life without them, I write stuff exclusively in Ocaml-like languages, so the only question that I have in my mind is “how the hell we managed to go backwards?” It’s so weird.
In that way it's like a Delphi for the modern world.
Then AdWords team which had just gone through GWT => Dart rewrite, kind of rescued the project from closing down, after the key designers left.
Finally Flutter team kind of gave a new life to Dart, which made Dart only relevant in the context of Flutter.
Python was taught in many universities for its flat learning curve, then started to be used in academic research.
Even without an unrelated platform, like JS and the browser, they had something to catapult their adoption.
Python was used in academia long before it was used for teaching. “Courting” scientists was done from extremely early on in the language history (matrix-sig was founded in 1995) and the “extended” indexing added at their request (auto-tupling and slicing predate PEPs as those were introduced for and by Python 2).
Brendan Eich advanced a Scheme-like scripting language for Netscape, which got a facelift from Java’s popularity.
“Scheme was the bait I went for in joining Netscape. Previously, at SGI, Nick Thompson had turned me on to SICP.”
“The diktat from upper engineering management was that the language must “look like Java”.“
“I’m happy that I chose Scheme-ish first-class functions”
JS actually made a few functional concepts mainstream, such as first-class and anonymous functions, and callback patterns.
Source: https://brendaneich.com/page/5/
Python - which took perls lunch over a decade or so and now in more recent history became the obvious language when data scientists and ai/ml practitioners needed to adopt a platform. Its popularity has even led to it also expanding into education in a huge way after Python became the most popular scripting language.
Java - the jvm is an utterly amazing piece of engineering and yet still to this day most people still write java instead of the other better languages (kotlin, scala, clojure) hosted on that platform, and they deploy only to Linux environments. The platform with its write once run anywhere and industry leading garbage collector that gets better than 50% memory utilisation, isn’t the thing that attracts people - its the language.
Functional languages used to be the cool thing before object oriented design came along and unlocked the ability to build bigger systems. The ultimate programming language (lisp) has always encourages functional since what, the 60s?
Scala actually became MUCH more popular with Spark. I think the original point stands - the platform pulls the language.
Java is popular due to the jvm - it was the first jvm language after all. It got popular before others like scala & clojure managed to get off the ground, at all.
Python was hugely popular long before these were a thing. It was already seen as one of if not the most beginner friendly language at the beginning of the 2000s. It became the language of choice for ML because it was already popular with beginners not the other way round.
That's not how history played out at all. Java spent much of its life being pitched as a way to make C++ developers more productive.
The jvm was actively hated by many for years - slow startup times, excessive memory usage, it didn't used to enjoy the rich tooling ecosystem it has now and it was seen as opaque and hard to tweak for performance.
To this day it's not that hard to find Java devs who want off the hotspot jvm - whether that's to go onto other JVMs with different tradeoffs (Azul or whatever) or whether to go native compilation (GraalVM) instead.
However all the Java shops I hear about are also looking into Kotlin at some level of adoption. From all the new JVM languages Kotlin integrates the best with the existing Java environment and for displacing a language in an existing niche an easy upgrade path is the most important. So I think Kotlin will become an important language in the JVM ecosystem, it will just take a long time because these types of businesses are conservative in their tech choices.
I fail to think of any other platform that could run these monstrosity CRUD enterprise apps as fast as the JVM can. Sure, C++ can be written to utilize hardware better, but with all the classes and interfaces around with everything being virtual, a good JIT compiler can skip method lookups over AOT compiled languages.
While both of these things are true, they not connected in the way you imply, since Java is a pretty low level language by today's standards.
In the Java school of business app engineering, writing the code is rarely a big part of the effort, so it doesn't matter if the langugae is not very good or expressive. Java wins at having a big commodity-like labour pool of programmers, and there's a lot of inertia and stability in the platform.
There are of course a lot of people who use more expressive and creative tools in making business apps, like eg the many companies using Clojure, Scala, Ruby, Python etc for them, so it's not the only way to skin the cat.
On the JVM it is like trying to replace C on UNIX.
Sure, this is anecdotal. But I'd say the same of Java's dominance in the JVM space. Java's continued dominance is not a sure thing from my vantage point.
Groovy was all the adoption rage across German JUGs back in 2010, then everyone was going to rewrite the JVM in Scala, or was it Clojure?
Now a couple of places are adopting Kotlin outside Android, nice, eventually will migrate back in about 5 years time.
https://trends.google.com/trends/explore?q=%2Fm%2F07sbkfb,%2...
This is less relevant today. The host blessed languages do have an advantage, but I would not say it is insurmountable. It might have been the case in the past, but the modern JVM is a platform, it is no longer a glorified Java language interpreter.
> Now a couple of places are adopting Kotlin outside Android, nice, eventually will migrate back in about 5 years time.
Maybe. Maybe not. Most developers I talked to that have experienced the transition do not want to go back to Java.
This isn't to say Java will die. It will continue to thrive. But Java dominance (on the JVM or as a whole) isn't a sure thing anymore.
https://docs.microsoft.com/en-us/powerquery-m/
In fact, Excel itself can be considered a functional, reactive programming environment, and if we grant that, then it is the most popular programming language on the planet.
If whatever Netscape added as their scripting language had been too weird I think there is a good chance that a competing browser would’ve implemented a less weird language and that such a less weird language would have won over the hypothetical too weird language.
For me, Objective-C is too weird so I never bothered with it but I love Swift and only after Swift came out did I start making apps for iOS. And that’s even though I had been wanting to make mobile apps for iOS for a long time.
Nobody would use a language which wasn't supported by the browser with the largest market share, regardless of the merits of the language.
I would also say it is mainly due to Gmail and their G Maps extensive use of XMLHttpRequest, and Douglas Crockford insight on that JS has closure and function as first class citizen, it is just Scheme is C clothing. Check out his Little Javascripter. That and of course the intro of JSON.
«Insight» is like «RTFM»? :)
That is not an "insight". Anyone who had written an event handler in JavaScript would already know that.
One language where FP basically arrived in the mainstream is by the way Scala. And there are other newer language which allow for FP'ish programming like Kotlin.
But otherwise it's true, languages like Schema or Haskell will probably not arrive in the mainstream soon.
That's true for system and low-level application languages (Javascript is an exception, as for the web platform, there's no alternative so it's used for everything).
Perl, Python, Java didn't become succesful because of platform ties (yes, Java was made by a platform vendor, but most of its programmers used Windows and deployed on Linux or AIX, not Solaris).
WhatsApp backend is written in Erlang. A large part of the world's telecom infra is written in Erlang (2G, 3G, 4G, 5G). It powers the highest availability systems in the world. Still nobody cares about it....
That is a very popular perspective. In the past I have seen this sentiment used heavily by people who hate JavaScript as a means to rationalize how JavaScript could have become popular at all.
Unfortunately this sentiment is disqualified by data.
The browser became a popular platform in the late 90s and early 2000s as business and social interest on the web grew. JavaScript has been around cross-platform in a mostly consistent way since 1998 due to the publication of early current standards.
This did not make JavaScript popular though. JavaScript would not become popular for more than a decade later.
In 2008 a couple of things happened. Chrome launched offering the first JavaScript JIT. Before this JavaScript was hundreds of times slower than it is now. Also, jQuery started gaining popularity at this time which allowed employers to hire any dumbass off the street to write in it. Douglas Crockford also heavily evangelized the language for its expensive capabilities: functions as first class citizens, optional OOP (easily ignored/bypassed), native lexical scope.
A little after that around 2009/2010 Node.js launched and GitHub became common knowledge. It’s about this time that JavaScript exploded in popularity. The web was already popular for more than a decade before this.
> Functional programming is less popular because no major successful platform has adopted a functional language as the preferred language.
I would argue functional programming is incredibly popular but less common in the workplace because OOP conventions are what’s taught at school.
Your comment seems to support, rather than disprove, the claim.
JS was around for years without much success before the browser became a popular platform for applications. People used to only write applications for the server or for platforms like Java and Flash that were just embedded as plugins in the browser. They only started using JS after improvements to browsers made it a better platform than the alternatives.
Really, the reason Chrome invested heavily in optimizing Javascript was because it had started to be widely used in more than trivial scripts.
It would help if someone defined what constitutes "using functional programming".
I mean, this is functional programming:
function add(a, b) { return a + b }
From my experience, every developer does functional programming to a certain extent, it's just the extent that varies.Let’s try rewriting your example this way
add = function(a,b) { + a b }
Why is this better? Because + is a function, and add is an object, so you can then refactor the code to say this
add = +
Try doing that in C.
As I see it the code for some programs has a high degree of symmetry (ie repeated patterns), and the best language is a notation the let’s you capture that the best.
If you find yourself cutting, pasting and modifying things slightly each time, then your language is holding you back.
Test-script code is the best example of this…particularly hardware tests. You have the same code copied and pasted dozens of hundreds of times.
Thoreau once said that government is best that governs least. That language is best that makes you type the least.
Function pointers. They are abused to no avail in C programs. It has the original callback hell, not JS. (And that is mainly because C has no proper way for abstractions)
Your example is strict FP, where a and b are fully evaluated before add() executes. There's also non-strict FP, where everything uses lazy evaluation by default. That has some big advantages but also a few pitfalls, and generally makes things significantly weirder when compared to imperative languages.
Pure FP is where you only have functions and expressions, no variables at all. I think that's where most mainstream programmers draw the line -- sometimes you just want to store something somewhere, without being forced to jump through what seem like weird hoops.
The original elevator pitch for Haskell was that it's a "non-strict, purely functional" language (aimed a unifying a bunch of different research languages, plus the proprietary language Miranda).
I think it rather supports the OPs claim.
I love Python as a language, but realistically it could just as well have been Ruby or some other language.
You're not wrong now, but that's just the chicken, the egg included web applications and its use as a scripting language.
Summer School computing classes even used to teach unit testing in Python.
And the Atlas HLT/DAQ build scripts were based on Python.
Because there was a huge push by the Python designers towards this direction?
They got funds from the DARPA in 1999 for a proposal entitled "Computer Programming for Everybody", the first part of which was " Develop a new computing curriculum suitable for high school and college students".
The Python project did a lot of outreach and marketing specifically targeted at educators to explain why Python was a great teaching language (and did a lot of work to make it so - don't get me wrong). It worked.
Javascript is quite popular as an introductory language too -- students can open up a web browser and type stuff in the console in the middle of a lecture.
Also, Python is used as a scripting language on top of C, and C is popular.
Different domains of education had different reasons but some classes had nothing to do with Matlab.
- The professor Gerry Sussman of the famous MIT 6.001 SICP class said they switched from Scheme to Python because (paraphrasing) it's more high-level with libraries to get immediate work done. (E.g. A class project to control a robot.)
- Peter Norvig teaching Artificial Intelligence classes switched from Lisp to Python because he noticed his students kept getting stuck on Lisp syntax instead of progressing on the more important AI concepts. Switching to Python made teaching the class easier.
One can google for their interviews on why they switched to Python.
REM That is, "goto11"'s sibling comment https://news.ycombinator.com/item?id=28522359
It seems more likely there is a feedback between the popularity of a platform and it's anointed language.
Therefore observing that a language or paradigm is popular or unpopular does not say anything about whether it is good or bad. JavaScript is the most popular language in the world. If Netscape had decided to use a Scheme-like language or a BASIC-like language it would still be the most popular language in the world. So paradigm has nothing to do with it.
Functional programming is less popular because no major successful platform has adopted a functional language as the preferred language.
I don't buy that functional languages are unpopular because they are unintuitive. Losts of stuff in JavaScript is highly unintuitive. It didn't prevent it from becoming the most popular language in the world. People will learn what they need to learn to get the job done.