Better HN
topnewbestaskshowjobs
Log inSign up

anyfoo

9,878 karma · joined Dec 7, 2012 (14y ago) · 2,939 submissions

If you want to send me an email: <username>@<username>.de
Submissions

comment 1y ago · link · parent

Kudos for doing so! This is seriously a great endeavor. Regarding its relation to UNIX concepts, I do spot a classical hierarchical file system there, though. ;) Is it only an "add-on" (similar to IFS on IBM i), or is it fundamental?

comment 1y ago · link · parent

For sure. Also, we simply live in a world where computers, and their operating systems, are giant, impossibly complex structures. No single person can even fully know in all detail even what you would relatively consider a small part of neither any commercial computer, nor their operating system. In my job, I work with 15000 (!) page specifications, and that's only concerning one part of very many.

That pretty much guarantees that change can only be incremental.

comment 1y ago · link · parent

Indeed. But to be fair, in today's world it is not only somewhat hard to imagine an OS that does not rely on things such as a filesystem with opaque binary files, directories, and hierarchical paths connecting these, but in order to properly communicate with the "outside world" you more or less have to have those things. Even AS/400 / IBM i added IFS, which is basically a bolted on hierarchical filesystem, to their system a long time ago by now.

Still sad that it has to be that way. I've long come off of thinking "everything is a file", and a file then just being a binary blob, is a good thing. (That's not even talking about other concepts from Unix we take for fully granted yet.)

comment 1y ago · link · parent

> Sometime in graduate school I started paying more attention to the Xerox PARC legacy of the Mac, and I started realizing that perhaps Unix was not the pinnacle of operating systems design.

For me, that watershed moment came when I looked at IBM's AS/400, known today as "IBM i". Despite having used computers since the 80s, and Unix/Linux since about the mid-90s, only much later AS/400 made me realize how extremely unixoid almost every OS I know is (well, every OS I knew after the 8 bit micro era or so). Just like you, it also made me realize how UNIX maybe isn't the answer to all, and that it's maybe not such a good thing that we've pretty much settled on it.

I've heard that apparently MULTICS, one of UNIX's major influences, gives people a similar impression when they revisit it nowadays, and realize how advanced it was. I personally have not looked into it yet.

(The other OS that expanded my horizon on how different OSes can be from what I know is MVS on IBM mainframes, but unlike AS/400, not really on a necessarily good way.)

comment 1y ago · link · parent

If you like Fourier, you're going to love Laplace (or its discrete counterpart, the z transform).

This took me down a very fascinating and intricate rabbit hole years ago, and is still one of my favorite hobbies. Application of Fourier, Laplace, and z transforms is (famously) useful in an incredibly wide variety of fields. I mostly use it for signal processing and analog electronics.

comment 1y ago · link · parent

Good analysis. I guess I lost my cycle-counting foo, because on modern CPUs cycle-counting is a) infeasible on a superscalar, speculative, out-of-order CPU, and b) even if you did manage to do it, it hardly matters when a CPU cycle is less than a nanosecond, but any memory access that slips through the caches means many orders of magnitude higher latency.

Of course none of that applies here, but it colors the way you think about things…

comment 1y ago · link · parent

Very neat. Breaking up multiplications and divisions into bit shifts, and lookup table to trade off memory for runtime, are indeed nothing new to engineers working on the low level, but this paints a very pretty picture of how this looks in practice.

comment 1y ago · link · parent

Not quite. They build the entire table upfront, whether any individual entry is needed or not.

Making it an on-demand cache instead is a neat next step. Whether it helps or hurts depends on the actual input: If the input image uses every pixel value anyway, the additional overhead of checking whether the table entry is computed is just unnecessary extra with no value.

But if a typical image only uses a few pixel values, then the amortized cost of just calculating the few needed table entries may very well be significantly below the cost of the current algorithm.

If images are somewhere in between, or their characteristics not well known, then simply trying out both approaches with typical input data is a good approach!

Unless you’re perfectly happy with 0.2 seconds, for example because the runtime of some other parts take so long that dwarfs those 0.2s, then why bother.

comment 1y ago · link · parent

True!

I don't think that's what happening, though. At a quick glance, the primitive words seem to be directly implemented in C: https://github.com/eliben/goforth/blob/3949fe0cc52131fdcae0e...

So it looks like this one kind of sits in between. It has primitive words implemented in C, but a dictionary accessible by Forth. The interpreter loop however seems to be implemented in C as well, not Forth.

comment 1y ago · link · parent

I must say, implementing Forth in almost any high-level language, even C, can be awkward and almost antithetical. A "high-level" Forth implementation often merely presents a Forth-compatible runtime, which runs the risk of missing what makes Forth so unique and useful. (The author actually seems to understand this: "The first implementation I tried is stubbornly different. Can we just make a pure interpreter?")

That's because of two main reasons. First, Forth relies heavily on passing control to the next word, instead of calling word implementations as subroutines. This is difficult to do correctly, and dynamically, in C. I suppose you could get by with computed gotos, but...

Secondly, Forth and assembly (or more generally any lower-level instruction/register view of what it's running on) go hand in hand. Forth words may carry their own assembly implementation within them, or they may be partially assembly.

Without those two things, you don't really have a Forth system, just a Forth interpreter. And you cannot define new primitive words, or words with very custom compilation semantics, from within Forth itself.

And therein also lies Forth's strength. It is very easily on-the-fly expandable, and it can even bootstrap itself. It is a great tool for machine-level exploration: Do complex low-level things with a lot less boilerplate.

The author mentions that this second attempt is a "hacker level" implementation, but short of reading the source code does not seem to go into any detail what that means exactly, and how it's implemented?

comment 1y ago · link · parent

Very interesting. I'm curious what the os2museum.com can say -- if anything -- on this. A deeply technical perspective, as in knowing the actual bit-by-bit internals, can shed much more light.

os2museum.com was just recently able to trace how one particular DOS bug (more than two BIOS harddisk drives would make earlier DOS-versions hang at boot) was handled across different companies, and how and when exactly a fix made it into actual MS-DOS.

comment 1y ago · link · parent

That’s like saying: “This is the main reason that, even though I know I’d enjoy a nice car, I stubbornly stick with a run-down PT Cruiser without radio and air conditioning. It’s because I know that I will be extra frustrated when I have to take an Uber.”

I personally use zsh and do not want to miss it on my own machines. I however do log in onto machines that sometimes do not even have bash (yeah it’s rare nowadays, but it exists), and I adapt just fine. It’s not super pleasant, but not using zsh on my machines would be less pleasant.

comment 1y ago · link · parent

I feel that nowadays, it's a combination of "things just work" and "if they don't, good luck figuring out why".

I recently installed Tru64 UNIX on a DEC Alpha I got off eBay. I felt like it was more sluggish than it should be, so I looked around at man-Pages about the VM (virtual memory, not virtual machine) subsystem, and was amazed how cleanly and detailed it was described, and what insights I could get about its state. The sys_attrs_vm man-page alone, which just describes every VM-layer tunable, gave a pretty good description of what the VM subsystem does, how each of those tunables affects it, and why you might want to change it.

Nowadays, things are massively complex, underdocumented (or just undocumented), constantly changing, and often inconsistent between sub-parts. Despite thinking that I have both wide and deep knowledge (I'm a low-level code kernel dev), it often takes me ages to figure out the root cause of sometimes even simple problems.

comment 1y ago · link · parent

My favorite "old software that still miraculously works" is oneko, a once sort-of famous cute little cat that chases your mouse pointer.

oneko-1.1b is from 1995, and yet I was still able to build and run it natively on an M1 Pro MacBook unchanged, with XQuartz as the X server.

(I just tried again on a more recent Mac, and while it still happily builds, running it crashes the X server. That seems to be an X server bug, though.)

comment 1y ago · link · parent

Yeah, that is one of the main reasons I don't use emacs in a terminal much (the main exception being that I use emacsclient with -t for terminal mode as $EDITOR and for quick editing). Some key bindings just don't work properly.

comment 1y ago · link · parent

What serendipity. I just bought an old Alpha on eBay, and installed both Tru64 and OpenBSD on it. Tru64 came with CDE, and I was once again admiring how ugly it is, and lamenting with friends at work how this eyesore could replace OpenLook. But CDE kind of "belongs" to Tru64.

Looks like I now get to "enjoy" CDE on the OpenBSD partition as well!

comment 1y ago · link · parent

Oops, "the decimal" in my answer should read "hexadecimal", obviously. (Too late to edit.)

comment 1y ago · link · parent

It's interesting.

My first idea was that you consciously or subconsciously have the front panels from PDPs in mind (which are very iconic), and a lot of PDP had word sizes that were either only or also divisible by 3 (like 12 or 18). Even for the PDP word sizes that were also divisible by 4, it still made sense to keep it in grouping of threes for the overall line.

Looking at the equally iconic IBM s/360 front panel (a 32 bit architecture), or the IMSAI 8080 (the Intel 8080 is 8 bit), you see the bits grouped by fours.

But then you have things like the Altair 8800, which is also 8080-based, and which awkwardly groups the bits in groups of 3 anyway, which does not even fit. So now I wonder how common exactly octal was even for multiple-of-4 bit machines.

comment 1y ago · link · parent

The very excellent "Advent of Computing" computer history podcasts had an episode involving The Story of Mel relatively recently: https://podcasts.apple.com/us/podcast/acting-up/id1459202600...

It provides a lot of context, and puts things into perspective.

Note that it helps to be familiar with The Story of Mel before listening to that episode. I think the podcast may have explained The Store of Mel itself in a previous episode that I haven't listened to yet, but I was personally familiar with it already through the usual folklore.

comment 1y ago · link · parent

Several PDPs used 18 bit word sizes (we standardized on 8 bit bytes and multiples for word sizes later on). 18 is not divisible by 4, but it is divisible by 3. An octal digit groups three bits together, just like a hexadecimal digit groups 4 bits together.

comment 1y ago · link · parent

Octal has advantages to be more readable when you are dealing with bits in groups of threes (or multiples), just like the decimal is advantageous when dealing with bits in groups of fours (or multiples).

In UNIX-like systems (and POSIX in general), POSIX permissions are in groups of threes: rwx for user, group, and others. Hence `chmod 777` means "rwx for user, group, others" (i.e. everyone can do everything), `chmod 0644` means "rw for user, r for group and others", and so on.

Before we standardize on 8 bit bytes, there were all kinds of word sizes. Some machines had 18 bit words, for example. 18 is divisible by 3, but not by 4, so octal made more sense for those at least.

comment 1y ago · link · parent

It's often a bit of a choice, though. You definitely can minmax Civilization, Minecraft, or Crusader Kings III. But then you lose out on the creativity and/or role-playing aspect.

In Minecraft, I personally want to progress in a "natural" (within the confines of the game) way, and build fun things I like. I don't want to speedrun to a diamond armor or whatever.

In Crusader Kings, I actually try to take decisions based on what the character's traits tell me, plus a little bit of own characterization I make up in my head.

comment 1y ago · link · parent

Maybe that's why I like Into The Breach so much, and keep coming back to it. It's a turn based strategy game, but one with exceptionally high information, compared to pretty much all the rest. You even fully know your opponent's entire next move!

But every turn becomes a tight little puzzle to solve, with surprisingly many possible outcomes. Often, situations that I thought were hopeless, do have a favorable outcome after all, I just had to think further than I usually did.

comment 1y ago · link · parent

And not just for audio. In fact, I don't care about audio that much, and they're still some of my most treasured technical books (I have them in print form, and still reference them online pretty regularly).

Those changed my life, in a sense. Not my professional life, but outside of work it led me down a deep rabbit hole into mathematics, digital signal processing, and even analogue electronics and some light RF engineering. (This is not relevant to my professional life, since I started to take great care not to make any more of my hobbies my job.)

I spent endless hours thinking about this stuff on my commute, and hunched over Matlab.

The other book I recommend is Richard G. Lyons "Understanding Digital Signal Processing".

comment 1y ago · link · parent

Yeah, but in practice you only get that in a perfect vacuum.

comment 1y ago · link · parent

If you look at the previous posts on the topic, this seems to be an ongoing series of posts.

comment 1y ago · link · parent

Both rust and C are also much, much less error-prone than assembly. It is so, so easy to get things wrong in assembly in very subtle ways. That’s one of the main drivers while people are only writing assembly today when they absolutely have to.

comment 1y ago · link · parent

"Hmm...I like when the assembler don't steps in my way and assumes that I know what I'm doing. Thats the reason why I don't like C, and prefer assembler. But when you like it, have fun!"

comment 1y ago · link · parent

Sure, but “JavaScript [is] utterly broken, incapable of executing the simplest programs without errors” is a bit much. I find it hard to believe that even when I’m completely out of touch, I’d say that about a language that people are obviously productive in (as much as I hate JS myself).

But apparently I didn’t get the hyperbole.

comment 1y ago · link · parent

I’m well aware of all of those things (I program modern assembly for a living, and witnessed the evolution of JS), but the quote was “JavaScript [is] utterly broken, incapable of executing the simplest programs without errors”, which is a bit more extreme than what you’re describing.
1
789
98