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.
I think you meant 2**1000
the syntax for formatting ate your star https://news.ycombinator.com/formatdoc
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.0LISP had it, Smalltalk had it, Unix dc/bc had it.
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.
https://en.wikipedia.org/wiki/Simtel
It was called SIMTEL20 for a while because it was hosted on a PDP-10 mainframe running the TOPS-20 operating system, but apparently it was hosted on a PDP-10 running ITS first:
> The archive was hosted initially on the MIT-MC PDP-10 running the Incompatible Timesharing System,[1] then TOPS-20, then FreeBSD servers
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.
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.
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.
Maybe I am remembering this wrong...
Python only got its own GIL in version 1.5 of CPython.