• 0 Posts
  • 181 Comments
Joined 1 year ago
cake
Cake day: June 11th, 2023

help-circle

  • I suppose it depends on the language? For the most part I think you’re right. Exceptions are only used (if at all) in situations where a program diverges unexpectedly from its normal flow. But take a language like Python. They’re just everywhere. Even your plain old for loop ends on an exception, and that’s just business as usual.


  • I can’t say too much about it but we’re in the mining sector.

    And yeah, if I had to do it all over again from scratch, I’d definitely be looking at a real-time OS. There just weren’t many options back in the day besides coding it all yourself. Even now, I’d have to benchmark the OS to see what its latency is actually like? We had it down in the microseconds range with our custom OS but if it’s more like milliseconds with an off-the-shelf OS, for example, that would change the whole ball game.


  • Well we built some instrumentation around it at work back in the 90s and still use it today. It was ahead of its time. It had hardware loops, a hardware call stack, hardware circular buffer addressing, and a DMA controller. In one instruction, you could do 2 FPU operations and a memory move with a DMA transfer going on in the background. It was an insane architecture. And it could handle 3 separate memory spaces, so even though it’s a 32-bit chip, you could access well over 4 GB of RAM.

    The best thing about chips of that era though is you could tell ahead of time exactly how long your code will take to execute. Like you just type numbers into a spreadsheet and add up the instruction cycle counts. That kind of analysis is hopeless these days, but it informed the design of the instrument. More recently, we’ve been looking at RISC-V for a newer generation, but it’s harder to predict ahead of time how it will perform?












  • One time I was in Mexico with my wife while our daughter was still a baby and the lady at the front desk of the hotel where we were staying offered us a crib we could borrow. It was a kind gesture, but I was a little concerned because the crib seemed wobbly. I realized there were some screws loose but though I had a multitool on me, the holes were stripped.

    So later, I was talking with a local and he’s like “I can fix that.” He comes over and pulls a pack of toothpicks out of his pocket. He sticks one into each hole and breaks it off so that it’s not sticking out anymore. Then he drives the screw back in. I shook the crib after that and it was rock solid!

    Now I always keep some toothpicks handy. Fast-forward to just this year. My daughter is now an adult living in a condo, and was complaining the screw popped out of a kitchen cabinet door when her roommate yanked on it too hard. “I can fix that.”


  • The thing about the MPW Shell is it was sort of the only game in town if you actually wanted a command line with the classic Mac OS. (There’s an awesome little emulator called SheepShaver if you ever want to explore it btw.) Well, I suppose there was A/UX. I thought it was a miracle when that came out. You have to realize in those early days a good chunk of the operating system itself was actually baked in to ROM. (You had to do desperate things to squeeze a GUI out of such limited resources as existed back then!) So to this day I have no idea how they managed to spin off a 'nix despite that.

    Anyways. I wonder, if you made some sort of template format today, to what extent you could write some sort of conversion tool that would scrape a man page or whatever to rough it in and then you could tweak it to get what you want? man pages aren’t super standardized in their format I guess, so it’s probably more trouble than it’s worth. I like to use Python’s argparse when rolling out scripts myself, and its --help format is pretty rigid given that it’s algorithmically generated. Might be more plausible with something like that? I had a quick look just now to see if you can drill down into the argparse.ArgumentParser class itself to pull out the info more directly, but it seems a rather opaque thing that doesn’t expose public APIs for that. Oh well…


  • This reminds me of something from my ancient past. Back in the early-ish days of Apple, there was a development system called MPW (Macintosh Programmer’s Workshop) which included its own little kludgy shell.

    The weird thing about it though was while you could enter commands on the command line like in any shell, you could prefix them with the word commando (presumably a portmanteau of “command” and “window”) and this window would pop up showing various buttons, checkboxes, etc. correponding to command line options. When you ok’d the window, it would generate the command line for you.

    I’m rather hazy about how all this worked, but I think there was some sort of template language to define the window layout if you wanted to add commando support for your own tool? And presumeably, as you say, you could restrict what’s possible with the window interface as you deemed fit?



  • You mean like the comment fields we’re using right here on lemmy?

    As others have pointed out, it’s usually some markdown that’s embedded within the text. Lemmy is using a format that’s actually called “markdown” if I’m not mistaken, or a slight variation/subset thereof.

    I’ve gotten used to the double-star for bold and what not to the point that it annoys me when some message client or whatever doesn’t support it. I share code snippets with people fairly often, and the code markdown is particularly useful to maintain its legibility.


  • You can always combine integer operations in smaller chunks to simulate something that’s too big to fit in a register. Python even does this transparently for you, so your integers can be as big as you want.

    The fundamental problem that led to requiring 64-bit was when we needed to start addressing more than 4 GB of RAM. It’s kind of similar to the problem of the Internet, where 4 billion unique IP addresses falls rather short of what we need. IPv6 has a host of improvements, but the massively improved address space is what gets talked about the most since that’s what is desperately needed.

    Going back to RAM though, it’s sort of interesting that at the lowest levels of accessing memory, it is done in chunks that are larger than 8 bits, and that’s been the case for a long time now. CPUs have to provide the illusion that an 8-bit byte is the smallest addressible unit of memory since software would break badly were this not the case, but it’s somewhat amusing to me that we still shouldn’t really need more than 32 bits to address RAM at the lowest levels even with the 16 GB I have in my laptop right now. I’ve worked with 32-bit microcontrollers where the byte size is > 8 bits, and yeah, you can have plenty of addressible memory in there if you wanted.