r/ProgrammingLanguages • 🧿 Pipefish • 4d ago

Origins of programming languages

Pretty much all successful general-purpose programming languages were thought of by someone with a particular use-case in mind, or even just one particular use. They became successful because in trying to do whatever-it-was really well, the authors hit a larger target than they aimed for, and the more successful they became, the more this is true. Some examples, in alphabetical order:

  • C was designed solely to write UNIX in. This is the poster-child for "hit a bigger target than they intended". Besides C's other merits, it came out when (a) fine control over memory and clock was important even if you weren't doing systems programming (b) the users were the sort of l33t geeks who were quite happy to stay up 'til 4 am chugging Mountain Dew and swearing at malloc in exchange for an inner loop that goes brr.

  • The C++ origin story is that Bjarne Stroustrup was trying to model computers interacting in a network, and wrote a beautiful version in Simula which would take a hundred years to yield enough data; followed by an ugly version in C which was performant --- and wished, naturally, for the best of both worlds.

  • Erlang (the surprise sleeper hit of languages, now the basis for Elixir and Gleam) was designed to make Ericsson's telephone exchanges more stable.

  • We all know what JavaScript was designed for. It works for that, and has now been used for everything else. JavaScript is something of a special case of course, because of its association with web-browsers, but we should consider that for example Java applets failed at the same task, along with ActionScript, VBScript, JScript, Silverlight and NaCl.

  • Fortran was invented to do big math and science fast. Fortran would be supplanted by later languages (C, obviously) for everything but its core competence, but before then it was used for the first adventure game, for payroll software, chess engines, CAD, mainframe utilities, and self-hosting compilers.

  • Go has not unkindly been called "a DSL for writing servers".

  • Haskell was invented as a platform for mathematicians to experiment with lazy functional languages, which explains pretty much everything about it.

  • Lisp was invented after John McCarthy had been working for IBM on an extension of Fortran for list processing. The people at IBM were very happy with his work; he was frustrated. What he wanted, very reasonably, was to be able to automatically differentiate a function and then evaluate it, which sounds like exactly the sort of thing computers should be making easy for us. Fortran made it impossible despite its math orientation and despite the fact that McCarthy had been hired to write his own extensions to the language. The path to Lisp's homoiconicity is obvious; only slightly less obvious is why he reinvented flow-of-control as expressions. (Hint: think of differentiating a function defined by cases.)

  • Julia was made for math people to do math things in.

  • Lua was designed to solve the needs of scientists and engineers in Brazil's fossil fuel industry. (It became wedded to the games industry when someone at LucasFilms Games read about it in Dr Dobb's Journal and realized it was better than what they'd done in-house.)

  • ML was invented as the meta-language for a theorem-prover and people who used it spontaneously demanded the language without the theorem prover.

  • PHP, despite being objectively terrible, and coming from (and being aimed at) a dysfunctional "worse is better" culture, managed to spread like wildfire or a plague of poorly-designed locusts because its initials stood for Personal Home Page: it knew exactly what it was for.

  • Python was created because Guido van Rossum realized that a dynamic language with powers to do OS-level things could make his life much simpler: "I thought, well, oh man, if we just could program ABC instead of C, each of those utilities would be like half a page of code and I could write the entire suite of utilities in a couple of weeks instead of the years that it looked like it was going to take us."

  • Rust was famously inspired by a stuck elevator reminding Graydon Hoare of how terribly often things break, a rather more "meta" inspiration than for example C's origin story but still a moment that gave Rust a fixed purpose.

And then there's the obvious outliers:

  • Java's original use-case was embedding into consumer electronics, at which it failed, so to rescue the project it was pivoted into powering "applets" (embeddable client-side applications to be embedded in HTML), at which it failed, and then it became the giant among languages that it is today because Sun Microsystems spent a billion dollars on advertising to persuade Business Idiots that this was How To Do Business Properly. There should be a law against marketing technical solutions directly to management just like there are laws against marketing cigarettes to children but what do I know?

  • C# is Microsoft Java.

  • Kotlin is Java redesigned by people who hated Java but didn't hate it enough.

Some things worth noting:

There are two kinds of programming languages, those written for the author, and those written for other people. And in the second case, the other people are always dumber than the author, who is talking down to them. BASIC wasn't designed because Kemeny and Kurtz needed BASIC. BASIC was designed because Kemeny and Kurtz thought that liberal arts graduates needed BASIC, because what would make things simple for their muddled little heads is a language where all values are passed by mutating global state, which is like having a bicycle for beginners where instead of having training wheels you douse it in gasoline and set it on fire.

So you will notice that none of the things on the list that are used as easy languages for n00bs were designed for that. Python was designed for Guido van Rossum to do systems programming. Lua was designed for engineers and geophysicists. JS ... * gestures broadly at the internet *. They were designed, in fact, to be ergonomic for clever people to use, and it turns out that exactly the same things make languages ergonomic for everyone to use, and that more people are clever than was previously supposed, including liberal arts graduates.

(The fact that > 50% of indie language projects are "C/C++ but better" is because the indie langdevs are all trying to scratch the same itch, they're all trying to write the systems language that they wish they could code in. These are languages written for the authors, where the authors are all very similar people who want similar things.)

The other thing that leaps out at me from my list is that the "classic" functional languages, the Lisp and ML families and Haskell, all came from math people wanting to do hard math things as their paradigmatic use-case, and anyone wondering why functional programming hasn't conquered the world yet should think about that.

(I of course have been thinking about that, and although it is premature to put Pipefish in an article about successful languages, making an FPL for writing CRUD apps has produced an language that hits different, and which can in fact be used for all sorts of cool things besides that. Watch this space for the announcement of my front-end web framework.)

97 Upvotes

106 comments sorted by

42

u/RandalSchwartz 4d ago

You're missing the darling language of the early web and sysadmins everywhere... Perl!

4

u/Inconstant_Moo 🧿 Pipefish 4d ago edited 4d ago

We do not speak or write the Dark Tongue in the House of Moo. We are bound by solemn oath to abjure its foul ways, we shun it for this reason and this reason alone, and they lie most basely who say it is "a skill issue".

14

u/pthierry 4d ago

I loved Perl, its community made me learn so much at the start of my career. I was so sad to see Perl 6 fail to materialize in a timely manner.

4

u/RandalSchwartz 4d ago

It indirectly made me a lot of money over the years. Sadly, I'm living paycheck to paycheck these days.

2

u/pthierry 4d ago

You took jobs working on legacy Perl code?

6

u/RandalSchwartz 4d ago

I quit my final Perl client about 6 years ago, and went full-in on Dart and Flutter. I'm finding some work, but I've also accumulated debt in the lean months.

2

u/MadCervantes 4d ago

If you're struggling, what hope do us younger folks have?

4

u/RandalSchwartz 3d ago

Actually, I suspect most of my troubles are ageism. Why hire me when younger coders are available for cheaper? The answer I give is that I know what not to do, and I have the scars to show for it. But not every client or hiring manager sees it that way.

23

u/pthierry 4d ago

Haskell would be a big exception to your rule also. It was created to be a vehicle for PL research, but with the added goal of being useful in the industry.

That is, it may have had a use-case that motivated its creation, but it was aimed at being general purpose from the get go.

1

u/Inconstant_Moo 🧿 Pipefish 4d ago

But they were all also aimed at being general purpose languages --- except FORTRAN where they were kind of making it up as they went along. But all the other authors would know that if you wanted to, you could also use their language to make e.g. a todo app or a text-based adventure game or grep.

But then there was also the thing they really wanted to do, that they honed their languages to do until it did that thing really well.

7

u/pthierry 4d ago

PHP and Javascript didn't try to be general purpose languages. To the degree that PHP was the only language for which Screen, a web application firewall, couldn't write its plugin in the language of the application (because of the execution model).

Maybe Javascript finally did with the advent of projects like Node.js.

1

u/Inconstant_Moo 🧿 Pipefish 4d ago

Fair point. It depends what exactly what we mean by "general purpose" and I guess I do mean more that you can use it to write grep or a Lisp interpreter or a chess engine than that it has all the capabilities to make the machine do all the things it can do. I'm not sure if there are more precise terms to make clearer distinctions.

1

u/21Ali-ANinja69 4d ago

Pretty much any language is general purpose by that definition. You can write a Lisp Interpreter in Assembly.

1

u/Inconstant_Moo 🧿 Pipefish 3d ago

Assembly is definitely and definitionally general-purpose, yes. If my computer can be told to do a thing at all, it can be told to do it in machine code.

1

u/pthierry 3d ago

What you're describing is Turing completeness, and while there a few programming language that aren't Turing complete, like Dhall, they are extremely rare.

But there are quite a lot of Turing complete languages that are not meant or suited for a large number of development tasks. Conflating Turing completeness with general purpose makes the latter lose a lot of its usefulness.

The lack of abstractions in assembly make it a very poor choice to develop any project beyond a certain size. Many exotic languages like Brainfuck have the same issue.

Languages like Elm or Lua are Turing complete but are explicitly designed for a few narrow use cases.

1

u/Inconstant_Moo 🧿 Pipefish 3d ago

Nooo ... Brainfuck is Turing-complete, but not general-purpose. Assembly is general-purpose. People wrote some serious stuff in it, and it was designed to let you do that.

Whether Elm or Lua are general-purpose depends, again, what we mean by it.

1

u/pthierry 3d ago

Most assembly languages are by design a paper thin layer on top of a CPU instruction set. And a CPU instruction set is definitely not a general purpose programming language.

No function, no module, no data structure, no control structure, that's not a general purpose programming language, even if having an assembly language is better than nothing, and they have a few basic features that separate them from actual machine code, like labels.

1

u/Inconstant_Moo 🧿 Pipefish 3d ago

No function, no module, no data structure, no control structure, that's not a general purpose programming language ...

And yet you can in practice use it to write e.g. grep, or a chess engine, or RollerCoaster Tycoon.

→ More replies (0)

1

u/21Ali-ANinja69 2d ago

That's just the distinction between conventional and esoteric

1

u/Inconstant_Moo 🧿 Pipefish 2d ago

Yes. A Turing-complete language which is esoteric is not general-purpose.

→ More replies (0)

10

u/P-39_Airacobra 4d ago

Interesting thoughts, though I must say that I find it somewhat implausible that assembly programmers who designed an OS were swearing at malloc. Malloc was probably quite ergonomic in comparison to what they were coming from.

0

u/Inconstant_Moo 🧿 Pipefish 4d ago

But when they did swear it was often because they'd managed to get their memory in a twist. I agree that a heap is nicer, of course, as did they.

1

u/L8_4_Dinner (Ⓧ Ecstasy/XVM) 1d ago

"Heap" is the data structure, and malloc() (and alloc() before that) traditionally used a heap for its available memory management.

Languages like Java use the term "heap", even though they use a flat (aka "bump") allocator instead of using a heap.

So ironically, malloc() == heap, "heap" == !heap.

6

u/azhder 4d ago

JavaScript won over the rest, and is not odd at all, it’s a very simple, once you consider the major differentiating factor.

Anything from Java applets to Flash was designed to be a plugin i.e. a desktop program that mimicked like it is a part of the web page. Being a desktop program meant it has full access to your system, or at least as full ad any other desktop program.

JavaScript was built to be embedded. It can’t do anything useful if the environment doesn’t provide it. If the browser doesn’t give it a “window” or a “console” object, it can’t even print you a simple output - no way to see “hello world” if the environment doesn’t let it.

People can notice this kind of pattern in other successful languages. C famously came out of the box with a very small amount of keywords and no input/output. It left it to the environment i.e. OS to provide libraries to printf(“hello world”).

Haskell went so far as to invent a monad that you can imagine as it wraps the volatile outside world (like input/output and side effect) in order to leave all the rest of the code pure. Like a protective shell around your “hello world”.

There are a few shared characteristics between these popular and successful languages, not just what I pointed out. They are all examples of some meta-language or a “programming language style” (to make a parallel with “architectural style” as a concept).

1

u/Inconstant_Moo 🧿 Pipefish 4d ago

Ooh, you will like what I've done.

A Pipefish service thinks that it's running in a TUI in a Linux-compatible terminal on someone's laptop, that it's posting output to the terminal, asking for input from the terminal, writing to the file system.

But the service is passed a World object which contains the file system as an interface and says where output actually goes to and how to render things properly and what the environment variables are, so that it works just the same if it really is running in your terminal or if it's actually powering an element in a static webpage or functioning as a backend server or a remote or local microservice or embedded in a Go program or whatever.

(This doesn't allow you to inject arbitrary IO things, because other IO such as e.g. database access can more flexibly be set up based on the injected environment variables, which can then contain paths to different endpoints and the appropriate usernames and passwords based on the environment you run the code in.)

And then the compiler enforces functional-core/imperative-shell semantics: functions can return values but can't do anything; commands can do things (specifically, move data from place to place) but can only return OK or an error; commands can call functions; functions can't call commands.

4

u/mcspuder 3d ago

Almost everything you've said in the above is wrong, for example:

Java - it was developed as a way to make C++ less miserable and to capture the magic of SmallTalk

LISP - No, he wrote a paper on computing church numerals. Hell, he didn't even implement LISP.

Why lie?

3

u/Inconstant_Moo 🧿 Pipefish 3d ago

My post is based on the primary documents for these languages. For example, my knowledge of how John McCarthy invented Lisp comes directly from John McCarthy's own history of Lisp. When you come out with this gibberish about Church numerals I don't even know what you're trying to be wrong about.

"Why lie" indeed?

8

u/The2ndSlimShady 4d ago

Hi Inconstant_Moo, we meet again. Sorry to be offensive but this is a genuine thought of mine. Whenever you post something about languages, it seems to be a version of "Everything is bad and Pipefish is good". I'm not saying Pipefish is bad though, I'm trying to learn in to contribute to the standard library.

-1

u/Inconstant_Moo 🧿 Pipefish 4d ago

It did not say that at all. What makes you say that? That's is not "offensive", that's just wrong. I love programming languages in general, I admire all the languages on that list except PHP and Java, I dwelled on their merits and skipped over their defects, and I pointed out explicitly that my language doesn't (yet) belong on an article about successful languages.

I do of course think that Pipefish is good, if I didn't, while also spending five years developing it, that wouldn't be modesty, that would be an inability to prioritize bordering on lunacy. Pipefish is awesome and I am making it more so daily.

Thanks for being interested in the project. As you can see just by looking at the list of the Go standard libraries, there are still some things I haven't stolen yet, and if you would like to help me make off with the loot, I would be very grateful.

2

u/The2ndSlimShady 4d ago

Haha, just messing with you friend. I'm aware that you didn't say anything like that. I just wanted to frustrate you a little, and mention that I'm interested in your project while doing so. It is quite ambitious and interesting.

2

u/robthablob 4d ago

Lua came from Petrobas which, unsurprisingly, was the state petroleum company rather than nuclear.

2

u/Inconstant_Moo 🧿 Pipefish 4d ago

Thank you, my brain did a stupid. I will edit the OP.

2

u/nzconstructionlawyer 4d ago

the users were the sort of l33t geeks who were quite happy to stay up 'til 4 am chugging Mountain Dew and swearing at malloc in exchange for an inner loop that goes brr.

Nobody that wrote C in the 1970s probably even knew what Mountain Dew was, if it even existed then. They were academics and research scientists not nerds.

2

u/Inconstant_Moo 🧿 Pipefish 3d ago

I looked up when Mountain Dew was invented before writing that line because I am that sort of person.

Academics and research scientists can also be geeks, but also there were students at universities even back in those days.

1

u/nzconstructionlawyer 3d ago

And they still didnt act like redditors

1

u/AustinVelonaut Admiran 4d ago

Mountain Dew was created in the 40's, and was popular in the 60's/70's: There's a bang in every bottle!

22

u/liquidivy 4d ago

There should be a law against marketing technical solutions directly to management just like there are laws against marketing cigarettes to children but what do I know?

I just want to highlight how funny this is.

7

u/montibbalt 4d ago

Minor point, ActionScript was in the same language family as JavaScript and it didn't "fail at the same task" so much as Flash Player was taken out and shot. For most of Flash's life there really wasn't a viable alternative for what it did on the web; it only finally died once web standards had mostly caught up

12

u/pthierry 4d ago

I like your idea about tech marketing, BTW. There is case to be made that it is more damaging to humanity than cigarettes ever were.

14

u/Norphesius 4d ago

I don't think its quite accurate in Java's case though. It did fail at its original goal, and it was marketed out the ass, but it also had a fair few aspects that made it attractive to developers of the time:

  • JVM meant you could write your application for one target, and not have to worry about shipping & testing multiple versions of software for different operating systems.

  • Computers were getting fast enough that garbage collection was becoming viable from a performance standpoint. It also meant excluding a whole class of errors that plagued C/C++ developers who didn't want to care about performance.

  • OOP was in vogue, so embodying that paradigm also made it more attractive.

In the span of time that Java was born until now, many other languages have had their time in the sun and faded into obscurity. PHP and Ruby were both created in the same year as Java, and both have fallen off in usage a lot. I'm not a Java fan, but if the language's popularity was solely due to snake-oil marketing it would've been replaced a long time ago.

4

u/P-39_Airacobra 4d ago

I feel like your first 2 points could equally apply to dozens of other languages at the time though; so that alone cannot account for its success. The third point seems more accurate given that when I started learning programming; it was nearly impossible to find a tutorial that didn't shove OOP down my throat.

5

u/Norphesius 4d ago

The 90s had tons of new languages popping up, but a lot of them tended to be dynamic scripty languages. Java was statically typed, and looked a lot like C++ syntactically, so that probably also contributed to adoption too.

0

u/pthierry 4d ago

I don't think the performance argument has ever been real about GC.

As for Java's popularity, I really wonder how much is just plain inertia from the existing code and skills. Seeing how many people like to use other JVM languages when possible hints at that.

3

u/Norphesius 4d ago

Garbage collection absolutely used to be a problem when memory was constrained. I would argue garbage collection overhead was a significant contribution to Lisp not catching on more. It's mostly fine now for most applications though.

1

u/nzconstructionlawyer 4d ago

And yet every application written in a memory-safe garbage-collected language that I use is a bloated slow-to-start mess. I don't think that's a coincidence.

1

u/L8_4_Dinner (Ⓧ Ecstasy/XVM) 1d ago

You lack understanding, but you're not wrong.

It is true that apps built in languages like Java and C# (not to mention Python, etc.) tend to be bloated, but there are a few logical reasons why:

  1. GC allowed programmers to use libraries, easily. As a programmer, you no longer had to custom handle every resource that crossed a library boundary, because the runtime took care of (most of) that for you. So while our C++ applications tended to have zero library dependencies (outside of the base stdio etc.), our Java applications tended to have dozens or even hundreds of libraries in use, and a typical node.js "hello world" app cannot have fewer than 100. (Some handwaving is involved with that last claim, but several years ago that number was around 126 and growing. That's when I stopped measuring it; when I had started measuring it just a year or so earlier, it was around 78.)

  2. Languages with cheap and efficient GC allocate boat loads of garbage. In C/C++, we knew where every allocation was, and carefully planned for those allocations. (Note: This didn't seem to hold true for GUI apps, but it was true for all our server side apps.) In modern GC-based languages, the assumption is that memory is free and allocations are free and GC may sometimes be a minor annoyance. So you want to print out a string? Under the hood, that requires 73 allocations, but whatever <shrug> 🤷‍♂️

So the problem isn't the language; the problem (if it is a problem, which it often is not) is that the language is way too easy to abuse. But there's a third point:

3) Those apps can't be built in non-GC languages. Twenty years ago I studied projects in depth that were being built at various institutions we were working with (banks, governments, stock exchanges, e-commerce companies, insurance companies, travel systems, etc.) and the cost of building a system in C++ was more than an order of magnitude higher than building it in Java or C#. No one was building any apps in assembly -- and almost no libraries either. And most apps being built in C++ ended up dying before they got to production, because either the teams were incapable of completing the apps, or the cost was simply so high that no company could afford it. (Government didn't have that limitation, which explains the roughly 10x growth in cost of the F-35 project.)

Which is to say that those apps that you see (and that you don't like the perf of) are built in these memory-safe GC'd languages because ... well, because there's no other choice.

1

u/nzconstructionlawyer 1d ago

All completely incorrect. Massive "just so" story.

1

u/L8_4_Dinner (Ⓧ Ecstasy/XVM) 1d ago

It's ok; I didn't expect you to agree. And you have a right to your own opinions on the topic. In addition to building software, I managed a large software group that developed software in C, C++, Java, and C# (among other languages), and I had a keen interest in understanding the rationales for when each language was appropriate to the task, and how to make each product and project succeed, and to do so within budget. Our software was used by every significant business and government in the world, and I got to spend time with many of those organizations. But at the same time, I'm only human, and capable of stupid opinions, and capable of being wrong, just like everyone else.

0

u/Inconstant_Moo 🧿 Pipefish 1d ago

Your critique is as insightful as it is detailed.

1

u/pthierry 3d ago

I use tons of applications written in those languages that start quickly and work very well and fast… YMMV

1

u/pthierry 3d ago

Do you have examples of people actually affected by Lisp GC overhead back in the day?

2

u/Norphesius 2d ago

None specific, I wasn't around back then, but I found a paper from 1984 that brings up the issue on its first page: https://bernsteinbear.com/assets/img/moon-gc.pdf

It says that GC used a ton of memory and caused massive slow down for user interactivity.  If virtual memory was involved it could make the computer basically unusable. 

I would also point out that around the same time people started creating dedicated hardware specifically for running Lisp efficiently (Lisp Machines). For those the reason wasn't entirely GC performance, optimizing linked list structures was part of it too, but you don't usually build bespoke hardware for something if the performance is fine.

1

u/pthierry 2d ago

It says that naive GC is an issue and it builds upon algorithms designed in 70, 76 and 78 to make a GC that gives good performance.

I'd be surprised if that was a major reason why people didn't use Lisp. I've heard bullshit arguments about performance for 25 years (more, virtually, as I read some of them that predate me being a software engineer), when people want to rationalize inertia.

So I've become very skeptical about them. Especially with Lisp that has a long history of successfully optimizing for performance.

1

u/Norphesius 2d ago

There's definitely more to Lisp's lack of adoption than just slow GC (runtime performance, language dialect fragmentation, syntax, being FP adjacent, association with failed AI development), but it was a legitimate reason. Even if GC then was as optimized as GC now, computers had ~.001% the memory and that memory was slower.

1

u/L8_4_Dinner (Ⓧ Ecstasy/XVM) 1d ago

I have encountered many examples of GC overhead being an issue. The most obvious recent one is the iPhone vs Android. The iPhone used a reference counted architecture for memory management, while Android used Java (kind of) with GC. The result is that Android phones had to ship with roughly 2x the DRAM as iPhones, and this trend was fairly predictable and obvious. GC based apps require significantly more RAM to achieve similar performance characteristics; it's a curve, and at around 2x the RAM we could often beat C++ perf in Java in allocation-heavy workloads (because the bump pointer allocation in Java is close to free, and the GC algorithms by ~2010 were getting very efficient.)

There is a curve, though. If you need a smaller footprint, you either avoid GC or you accept a significant perf degradation. And in the 60s, 70s, and 80s, memory was scarce.

Ironically, GC was hugely popular in the 60s, 70s, and 80s though! Not just Lisp, but BASIC and various other BASIC-like scripting languages often relied on GC and were shockingly widely used for business application development. The first business apps I was building in my career sat on top of an interpreter that used linear memory compaction (basically a bump pointer for allocation, and a linear scan for memory reclamation that memmov'd everything to the left to fill in the gaps.) And that's back when CPUs were on the order of 1-5Mhz and RAM was typically 640KB or 1MB.

1

u/nzconstructionlawyer 4d ago

There is no such case to be made whatsoever.

1

u/pthierry 3d ago

The state of the IT industry today is a shameful mess, and it has dire consequences for lots of people, including deaths, directly and indirectly.

1

u/nzconstructionlawyer 2d ago

No it doesn't.

1

u/EggplantExtra4946 4d ago edited 4d ago

Pretty much all successful general-purpose programming languages were thought of by someone with a particular use-case in mind

That's just a marketing thing and also the excuse they give instead of admitting that they made a general purpose language that is not that good.

I think the problem is that there is literally not a single general purpose language that was really thought through and that tried to include all the indispensable features a modern imperative PL should have (metaprogramming features, type sytstem, safety and correctness features, composability features, low level features, concurrency features, memory managenent, continuations/exceptions/logic related features).

All the "simple" languages eventually try to acquire the features they are lacking and this is almost always a failure because the core devs aren't willing to make enough changes to the existing syntax, type system, evalulation model, runtime, etc... to make the new feature fit well or at all, in order to keep a minimum compatiblity with existing programs.

There is this idea that too much features is bad but it's never clear what that means. People saying this will often take examples like Perl or Python as examples but I think those have very little actual big ticket item features. The big ticket language features that you put on your (generic you) modern PL's website frontpage are orthogonal and trying to make them all coexist from the start will force you to simplify the language, clean up the semantics, the evaluation model and remove redundant ""features"" (what Perl and Python would call a feature) that could be built from other primitives.

They were designed, in fact, to be ergonomic for very clever people to use, and it turns out that exactly the same things make languages ergonomic for everyone to use.

Python, Lua and JS are the opposite of good, but I agree with that sentence. It's like, yes regexes and SQL seem scary, but how messy and error prone is the alternative?

3

u/Inconstant_Moo 🧿 Pipefish 4d ago

That's just a marketing thing and also the excuse they give instead of admitting that they made a general purpose language that is not that good.

But you just made that up, which kind of vitiates your argument. The facts are well-documented history, and are as I have stated --- and the people involved mostly weren't "trying to market" anything, their languages went viral, even before the internet, by people copying magnetic tapes and sending them through the mail --- because people liked them, because they were better than the alternative.

Python, Lua and JS are the opposite of good

Is there anything you do like?

I think the problem is that there is literally not a single general purpose language that was really thought through and that tried to include all the indispensable features a modern imperative PL should have (metaprogramming features, type sytstem, safety and correctness features, composability features, low level features, concurrency features, memory managenent, continuations/exceptions/logic related features).

But that is already leaning towards use-cases that not everyone has. You don't go into a lot of detail here but I think I get your drift, and in the whole rest of my life I only expect to want a language like that two or three times, and other times some of those features are plenty dispensable, and I would like a language which dispenses with them.

1

u/EggplantExtra4946 4d ago edited 4d ago

But you just made that up,

Yes most of the time there was a specific and complex program they wanted to write, nevertheless, each time what they made is a general purpose language. For example, what language construct of C is specific to OSes? There isn't one and in fact for the most part writing an OS is not that different than writing other programs. It's also true for languages with concurrency, the actor model of Erlang is not specific to telecoms, goroutines are not specific to servers.

the people involved mostly weren't "trying to market" anything

Of course not, but people writing articles and books about all these languages love to repeat these cute formulas: C, a language made for Unix (depsite being also practical for writng all kinds of user space library); Javascript: a language for the web (although its has exactly the same language constructs than all the other scripting languages); Java: I don't care if they call it a language for embeded, it's also a versatile general purpose language used for all kinds of software, there isn't a Java language construct specific to embeded system, if anything it would be the bytecode that serves that purpose but the bytecode isn't specific to embeded programs either.

But that is already leaning towards use-cases that not everyone has.

Hard disagree. Any sufficiently complex program of any kind will want to use metaprogramming. Safety and correctness is something that all program needs. Composition features like modules and classes is for all kinds of program. Concurrency is everywhere. Low level features may not be for all programs but it's a big proportion of all existing softwares, an even bigger proportions of all essential libraries and runtimes, and most high level programs will use libraries using those features. Using the same language for high level program and the low level libraries it depends on could provide a lot benefits, like specializing the low level code for better performances, or specifying the exact configuration we want, which could be done with parametrized modules, better debugging and profiling tools. Logic programming is also everywhere, or at least it could be.

EDIT:

Is there anything you do like?

There are plenty of language features that I like. Languages a whole? Not so much.

2

u/Inconstant_Moo 🧿 Pipefish 4d ago

Of course not, but people writing articles and books about all these languages love to repeat these cute formulas: C, a language made for Unix (depsite being also practical for wring all kinds of user space library);

I've heard people praise C for many things but never, ever, ever for how practical it makes writing libraries.

Javascript: a language for the web (although its has exactly the same language constructs than all the other scripting languages);

It does not. As I mentioned, I've just been writing a web framework for Pipefish, and seeing again and again how JS allows me to do things that for one thing Pipefish itself would never let me do, because you need to be able to do some crazy dynamic stuff to make all the web things work. I will admit that it's a bit brittle, but the fact that everything I want to do is possible is kind of awesome.

Java: I don't care if they call it a language for embeded, it's also a versatile general purpose language used for all kinds of software, there isn't a Java language construct specific to embeded system

Which, according to my thesis, would explain perfectly why it failed at that.

Hard disagree. Any sufficiently complex program of any kind will want to use metaprogramming.

I didn't say all of those features were superfluous, or in every way.

I'm reluctantly putting metaprogramming into my own lang, because if I don't people will just have their own ad hoc ways of doing it which will be incompatible with each other and my tooling. I will do it very nicely but I will still tell people not to use it.

Safety and correctness is something that all program needs.

I'm not arguing with that one of course but I get the vibe that you'd like rather more safety than I would for day-to-day coding and that you're going to make me do exhaustive pattern matching.

Low level features may not be for all programs but it's a big proportion of all existing softwares

No, it's just a big proportion of your job! Because you are both smart and lucky.

Maybe 90% of professional software development is people writing apps to serve the internal business needs of the companies they work for. Day-to-day, they do not want to be reminded of the following ugly facts: (1) computers have a memory (2) values have representations (3) all data lives somewhere (4) computation is inherently stateful (5) different computers have different operating systems (6) a computer that knows how to do two things at once still won't do that unless you tell it to (7) an entire troupe of trained monkeys is performing a three-ring circus just under the keyboard to make computer go vroom. They'd like to just be able to declare their business logic. The sort of thing you're thinking of wouldn't help them.

2

u/nzconstructionlawyer 4d ago

C is incredibly practical for writing libraries. It's one of its biggest draws: it naturally is very simple to link to.

1

u/21Ali-ANinja69 4d ago

It's easy to link to, but that's true of every language with C FFI. Actually writing library code in C is hard **because** it is simple. Why write a string handling library in C when any other language has better facilities to do so? Arguably, even the libraries you use in C can benefit from being written in something else, and merely targeting C bindings. A .so or .a doesn't care what language it was written in after all.

1

u/nzconstructionlawyer 3d ago

In every other language you need to write a layer on top of your library to translate it into a C API which will have a reasonable ABI. I don't think you can ignore that we call them "C FFIs" for a reason. And it isn't just convention or history that means that ABI is C's. The elements of C are the fundamental things you need for an ABI and not much else.

I think you've confused the language with the standard library here. C as a language makes it easy to write any software you want because it is so flexible. You do need to actually write it though. Most other languages have much more comprehensive standard libraries. But we're comparing the languages, not incidental stuff like that.

1

u/21Ali-ANinja69 3d ago

Every language that isn't C has builtin bounds checking on it's arrays. C can't. Python has array slicing. Everything else has sane strings. Many reasons to write libraries in not C, based solely on the base languages.

Mind you, I love C. But the high of writing a competent heapsort would be completely unjustified if I did it in any other language.

1

u/nzconstructionlawyer 3d ago

Honestly if you think these sorts of things matter much it suggests to me you don't have a lot of experience. You are confusing the language with libraries.

2

u/21Ali-ANinja69 3d ago

How am I confusing languages with libraries? I am referring to the fact that some languages just know more about their builtins than C does. Or have better strings.

It is also true that I am at the start of a hopefully long and enjoyable programming career.

→ More replies (0)

2

u/Ok-Reindeer-8755 4d ago

All the "simple" languages eventually try to acquire the features they are lacking and this is almost always a failure because they core devs aren't willing to make enough changes to the existing syntax, type system, evalulation model, runtime, etc... to make the new feature fit well or at all, in order to keep a minimum compatiblity with existing programs.

There is this idea that too much features is bad but it's never clear what that means.

I think a great idea is being minimal but general as talked about here, in the case of koka

Koka has a small core set of orthogonal, well-studied language features – but each of these is as general and composable as possible, such that we do not need further “special” extensions.

A lot and I mean a lot of "features" are just syntactic sugar, not needed or already doable in the user space of the language, taking advantage of that you can kill a lot of birds with one stone.

2

u/EggplantExtra4946 4d ago edited 4d ago

A lot and I mean a lot of "features" are just syntactic sugar

Yes, the lower letter F features I was talking about. But many other PL features are a lot more than that:

  • metaprogramming features: macros, compile time execution, conditional compilation, front-end part of DSLs

  • all kinds of type sytstem features: struct/records, sum types, polymorphic types, high rank polymorphic types, linear-like types, compile time bounds checking, a limited subset of dependent types, ATS proof system, etc..

  • composability features: classes, abstract classes, parametrized modules/classes, type classes, overloading

  • low level features: gotos, indirect gotos, inline assembly, pointer arithmetic, SIMD, atomics, virtual memory aware data structures even (page fault for detecting out of bounds access), etc..

  • concurrency features: the type system being aware that multiple threads exists, that some specific heap objects can be shared and need to be synchronized or use atomic access, re-entrancy issues, asynchrony issues, etc...

  • continuations/exceptions/logic related features: definitely not mere syntactic sugar either

  • user defined high level (in general) compiler IR, like what MLIR provides

Now, having said that, minimalism has a role, in a way, in that the runtime data and control language primitives and constructs should cleanly map to the underlying IR, which is what defines the runtime semantics. Having a little bit of syntactic sugar for the common constructs is not bad however.

1

u/P-39_Airacobra 4d ago

metaprogramming features, type sytstem, safety and correctness features, composability features, low level features, concurrency features, memory managenent, continuations/exceptions/logic related features

wasn't rust designed with most of this in mind?

"simple" languages eventually try to acquire the features they are lacking and this is almost always a failure because the core devs aren't willing to make enough changes

I feel like changes are only needed if the language was designed poorly from the start. Something like Lisp is hardly going to need syntax extensions. And a language like C is hardly going to need evalutation or runtime changes, because most of the abstraction layers are just handled by API functions. I hardly agree that we need to bolt on a ton of behavior to a language when we already have perfectly fine existing tools for creating abstractions.

0

u/EggplantExtra4946 4d ago edited 4d ago

wasn't rust designed with most of this in mind?

Kind of but it was designed by committee so it didn't work out that well. Its metaprogramming features are plainly bad, the borrow checker forbid too many valid programs and is hard to use, it doesn't have compile time bounds checking like ATS have, many other fancy type system features exist that it doesn't have. Unsafe is really unsafe, as opposed to fine grained disabling of specific checks or the enabling of specific features. It doesn't have goto, nor exceptions afaik. Nor continuations afaik. It doesn't have my dream evaluation model where compile time execution and parametrized module instanciation are interleaved, not even talking about the module parameter validation phase and making sure that the program is valid for all possible conditional compilation configuration. I think we'd now if it was actually a simple and orthogonal language.

Lisp

C is hardly going to need evalutation or runtime changes, because most of the abstraction layers are just handled by API functions.

By model of evaluation I really mean what happens during compile time, compile time execution, conditional compilation, macro expansion, parametrized module instanciation, etc... not the semantics of the AST/IR. Functions alone are an extremely poor way of abstracting and making generic programs, it's just not enough.

I hardly agree that we need to bolt on a ton of behavior to a language when we already have perfectly fine existing tools for creating abstractions.

But we don't, not even close. In terms of runtime composition feature a language like Scala comes close to being good enough. But imo it needs to associated with great metaprogramming features and low level features. It's a whole.

For example, there is a regex macro library I wish I could write, Lisp does have macros, but I also need gotos and indirect gotos and Lisp don't have them. I has exceptions but I doubt the compiled code would be as lean as a specially written backtracking code.

1

u/Goheeca 4d ago

Common Lisp has tagbody + go, but yeah it doesn't have indirect gotos.

1

u/EggplantExtra4946 4d ago

Indirect gotos are essential for several things, including backtracking. It's a real shame to not have them, that almost no language have them really and for absolutely no reason other than C doesn't have them either and that gotos are bad.

tagbody + go

Yes, but can you produce any arbitrary CFG with them? Even if you can it's going to be harder than it should.

1

u/nzconstructionlawyer 4d ago

You have a very particular idea about what is "good" in a programming language. But that idea is wrong.

1

u/EggplantExtra4946 4d ago edited 4d ago

How so? What in particular? Obviously there is a good amount of personal preferences in there, if I made it it would be for me first, not for others. There is also a good amount of what I heard other people want as well, not necessarily all those features combined together though and very different kind of programmers. What's your idea of a good language then?

1

u/nzconstructionlawyer 4d ago

A good language is one that lets me get things done. It isn't one that ticks off a bunch of abstract labels.

indispensable features a modern imperative PL should have (metaprogramming features, type sytstem, safety and correctness features, composability features, low level features, concurrency features, memory managenent, continuations/exceptions/logic related features).

IMO, metaprogramming is a bad feature. In a good language you can get things done and getting things done includes writing a code generator. Code generators are easier to understand because they're just ordinary programs. I like ordinary programs: I can run them in a debugger, I can see their outputs, I can ltrace them, I can step through them, I can strace them.

In Lisp, the standard form of source code might appear to be text but it's in fact not text at all, it's lists. In Lisp, metaprogramming is achieved by writing ordinary programs that manipulate lists. Thus in Lisp, metaprogramming is a good feature. But in most others, it is nothing like writing an ordinary program.

"Type system" and "safety and correctness features" are just labels. Every language has a type system, but what does the type system mean and what does it achieve for me? To me a type system is about data representation. It's not about "safety and correctness". All programming is about correctness. Correctness isn't a feature.

And so on and so forth. Generally I find most of these so-called "features" in languages are just silly. Languages are just way way way too complex for no good reason.

Take for example Rust. Rust has had hundreds, maybe thousands of new features added over the years. Every time, they manage to do it in a way that is both extremely complex to document and explain, but also very limited. Compare that to C++, which is a much too complicated language too but at least when they implement new features they tend to do so in a very general way.

But better yet, better than Rust's BDSM and better than C++'s laissez-faire complexity, is C and a code generator. And best is a decent language for getting stuff done (which C by default most certainly is not) and a code generator.

1

u/EggplantExtra4946 4d ago edited 3d ago

A good language is one that lets me get things done.

Exactly.

It isn't one that ticks off a bunch of abstract labels.

That's not this list of features represents to me, but I understand why you would see it that way.

IMO, metaprogramming is a bad feature.

You say in the next paragraph that in Lisp it is good. Which is it?

To me a type system is about data representation. It's not about "safety and correctness".

Hum, are you lost?

Type systems are both. I didn't say it but I'm talking about a static type system. Arrays, struct, sum types, etc.. are about data reprensentation, but linear-like types, aka the borrow checker, and compile time bounds checking in a language with manual memory management is definitely helping to ensure your program is correct and safe.

Generally I find most of these so-called "features" in languages are just silly.

You're silly, I have good use cases for every single feature I've listed.

Rust and C++

You have no idea what I'm talking about, clearly all you see is a pile of features of which you do not understand their use. My post wasn't even trying to describe the language I want, it wasn't explaining the rationale for it nor trying to convince you, so given you criticisms I seriously doubt you are judging it for what it tries to be.

It's the idea of a statically typed language with manual memory management and likely pointer arithmetic that tries to be both performant and safe by default, or optionally unsafe if you need to, that allows you to write both high level and low level code, and that tries to give a multitude of ways to deal with software complexity.

If you think a language like that is not needed, well ok lol, goodbye. Maybe you lived under a rock for the last 20 years and haven't seen how much complex softwares and software ecosystem have become and all the friction, bugs, bad performance and unsafety that comes along with it and above all how hard it is to modify anything.

1

u/nzconstructionlawyer 4d ago

The software ecosystem was better in the mid 2000s than it is now. The software we had was better, ran well even though computers were far slower, and had more features. It was software designed for power users.

You getting confused by me talking about Lisp is funny. I was very clear in my comment: metaprogramming in Lisp is good because of how Lisp itself specifically works. In any other language, metaprogramming sucks for the reasons I gave.

Type systems are not about both. A type system cannot be both about data representation and be abstract. If it's about representation then it doesn't stop you from dealing with the representation directly. That goes against abstraction which is what so-called "type safety" is all about: types encoding properties that go beyond mere data representation.

"Linear-like types" are exactly the kind of thing I am talking about: types encoding more than just layout of bytes.

This entire idea of language "safety" in the first place is just fundamentally misguided. No language can stop you from correctness bugs. There is nothing more fundamental about a bug causing a torn read from an atomic integer ("unsafe") than a bug caused by two values getting out of sync when logically the program relies on them being in sync ("safe").

The idea of so-called "memory safety" is based on the idea that that is a separate class of bugs which Rust catches but a another language doesn't. But in fact there is a difference.

1

u/EggplantExtra4946 4d ago

You still haven't told me your idea of a good programming language.

2

u/Inconstant_Moo 🧿 Pipefish 3d ago

They did: "One that lets me get things done."

So what is needed depends on what they're trying to get done.

There is no "good language" any more than there is a "good saw". They all have things in mind. By being good at some things, they are bad at others.

For example, my language, as I said, is for writing CRUD apps and middleware. The power and flexibility I get from dynamism must be weighed against the fact that I can do slightly less compile-time typechecking; the advantages of having a latticial type system and duck typing must be weighed against the disadvantages of not having an algebraic type system and exhaustive pattern matching; the price I pay for garbage collection is wasted clock cycles and nondeterministic execution, and the price I pay for not having low-level access is that no-one will be able to really fine-tune their inner loops to make them go brr (currently they can use Go FFI and when I add C FFI they can use that for brr if they want) ... but it will be better at the use-case I'm thinking of than your language. Because when Sam Whitecollar's boss says "Can you put a service on the hub that lets Chris and Alex from Accounting do <thing>", then I've spent five years trying to make that really easy and you haven't.

OTOH if we both wrote a chess engine and you used all your low-level fuckery to optimize it yours would be seven times faster than mine, so there's that.

1

u/EggplantExtra4946 3d ago edited 3d ago

They did: "One that lets me get things done."

That's not a spec nor a list of concreate features/characteristics. You're not even trying.

There is no "good language" any more than there is a "good saw". They all have things in mind. By being good at some things, they are bad at others.

The things is, there are features like dynamic types which have significantly more disadvantages than advantages. I've used scripting languages for a while, their "dynamicism" is suppose to make them expressive and easy to use but in my experience it's the opposite. When your program is < 500 LOCs you don't care about types but at certain point you do and you have to add explicit code do type checking code at runtime everywhere (at least to check function parameters) to make sure you won't do a stupid mistake. Things like a good module system, classes, sum types, polymorphic types, macros, continuations, embedded regexes is what makes a language actually expressive.

There are features that are really at odds with each others, for example having wrapping arithmetic vs arbitrary precision arithmetic, or manual memory managment vs GC. Each of those alternatives are useful in different situations, with an emphasis on different situation. There is no reason why a language couldn't do both but not at the same time. For example a few functions could use a GC, the rest would use manual memory management, or most integer variables would wrap but a select few would do arbitrary precision arithmetic because you specified their static type to do so.

The crucial thing is that all those choices are useful in different situations (except static vs dynamic types, dynamic types are useless are prevent all the other at-odds features to be integrated together). If the languages can't do all these things then you'll have to use 2 or more languages.

The power and flexibility I get from dynamism must be weighed against the fact that I can do slightly less compile-time typechecking

Wrong, you do SIGNIFICANTLY less compile-time type checkinkg.

the price I pay for not having low-level access is that no-one will be able to really fine-tune their inner loops to make them go brr

If all your language is good for is CRUD apps, of course no one will optimize inner loops. I also doubt the performance sensitive inner loops would be visible at all in such a language, they'd probably be in your runtime code or external libraries.

a chess engine

Funny, as if low level code were a rarity. It's the exact opposite. I don't care if 90% of softwares is not low level, that 90% software code will have 99% less users. Everybody use the same kernels, device divers, standard libraries, decompression libraries, process virtual machines and runtimes, video codecs, GUI toolkits, font libraries, game engines, emulators, maths libraries, network protocol libraries, html and json parsing libraries, etc... Billions of people and devices use those every day. Some random CRUD apps? Most of them will only be used by a few thousand people and not necessarily every day and most of their data processing work will be done by low level libraries.

Because when Sam Whitecollar's boss says "Can you put a service on the hub that lets Chris and Alex from Accounting do <thing>", then I've spent five years trying to make that really easy and you haven't.

Dynamic languages like yours don't have the monopoly on getting things done. A static language with good libraries, with a good module system and with macros will get more shit done than a dynamically typed language withtout macros and without a good module system. I don't care how much of a bully boss Sam Whitecollar is to you, the app he's asking you to make is a rain drop in an ocean of actually relevant software. Your software doesn't necessarily need to be fast, safe, extendable and refactorable but a very significant amount of software out there does.

1

u/Inconstant_Moo 🧿 Pipefish 2d ago

That's not a spec nor a list of concrete features/characteristics. You're not even trying.

That's because those things would depend on what one is trying to get done.

Wrong, you do SIGNIFICANTLY less compile-time type checkinkg.

You don't know actually know how Pipefish's type system works or what the type checker does.

If all your language is good for is CRUD apps

It isn't. It's good for lots of other things too. But it is really good for CRUD apps.

Funny, as if low level code were a rarity. It's the exact opposite. I don't care if 90% of softwares is not low level, that 90% software code will have 99% less users. Everybody use the same kernels, device divers, standard libraries, decompression libraries, process virtual machines and runtimes, video codecs, GUI toolkits, font libraries, game engines, emulators, maths libraries, network protocol libraries, html and json parsing libraries, etc...

And 1% of SWEs will be hired to write them. The others need something else. Yes, everyone using Python is also using C. Bully for C, but they are also in a more meaningful sense using Python.

Dynamic languages like yours don't have the monopoly on getting things done.

Right. mine is better for getting some things done, such as > 80% of what people actually do. Any language which is worse than Pipefish at that is not a universally superior language, and so the features I left out of Pipefish are not "indispensable features a modern PL should have". They're features your language should have.

2

u/anaseto 3d ago

When your program is < 500 LOCs you don't care about types but at certain point you do and you have to add explicit code do type checking code at runtime everywhere (at least to check function parameters) to make sure you won't do a stupid mistake.

Most scripts are under 500 LOCs in expressive scripting languages, though. And you don't need macros or powerful module systems for those. When writing a short script, being able to focus on writing executable code instead of writing declarations is pretty nice. But I agree about "embedded regexes" being helpful, even if that has not much to do with expressive static type systems (that feature is actually more common in dynamically typed languages, probably).

→ More replies (0)

2

u/nzconstructionlawyer 3d ago

There are many types of programs where dynamic typing is imo far superior to static typing.

For example, as you admit, small programs!

You definitely do not need to add type checking code at runtime. That shows you dont really get how dynamic languages work. That's not how good code works in Python or Ruby or Perl.

→ More replies (0)

1

u/L8_4_Dinner (Ⓧ Ecstasy/XVM) 1d ago

I think the problem is that there is literally not a single general purpose language that was really thought through and that tried to include all the indispensable features a modern imperative PL should have (metaprogramming features, type sytstem, safety and correctness features, composability features, low level features, concurrency features, memory managenent, continuations/exceptions/logic related features).

I'd claim that most language designers attempt to do so, but the problem is that our field is so vast, and the number of useful inventions so uncountable, that to collect the "state of the art" is itself a project that would take more than a lifetime.

On this topic, I've often cited the exquisite "For the Sake of a Single Poem" by Rilke:

... Ah, poems amount to so little when you write them too early in your life. You ought to wait and gather sense and sweetness for a whole lifetime, and a long one if possible, and then, at the very end, you might perhaps be able to write ten good lines. For poems are not, as people think, simply emotions (one has emotions early enough) -- they are experiences. For the sake of a single poem, you must see many cities, many people and Things, you must understand animals, must feel how birds fly, and know the gesture which small flowers make when they open in the morning. You must be able to think back to streets in unknown neighborhoods, to unexpected encounters, and to partings you had long seen coming; to days of childhood whose mystery is still unexplained, to parents whom you had to hurt when they brought in a joy and you didn't pick it up (it was a joy meant for somebody else --); to childhood illnesses that began so strangely with so many profound and difficult transformations, to days in quiet, restrained rooms and to mornings by the sea, to the sea itself, to seas, to nights of travel that rushed along high overhead and went flying with all the stars, -- and it is still not enough to be able to think of all that. You must have memories of many nights of love, each one different from all the others, memories of women screaming in labor, and of light, pale, sleeping girls who have just given birth and are closing again. But you must also have been beside the dying, must have sat beside the dead in the room with the open window and the scattered noises. And it is not yet enough to have memories. You must be able to forget them when they are many, and you must have the immense patience to wait until they return. For the memories themselves are not important. Only when they have changed into our very blood, into glance and gesture, and are nameless, no longer to be distinguished from ourselves -- only then can it happen that in some very rare hour the first word of a poem arises in their midst and goes forth from them.

At any rate, it's very hard work to make things simple. That is the hardest thing that we do. Anyone can spit out something that "works", but making it easy to use, easy to manage, easy to evolve, etc. ... that's the work of a lifetime.

2

u/21Ali-ANinja69 4d ago

And ultimately, everything's ALGOL's fault. The most influential lanaguage nobody talks about anymore, because everybody copied its homework, such that nothing it has left to offer is all that tempting.

1

u/kwan_e tonal-lang 3d ago

Even ALGOL tried to copy ALGOL and failed.

4

u/flatfinger 4d ago

Fortran was invented to do big math and science fast. Fortran would be supplanted by later languages (C, obviously) for everything but its core competence, but before then it was used for the first adventure game, for payroll software, chess engines, CAD, mainframe utilities, and self-hosting compilers.

IMHO, one of the great tragedies of computing was that it took until 1995 for a FORTRAN/Fortran standards committee to acknowledge that punched cards were no longer the most practical way of submitting source files, and as a consequence some members of the C Standards Committee were only interested in how well C could accomplish the kinds of tasks FORTRAN had been designed to do, and cared nothing for its ability to accomplish tasks that FORTRAN couldn't.

A key feature of Ritchie's language is that it wasn't really a single language, but rather a recipe for producing dialects that were tailored to be maximally suitable for different platforms and purposes, and that the proper role of a good standard should be to maximize the number of tasks that could be accomplished in toolset-agnostic fashion. If a C program does something like:

    *(char*)0xC0E9 = (*(char*)0xC0EE, *(char*)0xC0EC, *(char*)0xC0EB);

someone who knew that the code would be run on an Apple II with a Disk II controller card in slot 6 should be able to predict what it would do (turn on the second floppy drive motor), but someone without that knowledge would have no way of making such a prediction. Note that the C implementation might not know anything about floppy drives or Apple II computers, but it wouldn't need to care. The code would instruct the execution environment to perform byte reads of 0xC0EE, 0xC0EC, and 0xC0EB in that order, and perform a byte write to 0xC0E9 with the last value read, and the way the hardware of the Apple II and Disk II controller card are wired would cause the described behavior if the card was in slot 6.

Unfortunately, the C Standard has been treated as an invitation for compilers to assume that if it wouldn't be possible to predict the behavior of a construct on every machine, programmers shouldn't be able to predict the behavior on any machine.

1

u/L8_4_Dinner (Ⓧ Ecstasy/XVM) 1d ago

I never used C on the Apple ][, but I did use assembly and machine code, and the Disk ][ was quite an amazing feat ... of cheapness 🤣

Woz was a genius, and Jobs was a skinflint.

2

u/pjmlp 4d ago

The C++ origin story is that Bjarne Stroustrup was trying to model computers interacting in a network, and wrote a beautiful version in Simula which would take a hundred years to yield enough data; followed by an ugly version in C which was performant --- and wished, naturally, for the best of both worlds.

This misses a few steps, the original Simula project was rewritten into BCPL.

After swearing to never to do this ever again, while working at Bell Labs, he wasn't keen into using C for the upcoming distributed UNIX project, he came up with "C with Classes" preprocessor based extensions on top of C.

Julia was made for math people to do math things in.

Julia was made by math people that had enough rewriting Python code into C for performance.

C# is Microsoft Java.

Also wrong, J++ was Microsoft Java, originally .NET was going to come out with J++ as described on the Ext-VOS paper, however Sun's lawsuit made them repurpose Cool as C#, while offering J# as migration step from existing J++ code into .NET.

Kotlin is Java redesigned by people who hated Java but didn't hate it enough.

Not at all, from JetBrains own words,

The next thing is also fairly straightforward: we expect Kotlin to drive the sales of IntelliJ IDEA. We’re working on a new language, but we do not plan to replace the entire ecosystem of libraries that have been built for the JVM. So you’re likely to keep using Spring and Hibernate, or other similar frameworks, in your projects built with Kotlin. And while the development tools for Kotlin itself are going to be free and open-source, the support for the enterprise development frameworks and tools will remain part of IntelliJ IDEA Ultimate, the commercial version of the IDE. And of course the framework support will be fully integrated with Kotlin.

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

1

u/kwan_e tonal-lang 3d ago

I think they were just being glib (not the library) in the humour, not aiming for pedantically correct.

Like, "C# is Microsoft Java" is basically summing the origins of the language in a glib way.

1

u/Scientific_Cheater 14h ago

Thread was invented to solve the mental overhead of parallelizing your code :)