Readit News logoReadit News
bodyfour commented on CO2 Battery   energydome.com/co2-batter... · Posted by u/xnx
conradev · a month ago
Lithium-ion batteries are falling in cost so rapidly that any new process being ramped up is risky business. Form is way further along than this landing page and yet has a long way to go:

https://www.latitudemedia.com/news/form-energy-brings-in-mor...

The scale of investment required makes it quite hard for new companies to compete on cost:

https://www.theinformation.com/articles/battery-industry-sca...

bodyfour · a month ago
The one exception I'd make to this is Sodium-ion which does seem to have some chance of reaching manufacturing scale: https://www.batterytechonline.com/materials/5-key-takeaways-...
bodyfour commented on Stdio(3) change: FILE is now opaque   undeadly.org/cgi?action=a... · Posted by u/gslin
cryptonector · a month ago
In SunOS 4.x `FILE` was not opaque, and `int fileno(FILE *)` was a macro, not a funciton, and the field of the struct that held the fd number was a `char`. Yeah, that sucked for ages, especially since it bled into the Solaris 2.x 32-bit ABI.
bodyfour · a month ago
Indeed, that was the way it originally worked in all UNIXes: https://github.com/dspinellis/unix-history-repo/blob/Researc...

It was a then-important optimization to do the most common operations with macros since calling a function for every getc()/putc() would have slowed I/O down too much.

That's why there is also fgetc()/fputc() -- they're the same as getc()/putc() but they're always defined as functions so calling them generated less code at the callsite at the expense of always requiring a function call. A classic speed-vs-space tradeoff.

But, yeah, it was a mistake that it originally used a "char" to store the file descriptor. Back then it was typical to limit processes to 20 open files ( https://github.com/dspinellis/unix-history-repo/blob/Researc... ) so a "char" I'm sure felt like plenty.

bodyfour commented on Understanding the Origins and the Evolution of Vi and Vim   pikuma.com/blog/origins-o... · Posted by u/amosjyng
bodyfour · 4 months ago
> The creator of MINIX, Andrew Tanenbaum, asked the community to choose between Stevie and Elvis to be adopted as the main text editor for their OS. Elvis was chosen and it's the default text editor on MINIX until today.

Point of order: Minix switched to BSD nvi in 2013 https://github.com/Stichting-MINIX-Research-Foundation/minix...

Not that it matters -- Minix itself hasn't had a commit since 2018 -- but the last five years of its life were spent without Elvis

bodyfour commented on Live Map of the London Underground   londonunderground.live/... · Posted by u/LourensT
n4r9 · 5 months ago
It's cool to see how fast the trains go on different lines. But... where's the Elizabeth line? You get the tooltip when you hover over it, but the polyline is missing.
bodyfour · 5 months ago
Waterloo&City seems to be missing too
bodyfour commented on Make C string literals const?   gustedt.wordpress.com/202... · Posted by u/ingve
Dwedit · 5 months ago
Wait, C string literals are not already const? On many platforms, they live in a read-only data section, which is write-protected memory.
bodyfour · 5 months ago
The issue is that "const" didn't exist in the earliest forms of C... and even when it became available not everybody started using it.

So you might have a function that doesn't have proper "const" qualifications in its prototype like:

  void my_log(char *message);
and then call-sites like:

  my_log("Hello, World!");
...and that needed to stay compiling.

bodyfour commented on Mac Mini G4 – The best « classic » Macintosh for retro-gaming?   xtof.info/MacMiniG4-the-b... · Posted by u/freediver
p_ing · 8 months ago
NetBSD yes, but 32-bit Linux distros are getting rare. Adélie Linux is one of the few that has current releases of software.

https://www.adelielinux.org/download/

bodyfour · 8 months ago
A few months ago I happened to install Debian/unstable on a G4 mini. ppc32 is no longer a supported architecture -- purely "what you get is what you get".

Still, the process was mostly painless. Everything I needed worked out of the box.

bodyfour commented on So thieves broke into your storage unit again   oldvcr.blogspot.com/2024/... · Posted by u/goldenskye
bodyfour · a year ago
What is annoying to me is that in this internet-connected age, the storage units I see still don't have better per-unit security.

Just a phone alert to say "door to unit #xyz has been opened" would be a huge improvement. Wire up a cheap webcam for extra credit.

bodyfour commented on C++'s `noexcept` can sometimes help or hurt performance   16bpp.net/blog/post/noexc... · Posted by u/def-pri-pub
Arech · a year ago
That's quite interesting and a huge work has been done here, respect for that.

Here's what has jumped out at me: `noexcept` qualifier is not free in some cases, particularly, when a qualified function could actually throw, but is marked `noexcept`. In that case, a compiler still must set something up to fulfil the main `noexcept` promise - call `std::terminate()` if an exception is thrown. That means, that putting `noexcept` on each and every function blindly without any regard to whether the function could really throw or not (for example, `std::vector::push_back()` could throw on reallocation failure, hence if a `noexcept` qualified function call it, a compiler must take into account) doesn't actually test/benchmark/prove anything, since as the author correctly said, - you won't ever do this in a real production project. It would be really interesting to take a look into a full code of cases that showed very bad performance, however, here we're approaching the second issue: if that's the core benchmark code: https://github.com/define-private-public/PSRayTracing/blob/a... then unfortunately it's totally invalid since it measures time with the `std::chrono::system_clock` which isn't monotonic. Given how long the code required to run, it's almost certain that the clock has been adjusted several times...

bodyfour · a year ago
> in that case, a compiler still must set something up to fulfil the main `noexcept` promise - call `std::terminate()`

This is actually something that has been more of a problem in clang than gcc due to LLVM IR limitations... but that is being fixed (or maybe is already?) There was a presentation about it at the 2023 LLVM Developer's meeting which was recently published on their youtube channel https://www.youtube.com/watch?v=DMUeTaIe1CU

The short version (as I understand) is that you don't really need to produce any code to call std::terminate, all you need is tell the linker it needs to leave a hole in the table which maps %rip to the required unwind actions. If the unwinder doesn't know what to do, it will call std::terminate per the standard.

IR didn't have a way of expressing this "hole", though, so instead clang was forced to emit an explicit "handler" to do the std::terminate call

bodyfour commented on The Elegance of the ASCII Table   danq.me/2024/07/21/ascii/... · Posted by u/thewub
augusto-moura · a year ago
Useful tip, on linux (not sure about other *nixes) you can view the ascii table by opening its manpage:

  man ascii
It's been useful to me more than once every year, mostly to know about shell escape codes and when doing weird character ranges in regex and C.

It can be a bit confusing, but the gist is that you have 2 chars being show in each line, I would prefer a view where you see the same char with shift and/or ctrl flags, but you can only ask so much

bodyfour · a year ago
> not sure about other *nixes

Should be available on any UNIX, it was added to V7 UNIX back in the 1970s: https://github.com/dspinellis/unix-history-repo/blob/Researc...

Even before that, it existed as a standalone text file https://github.com/dspinellis/unix-history-repo/blob/8cf2a84... This still exists on many systems -- for instance as /usr/share/misc/ascii on MacOS

bodyfour commented on A RP2040 based DECstation 3000 emulator that can run DECWindows   github.com/rscott2049/DEC... · Posted by u/dmitrygr
nyrikki · a year ago
I ran over 1200 domains and the POP server for the largest ISP in a medium city on a single 3100, not on NT obviously, osf/1
bodyfour · a year ago
Surely you mean Ultrix, not OSF/1? Unless you're misremembering the hardware model...

u/bodyfour

KarmaCake day1815December 17, 2010View Original