I'm sorry, but that sounds like the juvenile fantasy of someone who is still in their programming puberty.
Good luck fitting an operating system, web browser or air traffic control system into a page of code.
I'm sorry, but that sounds like the juvenile fantasy of someone who is still in their programming puberty.
Good luck fitting an operating system, web browser or air traffic control system into a page of code.
What PeCaN said there is no different from what masters like Chuck Moore and Arthur Whitney say. Maybe you disagree, maybe not everyone is like those guys, but "juvenile fantasy" and "programming puberty" is an extremely shallow dismissal—which https://news.ycombinator.com/newsguidelines.html specifically ask you to avoid.
We detached this subthread from https://news.ycombinator.com/item?id=22523047.
>Good luck fitting an operating system, web browser or air traffic control system into a page of code.
Aaron Hsu's co-dfns compiler (optimizing compiler for a subset of APL to the GPU) is 3 screens https://github.com/Co-dfns/Co-dfns/tree/master/cmp (I can fit the entire codebase on my three monitors).
This K text editor is way less than one screen https://kparc.com/edit.k (Funny you should mention OS. I'm eager to see how many pages kOS is. AW notoriously hates scrolling.)
Web browsers are a lost cause, I'll give you that one.
Where's the handling of encoding when loading and saving? Where's the handling of different line-endings? Where's the error handling?
Would have been nice to see something approaching real-life code rather than these toy samples.
For larger applications what PeCaN was saying still mostly holds true.
I work on large (1-10 million loc systems) enterprise java code bases and write some side projects in k as a hobby.
I can get the equivalent of around 30-40 java class files on screen at once with k.
Even on poorly written enterprise code bases code is clustered and your “working set” of code files is quite small and is not strewn all over the codebase.
Of course you still need to understand the core system abstractions + base platform + common library code.
If you see many different usages of the same identifier then it’s probably a common construct/pattern you aren’t aware of.
In the same way as ‘i’ tends to be used as the current array index in a for loop - but devs don’t get confused by seeing ‘i’ used in lots of different loops.
Or kotlin devs seeing ‘it’ or class based language devs seeing ‘this’.
Seems to me that is bound to happen pretty frequently when the expectation is to use only one- and two-letter identifiers.
there's a lot of room for improvement in conciseness of code. I would still be surprised if it was meaningfully possible to write a full-featured modern OS with one page of APL