Hacker News new | past | comments | ask | show | jobs | submit login

That's pretty exciting!



It is exciting. The life's work of a dozen people.

Imagine proving the entire IT business field, Silicon Valley and computer science wrong: you can write a complete operating system and all the functionality of the mayor apps (word processing, graphics, spreadsheets, social media, WYSIWYG, browsers) and the hardware it runs on in less than 20000 lines of (high level language) code. They achieved it a few times before in 10000 lines (Smalltalk-80 and earlier versions), a little over 20000 (Frank) and 300000 lines (Squeak/Etoys/Croquet) and a few programmers in a few years.

Not like Unix/Linux/Android/MacOS/iOS or Windows in hundreds of millions of lines of code but in orders of magnitude less.


> They achieved it a few times before in 10000 lines, 20000 and 300000 lines and a few programmers in a few years.

Did they?


Oh, I see now you've edited that to say:

> They achieved it a few times before in 10000 lines (Smalltalk-80 and earlier versions), a little over 20000 (Frank) and 300000 lines (Squeak/Etoys/Croquet)

Smalltalk-80 is significantly more than 10kloc. 6–10kloc gets you a Blue Book virtual machine without the compiler, editor, GUI, class library, etc. The full system is about 80kloc (Cuis is a currently runnable version of it, plus color: https://cuis.st/). Nobody's seen Frank (though you say you have a mostly working copy, I note that you haven't included a link). The 300kloc estimate for Squeak with all the trappings is at least in the ballpark but probably also a bit low.

None of the three contained spreadsheets, "social media" similar to Mastodon or MySpace, or a web browser, though they did contain a different piece of software they called a "browser" (the currently popular term for such software is "IDE" or "editor".)

You could implement those features inside that complexity budget, as long as you weren't trying to implement all of JS or HTML5, but they didn't. In the case of Smalltalk-80, those things hadn't been invented yet—though hypertext had, and Smalltalk-80 didn't even include a hypertext browser, though it has some similar features in its IDE. In the other cases it's because they didn't think it was a good idea for their purposes. The other two systems do support hypertext, at least.

These systems are indeed very inspirational, and they pack a lot of functionality into a small amount of code, but exaggerating their already remarkable achievements does nobody any favors.


Smalltalk-76 was around 10k lines, though probably you need to leave out the microcode/VM to get that number, I forget. (I have the source I'm thinking of on another computer powered down at the moment.) -80 was definitely bigger but -76 was a lot more like it than -72 was.


Yeah, that seems about right. The Smalltalk-76 VM was pretty small, though. A lot smaller than the -80 VM. I think it's fair to say that Smalltalk-76 had WYSIWYG word processing and graphics, including things like paint programs. Like Smalltalk-80, I think, it's missing spreadsheets, social media, and hypertext browsers.


you can see for yourself, e.g. by looking at the Smalltalk emulators that run in the browser, reading Smalltalk books, etc.

I think it's the "blue book" that was used by the Smalltalk group to revive Smalltalk-80 in the form of Squeak. it's well-documented for instance in the "back to the future" paper. I haven't had the fortune of studying Squeak or other Smalltalks in depth but it seems fairly clear to me that there are very powerful ideas being expressed very concisely in these systems. likewise with VPRI/STEPS.

so although it might be somewhat comparing apples to oranges, I do think when, e.g., Alan Kay mentions in a talk that his group built a full personal computing system (operating system, "apps", etc) in ~20kLOC (iirc, but it's the same order of magnitude anyway), that it is important to take this seriously and consider the implications.

similar when one considers Sutherland's Sketchpad, Engelbart's mother of all demos, Hypercard, etc. and contrasts with (pardon my French) the absolute trash that is most of what we use today (web browsers - not to knock the people who work on them, some of whom are clearly extremely capable and intelligent - generally no WYSIWYG, text and parsing all over the place, etc etc)

like, I just saw a serious rendering glitch just now while typing this, where some text that came first was being displayed after text that came later, which made me go back and erase text just to realize the text was fine, type it again, and see the same glitch again. that to me seems completely insane. how is there such a rendering error in a textbox in 2025 on an extremely simple website?

and this all points to a great deal of things that Alan Kay points out. some of his quips: "point if view is worth 80 IQ points", "stop reinventing the flat tire", and "most ideas are mediocre down to bad".


Your comment doesn't seem relevant to my question.

I'm familiar with that work, although I haven't finished reading Engelbart. Some of what I've written about these topics can be found at https://dercuano.github.io/topics/steps.html https://dercuano.github.io/topics/sketchpad.html https://dercuano.github.io/topics/smalltalk.html https://dercuano.github.io/topics/self-sustaining-systems.ht... https://dercuano.github.io/topics/small-is-beautiful.html https://dercuano.github.io/topics/hypertext.html

You are likely to be particularly interested in my "Commentaries on reading Engelbart’s “Augmenting Human Intellect”", https://dercuano.github.io/notes/augmenting.html.


guess I misunderstood your question, and also went on a bit of a rant.

morphle said "you can write a complete operating system and all the functionality of the mayor apps (word processing, graphics, spreadsheets, social media, WYSIWYG, browsers) and the hardware it runs on in less than 20000 lines of (high level language) code. They achieved it a few times before in 10000 lines (Smalltalk-80 and earlier versions), a little over 20000 (Frank) and 300000 lines (Squeak/Etoys/Croquet) and a few programmers in a few years."

to which you replied "did they?"

to which I replied something along the lines of "you can take a look at Smalltalk systems" to answer your question. to clarify, I meant you can look at what the extent of what they were capable of is, and look at their code. which, again, to me is a bit apples to oranges, but is nonetheless something that ought not to be dismissed.

thanks for the links btw!


Thanks for alerting me to morphle's clarifying edit! I've answered it at https://news.ycombinator.com/item?id=43332195

The summary is: no, they didn't.


I think one difference in these big pieces of software and the older systems is that the old systems ran on bespoke hardware and only one platform where as UNIX & Windows must support a lot of different hardware.

That's not to say they do seem far too large for what they do, but it is a factor. How much code in ROM vs loaded at runtime?

It also depends on what you include in those LoC. Solitaire, paint, etc? I18N files?


not that I've done the LOC calculations, but I would guess Alan Kay, etc. include, e.g., Etoys, the equivalent of paint, and some games in what they consider to be their personal computing system, and therefore in the ~20 kLOC.

and hardware is one of the crucial points Alan makes in his talks. the way he describes it, hardware is a part of your system and is something you should be designing, not buying from vendors. the situation would be improved if vendors made their chips configurable at runtime with microcode. it doesn't seem like a coincidence to me that a lof of big tech companies are now making their own chips (Apple, Google, Amazon, Microsoft are all doing this now). part of it is the AI hype (a mistake in my opinion, but I might be completely wrong there, time will tell). but maybe they are also discovering that, while you can optimize your software for your hardware, you can also optimize your hardware for the type of software you are trying to write.

another point is that any general purpose computer can be used to simulate any other computer, i.e. a virtual machine. meaning if software is bundled with its own VM and your OS doesn't get in the way, all you need for your softare to run on a given platform is an implementation of the VM for the platform. which I think begs many questions such as "how small can you make your OS" and "is it possible generate and optimize VM implementations for given hardware".

also something that came to mind is a general point on architecture, again from Alan Kay's ideas. he argues that biological systems (and the Internet, specifically TCP/IP, which he argues takes inspiration from biology) have the only architecture we know of that scales by many orders of magnitude. other architectures stop working when you try to make them significantly bigger or significantly smaller. which makes me wonder about much of hardware architecture being essentially unchanged for decades (with a growing number of exceptions), and likewise with software architecture (again with exceptions, but it seems to me like modern-day Linux, for instance, is not all that different in its core ideas to decades-old Unix systems).


In this respect, Kay's methods seem to be merging with those of Chuck Moore: the difference lies in that Moore doesn't seem to perceive software as a "different thing" from hardware - the Forth systems he makes always center on extension from the hardware directly into the application, with no generalization to an operating system in between.


I think Kay's work is in harmony with that approach, too.


Etoys doesn't, as far as I know, run on any platforms that are anywhere close to 20kloc. It certainly could, but that's not the same thing.


I don't think supporting a lot of different hardware is a big factor, but if you think it is, building standardized hardware to your liking is a pretty affordable thing to do today. You can use a highly standardized Raspberry Pi, you can implement custom digital logic on an FPGA, or you can wire together some STM32 or ESP32 microcontrollers programmed to do what you want. Bitbanging a VGA signal is well within their capacity, you can easily get US$3 microcontrollers with more CPU power than a SPARC 5, and old DRAM is basically free.

I think it's probably possible to achieve the level of simplification we're talking about, but as I explained in https://news.ycombinator.com/item?id=43332195, the older systems we're talking about here are in fact significantly more code than they are being represented as here.

L11n message catalogs (.po files, which I think is what your remark about i18n is intended to refer to) are not conventionally considered to contain lines of source code.

You can write a lot of games in not much code, especially when efficiency isn't a major concern. I've made some efforts in this direction myself.

Without a game engine, Tetris is maybe 200 lines of JS http://canonical.org/~kragen/sw/inexorable-misc/tetris.html, 200–300 lines of C (building on the fairly minimal graphics library Yeso) https://gitlab.com/kragen/bubbleos/-/blob/master/yeso/tetris... https://gitlab.com/kragen/bubbleos/-/blob/master/yeso/tetris..., or 300–400 lines of assembly when optimized for small executable size http://canonical.org/~kragen/sw/dev3/tetris.S https://asciinema.org/a/622461. The fairly elaborate curses Tetris in bsdgames (which I didn't write) is 1100 lines of C. Emacs comes with a tetris.el (which I also didn't write) which is almost 500 lines of Lisp.

Space Invaders without a game engine, using only a color-rectangle-fill primitive for its graphics, is about 160 lines of JS http://canonical.org/~kragen/sw/dev3/invaders ; when I factored out a simple game engine to make the code more readable, and some added elaborate explosion effects, it's closer to 170 lines of JS http://canonical.org/~kragen/sw/dev3/qvaders. (These have a bug I need to fix where they're unplayably fast on displays running at 120Hz or more.)

A minimal roguelike, hunting treasures in a colored ASCII-art maze, is 54 lines of Forth: http://canonical.org/~kragen/sw/dev3/wmaze.fs https://asciinema.org/a/672405.

And, though it doesn't quite rise to the level of being a game, a Wolf3D-style raycasting engine with an editable maze world is about 130 lines of JS http://canonical.org/~kragen/sw/dev3/raycast.

I didn't write this, but you can write Pong in JS in Notepad in five minutes: https://www.youtube.com/watch?v=KoWqdEACyLI

Emacs comes with a peg solitaire (which I didn't write) which is under 400 lines of Lisp.

The Hugi sizecoding competition delivered a lot of games that were under 200 bytes of code: https://www.hugi.scene.org/compo/compoold.htm

My experience writing these tiny games is that a lot of the effort is tuning parameters. If Tetris speeds up too fast, it's too frustrating; if it speeds up too slowly, it's boring. If the space invaders drop too many bombs, or advance too quickly, it's too frustrating; if too few or too slowly, it's boring. I spent more time on the explosions in Qvaders than on writing the entire rest of the game, twice. This gameplay-tuning work doesn't show up as extra source code. All of these games significantly lack variety and so don't reward more than a few minutes of play, but that's potentially fixable without much extra code, for example with interesting phenomena that stochastically occur more rarely or with more level designs.

MacPaint, for what it's worth, is about 2000 lines of assembly and 3500 lines of Pascal: https://computerhistory.org/blog/macpaint-and-quickdraw-sour... but you could clearly put together a usable paint program in much less code than that, especially if you weren't trying to run on an 8MHz 68000 with 128KiB of RAM.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: