Better HN
topnewbestaskshowjobs
Log inSign up

drpixie

1,659 karma · joined Apr 30, 2018 (8y ago) · 540 submissions

Submissions

comment 3y ago · link · parent

This RISC/CISC debate made a lot of sense when the "guts" of the CPU (decoder, registers, ALU, etc) occupied almost the whole chip (or box of transistors), and when memory and CPU had similar speeds.

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

A smidgen is precisely defined ... just not in relation to another physical quantity. (And any one smidgen is not necessarily the same as another.)

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

> Computational power ... could be harnessed by anyone with a few thousand dollars and the willingness to learn.

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

Are there really people who haven't seen it? Sad face :(

comment 3y ago · link · parent

I have similar compiler history and employ similar practice.

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

If I was parsing the input, then parse-time is the time to assign a token-id (I'd use an enum). Then you have a unique identifier and wouldn't need to use the fancy hash function. It's a nice function, takes good advantage of the instruction set, but seems brittle or redundant.

comment 3y ago · link · parent

Nice shortcut if you know the input is correct, but seems like it might be prone to failure with carefully constructed input strings. If I can find an input token that produces the same hash as a normal keyword, a program using this might misbehave in "interesting" fashions.

comment 3y ago · link · parent

Thanks - there was talk when Fuschia first became visible that it was to be locked down. The project site does not agree with that.

comment 3y ago · link · parent

Ha ha - I had the opposite reaction ...

"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

Isn't Fuchsia google's attempt to move phone off open systems, and onto all-google-no-license code? If it becomes a big thing, then only increasingly obsolete open-systems for us :(

comment 3y ago · link · parent

I'm sure security is part of the reason for the ever increasing locking-down of android ... but I'm more sure it's an excuse and that security FROM the user is a huge factor in google's thinking.

comment 3y ago · link · parent

Reminds me of being taught hand-cut recursive descent compilers, back in the day. The process was: define what info is required and passed around, then the code becomes (almost) trivial.

comment 3y ago · link · parent

I was somewhat amazed that a significant university doesn't handle IPv6 - sigh.

comment 3y ago · link · parent

You seem to be answering your own questions :)

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

In general, simple interface is easy for the programmer to understand, and provides less opportunity for system bugs and strange interactions.

comment 3y ago · link · parent

It is - until you want to do something interesting, then it's all ioctl(), recv(), and the various gather calls!

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

Wipe them off, Jim.

comment 3y ago · link · parent

I was taught "Jack left port" and I know port (wine) is red.

comment 3y ago · link · parent

And if you like the O'Brien books, read the C.S. Forester "Horatio Hornblower" books - historically & nautically accurate and very readable.

comment 3y ago · link · parent

Everything I need to run I can run on Linux, either as Linux app or via Wine. The few things I can't run on Linux, they're not that important...

comment 3y ago · link · parent

Agree. And I pay - with my time and expertise - by using Linux :)

comment 3y ago · link · parent

Agreed - given a complete and correct test suite! But even so, "correct" code is not necessarily efficient or readable code.

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

Sounds like using Pilot or ChatGPT for coding - no understanding of the situation/problem, just add some code that makes the error message go away :(

comment 3y ago · link · parent

Yes. Works fine on all but one site, which only works on chrome. (Running on Linux and Android.)

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

I think you can still buy "Meccano" ... like Lego but potentially more capable. Eight might be a little young, but got to start sometime :)

comment 3y ago · link · parent

> Except it doesn't scale that well to all of the different operations. How do you distinguish between a signed and an unsigned high multiply? What do you do for operations like count-trailing-zeros or popcount, which don't map to standard operator symbols? How do you distinguish between nontemporal loads, atomic loads, sign-extended byte-to-word loads, etc.?

Yes - that's where is falls down :(

comment 3y ago · link · parent

To be fair - the processor only has binary opcodes & operands :)

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

Done that on several occasions. There are plenty of projects (and many languages) that compile to C and hand that on to the systems compiler. As an output format, C actually works very well. It hides the fiddly things like register allocation - things that are already done well by gcc and the like.

comment 3y ago · link · parent

Very true, though there are some instruction sets with literally thousands - like the Intel x86-64. Give me RISC any day.

comment 3y ago · link · parent

It's all convention. Personally, I'd like more arithmetic convention. Instead of:

  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.
1
91011
18