I swear I remember using this. I even remember the syntax. I was able to compile it and just start writing in it. I have no idea how I know this syntax.
I must have gotten it from there. I would routinely get any thing Walnut Creek would make.
I also realized a couple years ago I could navigate EDLIN without help and knew how to use masm. Somehow I had forgotten what I know but my fingers did not.
Fun story: As a kid with only a DOS 3.3 box and no BBS to download another and not much money to buy one, no magazine subscription etc., I accidentally erased our word processor software. I literally only had EDLIN for writing anything. So, that’s what I used. Got so good I was able to write multi-page book reports with it.
HOW TO RETURN words document:
PUT {} IN collection
FOR line IN document:
FOR word IN split line:
IF word not.in collection:
INSERT word IN collection
RETURN collection
In Python it would be:
def words(document):
collection = set()
for line in document:
for word in line.split():
if word not in collection:
collection.add(word)
return collection
I kept the splitting by line and "if word not in collection:" in there even though they don't have an impact on the outcome. I have the feeling that even in the original example they have only been put there to show the language constructs, not to do anything useful. If one wanted to optimize it, it could all be collapsed to just "return set(text.split())", but that would not show off the language features.
ABC uses 225 chars, Python 218 chars. 3% less.
So one could say Python is 3% more efficient than ABC.
As I understand it, "RETURN" means that the function will return something. And that when you define a function that returns nothing, but only does something, you just use "HOW TO".
For anyone else who, like me a moment ago, doesn't know the meaning of ** but is curious: it's how many (but not all) programming languages express "to the power of", aka 2**1000 = 2^1000
Python 3.11.13 (main, Jun 3 2025, 18:38:25) [GCC 14.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> 2**1000
10715086071862673209484250490600018105614048117055336074437503883703510511249361224931983788156958581275946729175531468251871452856923140435984577574698574803934567774824230985421074605062371141877954182153046474983581941267398767559165543946077062914571196477686542167660429831652624386837205668069376
>>> _/2**999
2.0
For my own language design I've wanted to introduce some of this ABC syntax back into Python. Mainly for unpacking data and doing index/slice assignments; a lot of beginners seem to get tripped up because assignments in Python use the same syntax as mutations, so maybe it's better to write e.g. `a['b'] = c` like `set b = c in a`, or `update a with {'b': c}`, or ... who knows, exactly.
I agree that Python would benefit from separating mutation and assignment.
Especially when you are dealing with nested functions. You'd get around the whole need for 'global' and 'nonlocal' declarations. (Though your linter might still ask you for them for clarity.)
As a minimal syntax change, I would propose using perhaps = for introduction of a variable (the common case) and := for an explicit mutation of an existing variable.
But you could also use `let . = ..` and `. = ..` like Rust does.
Interesting, seems like Python is a strict improvement over ABC though many things are very similar. The PUT ... IN ... and INSERT ... IN ... syntax looks quite clunky and un-composable, at least the examples never do more than one (high-level) operation per line. Also, I guess GvR's English wasn't that good at the time - it should be have been INTO, right?
The use of “HOW TO” for defining subroutines is kinda neat. Though “HOW TO RETURN” for functions doesn’t quite hit the mark. “HOW TO OBTAIN” or “HOW TO SUPPLY” would work with the same number of characters.
I swear I remember using this. I even remember the syntax. I was able to compile it and just start writing in it. I have no idea how I know this syntax.
Did early linux have this? Maybe netbsd?
I actually found it. It was on simtel: https://archive.org/details/Simtel20_Sept92
I must have gotten it from there. I would routinely get any thing Walnut Creek would make.
I also realized a couple years ago I could navigate EDLIN without help and knew how to use masm. Somehow I had forgotten what I know but my fingers did not.
Fun story: As a kid with only a DOS 3.3 box and no BBS to download another and not much money to buy one, no magazine subscription etc., I accidentally erased our word processor software. I literally only had EDLIN for writing anything. So, that’s what I used. Got so good I was able to write multi-page book reports with it.
Can you tell me about "Simtel"? I have never used a BBS but from looking at that ISO it was a collection of software downloaded from BBS' ?
The first example in the lanuage introduction (https://homepages.cwi.nl/~steven/abc/):
In Python it would be: I kept the splitting by line and "if word not in collection:" in there even though they don't have an impact on the outcome. I have the feeling that even in the original example they have only been put there to show the language constructs, not to do anything useful. If one wanted to optimize it, it could all be collapsed to just "return set(text.split())", but that would not show off the language features.ABC uses 225 chars, Python 218 chars. 3% less.
So one could say Python is 3% more efficient than ABC.
“HOW TO RETURN” for something as common as “def” is crazy!
Reminds me if tabloid language, were the translation would be :
DISCOVER HOW TO words WITH document
Well, not as bad as something like
which some languages these days are coming up with.While I agree, at least here every word, though is verbose, at least means something, whereas “HOW TO RETURN” carries no more meaning than “def”.
As I understand it, "RETURN" means that the function will return something. And that when you define a function that returns nothing, but only does something, you just use "HOW TO".
Nice find. This looks like the best introduction to the language in the repo: https://raw.githubusercontent.com/gvanrossum/abc-unix/refs/h...
Wow 2 * 1000 without rounding errors, 40 years ago this must have been super impressive, since I find that quite a feat of today's python.
2 * 1000 is 2000 ;)
I think you meant 2**1000
the syntax for formatting ate your star https://news.ycombinator.com/formatdoc
For anyone else who, like me a moment ago, doesn't know the meaning of ** but is curious: it's how many (but not all) programming languages express "to the power of", aka 2**1000 = 2^1000
> 2**1000 = 2^1000
The reason for using `**` is that `^` is widely used for bitwise exclusive-or. So commonly `2**1000 != 2^1000`!
I think Fortran used ** because EBCDIC didn't have ^ or uparrow. ABC and Python followed Fortran rather than C on this point. units(1) supports both.
C uses ^ for bitwise xor and a function for exponentiation, though.
He's explaining that C was not the reason for picking * over ^
And != means ≠
Interesting, thanks!
Oh that's why i did not get any upvotes /i
Wow, I didn't know that you could write
It’s been around since at least occam, maybe longer
Lisp has had arbitrary precision arithmetic since the early 1970s. So did dc on Unix, also in the early 1970s. ABC didn't arrive until 1987.
Extremely cool. Thanks, GvR.
For my own language design I've wanted to introduce some of this ABC syntax back into Python. Mainly for unpacking data and doing index/slice assignments; a lot of beginners seem to get tripped up because assignments in Python use the same syntax as mutations, so maybe it's better to write e.g. `a['b'] = c` like `set b = c in a`, or `update a with {'b': c}`, or ... who knows, exactly.
I agree that Python would benefit from separating mutation and assignment.
Especially when you are dealing with nested functions. You'd get around the whole need for 'global' and 'nonlocal' declarations. (Though your linter might still ask you for them for clarity.)
As a minimal syntax change, I would propose using perhaps = for introduction of a variable (the common case) and := for an explicit mutation of an existing variable.
But you could also use `let . = ..` and `. = ..` like Rust does.
Interesting, seems like Python is a strict improvement over ABC though many things are very similar. The PUT ... IN ... and INSERT ... IN ... syntax looks quite clunky and un-composable, at least the examples never do more than one (high-level) operation per line. Also, I guess GvR's English wasn't that good at the time - it should be have been INTO, right?
"in" vs "into" is often just a matter of how casually you're speaking.
The same sort of syntax was used in HyperTalk (with "into"): https://en.wikipedia.org/wiki/HyperTalk#Description I wouldn't be surprised to hear of it in AppleScript, either, although I can't recall.
not a strict improvement: didn't ABC have persistent variables?
The use of “HOW TO” for defining subroutines is kinda neat. Though “HOW TO RETURN” for functions doesn’t quite hit the mark. “HOW TO OBTAIN” or “HOW TO SUPPLY” would work with the same number of characters.
The year says 91, but it looks like it was recently pushed to github, which is a notable event on its own.
It actually looks surprisingly usable https://homepages.cwi.nl/~steven/abc/types.html
Where is the GIL in this?
You only need the GIL in the first place, when you are doing multi-threading.
Python only got its own GIL in version 1.5 of CPython.