Live data from Hacker News

The seven programming ur-languages (2021)

madhadron.com

151–160 of 326 posts

Re: The seven programming ur-languages (2021)

#151
post #59
post #42

Earlier quoted context omitted.

I always thought that the "message passing" style of OO (which I always hated as a term, because it implies asynchronicity, but I digress) is firmly something else than the "classes and interfaces" style of OO, and that it's an unfortunate accident of history that we give them the same name.

I think part of the problem of trying to separate the two is that the most prominent implementations appear deceptively similar on the surface, even with unfamiliar syntax. E.g. put even Smalltalk in front of someone familiar with C++, and they'll quickly latch on to the similarities once a few of the basics are explained, to the point that explaining message passing as different from method invocation is tricky, not…

this distinction is something i have been struggling with for some time. i am coming from pike which only uses method invocation terminology (in pike it's actually called "function call"), and never even hints at message passing, yet in pike objects can take control over the target of a function call and even dynamically create functions based on arguments given.

when learning smalltalk i could not see the what was so special about message passing, and why it is even called that.

consequently, i find the distinction between message passing vs function or method calling academic. more interesting are distinctions like static vs dynamic dispatch and early vs late binding and whether things are defined at compile time or runtime.

the term "message passing" always made me feel like this should be something completely different and not even remotely similar to function calling. yet i couldn't see that difference and that left me irritated because i felt like i was missing something.

Re: The seven programming ur-languages (2021)

#152

Objective C is a good example of a Smalltalk derived language that was in heavy use for a while. Even though it's technically a superset of C, in actual use it's more like a message passing language.

It's really Smalltalk and C pasted together with hardly any mixing, like JSX=JS+HTML. I can't see how you could put it in either column, it's absolutely in both.

You're right, of course. It absolutely is and so it might be a bad example, but it might be one where more readers would be familiar with.

Re: The seven programming ur-languages (2021)

#153
post #127

Earlier quoted context omitted.

Ok fair enough. I suspect that's a pretty non-standard/rarely-used feature though. If you learn SQL you likely won't encounter this and I still contest the idea that SQL is a good entry into the logic paradigm. SQL and Prolog are both relational. That's very unique to both. But SQL is all about querying databases. Prolog can also be used and understood as a database querying language but it's also very strong for - p…

> I suspect that's a pretty non-standard/rarely-used feature though. If you learn SQL you likely won't encounter this Recursive common table expressions are part of the SQL standard (since 1999) and are quite frequently used to traverse hierarchical data (aka "adjacency list"). It is part of basically all (good) SQL tutorials - at least in the "advanced" part.

I don't remember using recursion in a real project, but I built a HN clone on top of Postgres, with the following query:

    WITH RECURSIVE thread(id, parent_id, user_id, post_id, timestamp, text, depth) AS (
      SELECT id, parent_id, user_id, post_id, timestamp, text, 0
      FROM comments
      WHERE user_id = 1
        AND parent_id IS NULL
      UNION ALL
      SELECT c.id, c.parent_id, c.user_id, c.post_id, c.timestamp, c.text, t.depth + 1
      FROM comments c
      JOIN thread t ON c.parent_id = t.id
      WHERE c.user_id != t.user_id
    )
    SELECT * FROM thread ORDER BY timestamp ASC;

Re: The seven programming ur-languages (2021)

#154
post #44

The comments here are interesting, lots of possibilities for other ur-languages. My suggestion is macro based languages. Macro based programming predates all programming languages other than ASM[1]. The simple macro systems, like early assemblers provided, aren't ur-languages, but once macros can expand other macros and generate definitions of new macros, the macro systems can become general purpose programming syste…

I read about TRAC in Computer Lib while working on a template language that basically just has #! as a special prefix in JSON objects to signal a macro-expansion. I expand macros until there are no more macros to expand, and return that as the result to render in HTML. Reading about TRAC is what made me realize I had a general purpose language on my hands. Too bad, I could have avoided the whole exercise of writing an interpreter, scheduler, debugger if I just left it as an alternative syntax for interpolating variables into HTML.

Thanks for the tip on Études for Programmers, looks like I'll be able to look at it in a library at least, surprised archive.org didn't have it.

Re: The seven programming ur-languages (2021)

#155
post #5

An article like this is hard to write. This is a good one. I have a few quibbles, but they are just quibbles. IMHO* a distinguishing feature of Algol like languages (aka "procedural" languages) is the distinction between expressions and statements. Though personally I've never seen the appeal, that distinction seems to be popular for some reason. * this isn't even a quibble -- the article is fine without it. Just som…

There is no difference between expressions and statement in Ruby (a descendent of the Agol Family). Everything evaluates to a value so everything is an expression. (to be fair, it took a lot of inspiration from Smalltalk and LISPs)

I would place Ruby in the Self/Smalltalk family, as it’s semantics are more similar to those languages.

Re: The seven programming ur-languages (2021)

#156
post #53

Agree on the families, but I would pick a different representative for many of the categories. Algol -> C. Mostly because you can actually do things with C, and yet it remains a fairly small language that's a relatively pure exemplar of the Algol tradition. Lisp -> Scheme. Also because it's a tiny language that tries to push the fundamentals of the Lisp family (code-as-data, recursion, functional programming, macros)…

I'm not sure if it's common knowledge that "ur-" means "original".

I hadn’t come across the this before, but in Dutch we have the oer- which is spelled out as in poor, so I somehow connected the dots.

Re: The seven programming ur-languages (2021)

#157
I think mentioning Simula would be fair. The first object-oriented language.

"" Simula (1967) is generally accepted as being the first language with the primary features of an object-oriented language. It was created for making simulation programs, in which what came to be called objects were the most important information representation.

Re: The seven programming ur-languages (2021)

#158
post #109
post #9

Pretty excellent summary, this is roughly the taxonomy I have in my head. I would maybe add SQL as an ur-language as well. It's not quite general purpose like most of these, but it should have a place in this list, I think. It has some kinship with Prolog and the declarative style, but it's really it's own thing. You could also maybe argue for something like LabView. Many programmers look down on purely graphical pro…

SQL might be in its own category or not, but it shares a trait that languages in other categories ended up with: "I know, we'll make it kind of like writing English so that people who aren't experts can program!". This is one of those things that seems to keep coming back - recently in the Ruby world with Cucumber.

I suspect that idea is now dead. Anything new that accepts something that looks like natural language now needs to be at least as smart as ChatGPT. Stuff that sort of looks like a natural language but is really a formal language now comes across badly.

There have been very few non-English programming languages. There was a French version of COBOL once. I'm surprised that something hasn't come out of China. There's a Chinese dialect of Python. Does anyone use that?

Re: The seven programming ur-languages (2021)

#159

I think reactive/synchronous languages [1] deserve a category of their own. They share little/no overlap with any of the others. My background in electrical engineering biases me to Verilog, VHDL, and LabVIEW as exemplars, but there are many others. The distinguishing characteristic of the category is that programs are effectively declarative functions of time and can be composed as such, much like electronic circuit…

My education was in EE but I switched over to programming ASAP. So my take on Verilog/VHDL is, like, super uninformed/perpetual honeymoon/starry-eyed. But it always seemed to me that these HDLs, since they fundamentally are pretty low-level and asynchronous, if translated to assembly somehow, ought to expose a ton of instruction level parallelism.

"Asynchronous" not the right word since "synchronous" in hardware typically refers to clock signals.

The parallelism in hardware is indeed extreme. Like if every line in your program ran at once, and then repeating every clock cycle.

Re: The seven programming ur-languages (2021)

#160
post #5

An article like this is hard to write. This is a good one. I have a few quibbles, but they are just quibbles. IMHO* a distinguishing feature of Algol like languages (aka "procedural" languages) is the distinction between expressions and statements. Though personally I've never seen the appeal, that distinction seems to be popular for some reason. * this isn't even a quibble -- the article is fine without it. Just som…

The distinction in ALGOL, Pascal etc. is useless. But if you change your definitions such that expressions always evaluate to a single value and do not have any side effects while statements produce some kind of side effect (and may or may not yield a value), the distinction becomes important. Especially if you believe side-effects need special handling (i.e. you are a functional programmer).

The only popular language I can think of that requires side effects to be declared is Haskell. Which doesn't have a distinction between statements and expressions.

Are there any good examples of languages that have it, where it isn't "useless"?

Post reply on HN