1,659 karma · joined Apr 30, 2018 (8y ago) · 540 submissions
comment 3y ago · link · parent
The situation now is very different. The vast majority of the chip is cache. The trade-off for a much bigger decoder (or register stack, or whatever) is now just a fractionally smaller cache.
And on current systems the CPU and memory operate at enormously different speeds - memory is 10+ times slower than the CPU. So to keep the CPU even vaguely busy, we have resorted to enormous caches. And we use large numbers of cores & threads, so that when one thread is waiting for memory, others may be able to run.
The old game was max performance from a limited number of gates. The current situation makes such enormous numbers of gates available (even on tiny, cheap chips) that we're playing an altogether different game.
comment 3y ago · link · parent
The smidgen is defined by its effect. A smidgen of X is the precise amount of X that produces the desired taste. Obvious really.
comment 3y ago · link · parent
That was the "vibe" of early mass computing. Anyone could be involved and anyone could make things better. It was fundamentally optimistic - felt a bit like Startrek NG :) Have a look at "Computer Lib / Dream Machines" by Nelson.
> the fundamental shift that transformed personal computing ... away from empowerment is the realization from industry giants that the platforms that they built ... they could exploit.
There has always a portion of the field that was looking to profit, but it wasn't the completely overwhelming portion that it has become, and the feel was for reasonable profit, not VC yields and "the company is the product" that came to characterise the field :(
Was it VC that killed computing?
comment 3y ago · link · parent
Keep things where they logically belong - the parser is for mapping tokens onto syntax, for that it needs tokens! It doesn't matter if lexing is done in a separate pass, or "interleaved" in time. What matters is that the each "pass" is logically distinct.
Most languages are designed so that it's easy to produce tokens from text, without knowing where you are in the syntax tree - that makes it easy to read code fragments.
(There are languages where the same string can have very distinct structure & meaning depending on context. They tend to cause much swearing and confusion.)
comment 3y ago · link · parent
comment 3y ago · link · parent
comment 3y ago · link · parent
"Oh dear, some god botherer has wrapped their special text in a shell script. Why is this on hacker news? #$%$%$@!!"
Turns out I quite misdirected myself. Don't agree with all his tricks (some are very brittle) but impressive anyway
comment 3y ago · link · parent
Of course, "abstraction lead[s] to less fine control" - at the the lowest (assembly) level, you can do almost anything - and make all the mistakes imaginable. Sometimes you want to genuinely maximise performance, or do things otherwise difficult - fine, use assembly and hit the hardware. But most of the time, software is made to be read, to be trouble free, to build on other's work, and to be written easily - that's when abstraction is valuable.
comment 3y ago · link · parent
I'd like to see an OS that drops the concept of files. Files are very low level (generally a stream of bytes) - the app has to interpret it as config, or data, etc "manually". An OS should be providing higher-level data management, and insisting that is what is used.
(And please not SQL. It's only a little higher level that raw data, and has serious interface problems that permit prompt injection ... the db equivalent of buffer overflows.)
comment 3y ago · link · parent
And note that writing the complete and correct test suite is likely to be a task of similar difficulty to designing and writing good code! I'm not saying don't test, but I am saying that non-trivial testing is difficult.
comment 3y ago · link · parent
Also firefox seems slightly faster to start & to execute than chrome, though I'd be happy to drop lots of the JS garbage to make proper fast. And does it really need to always cache 1GB of old web stuff?
comment 3y ago · link · parent
Yes - that's where is falls down :(
comment 3y ago · link · parent
My example wasn't clear enough - I wasn't proposing full expression compiling. If you think (simplistically) of assembler as a macro processor that maps text mnemonics onto opcodes, I was proposing matching basic expression terms to opcodes (but only simple terms, like "x + y", that map to individual instructions).
Historically, there have been assemblers that do full expression compiling - where an expression compiles to multiple opcodes. But that's going back a way, when people still routinely used assembly. For modern purposes, where good compilers are easily available, something like that just confuses assembly with compilation.
comment 3y ago · link · parent
comment 3y ago · link · parent
MYARRAY: DEFW 100
ADD R1,R5,R7
MVI R2,R1,MYARRAY
how about: MYARRAY: WORD[100]
R1 = R5+R7
MYARRAY[R2] = R1
Not much harder top parse, and much easier to read. I see a couple of minor issues: needs a tweak to differentiate between (say) ADD and ADC; and assembler generally is small change, we're not putting much effort into it.