HNHacker News
TopNewBestAskShowJobs

adamnew123456

70 karma · joined May 20, 2020

submissionscomments
adamnew123456··on Async Programming Is Just Inject Time
> Well, most architectures do not use plain jumps with implicit arguments for function calls, but have explicit call/ret or branch-with-link instructions.

Anyone who wants to go deeper on this would be well served doing some reading on "return oriented programming" and shadow stacks / control flow integrity. I got turned onto this by a few LWN articles that talk about the subject (https://lwn.net/Articles/940403/ among others).

It turns out that "jump to this pointer" is actually a dangerous construct, and it's not something you get much high-level exposure to since functions as an abstraction are so unleaky.

adamnew123456··on DEC64: Decimal Floating Point (2020)
> Languages for scientific computing like FORTRAN provided multiple floating point types such as REAL and DOUBLE PRECISION as well as INTEGER, often also in multiple sizes. This was to allow programmers to reduce program size and running time. This convention was adopted by later languages like C and Java. In modern systems, this sort of memory saving is pointless.

More than that, the idea that anyone would be confused about whether to use integer or floating-point types absolutely baffles me. Is this something anyone routinely has trouble with?

Ambiguity around type sizes I can understand. Make int expand as needed to contain its value with no truncation, as long as you keep i32 when size and wrapping does matter.

Ambiguity in precision I can understand. I'm not sure this admits of a clean solution beyond making decimal a built-in type that's as convenient (operator support is a must) and fast as possible.

But removing the int/float distinction seems crazy. Feel free to argue about the meaning of `[1,2,3][0.5]` in your language spec - defining that and defending the choice is a much bigger drag on everyone than either throwing an exception or disallowing it via the type system.

adamnew123456··on JVM Anatomy Quarks
I would say less overuse of final, more underuse of interfaces. If everything takes/returns/stores values by interfaces (excluding data containers with no behavior) then you don't need to "jailbreak" any class to mock it.

Of course you get code bloat defining interfaces for everything you intend to implement once, and you have to enforce these rules, but this is something that could be made easier. Not in Java, but imagine a language where:

- Concrete classes can only be used in new, or in some platform provided DI container.

- Methods can only accept interface types and return interface types.

- Fields are private only, all public/protected is via properties (or getters/setters, it just has to be declarable in an interface)

- You have a ".interface" syntax (akin to ".class" but for types) that refers to the public members of a class without tying you to the concrete class itself. You can use this as a shorthand instead of declaring separate interfaces for everything.

Eg.

```

final class GDrive { ... }

public Download file(GDrive.interface drive) { ... }

class MockDrive implements GDrive.interface { ... }

```

The closest I can think of is a hypothetical typed variant of NewSpeak, but maybe something like this exists already?

adamnew123456··on The Internet Archive is back online
No such luck :( Both the bt1.archive.org and b2.archive.org trackers appear to be down.

magnet:?xt=urn:btih:1814b8e2673e8a4547fd9c4f1a417b05860230b4&dn=MIT_Structure_of_Computer_Programs_1986&tr=http%3A%2F%2Fbt1.archive.org%3A6969%2Fannounce&tr=http%3A%2F%2Fbt2.archive.org%3A6969%2Fannounce&ws=https%3A%2F%2Farchive.org%2Fdownload%2F&ws=http%3A%2F%2Fia600204.us.archive.org%2F15%2Fitems%2F

adamnew123456··on The Internet Archive is back online
I seed a torrent of the SICP lectures that originally came from IA, I'll have to see if that's still up and if there's some way of getting the other torrents from the tracker.

If you're lucky there's other seeds around, and not just the IA web seeds which (I assume?) are down too.

adamnew123456··on Coffee Stats – Maximize Caffeine Intake and Get to Bed at Night
They only have Windows binaries, but it's just Python 3 with Tkinter. Should work anywhere if you have a GUI-enabled Python (eg python3-tkinter).
adamnew123456··on New study simulates gravitational waves from failing warp drive
> and the nucleus of an atom or neutron star has a density on the order of 4x10^17...if you can build the entire ship out of pure neutrons, you're still coming up short by a factor of ~100

Would you be getting into black hole territiry at that density?

adamnew123456··on What's new in Emacs 29.1
Have MS managed to figure out window snapping for WSLg yet? From what I've heard (maybe this is dated) there are a bunch of limitations that come from them using a primitive compositor for their Wayland setup.

Xpra (or even a full X server, if you don't mind losing X clients on sleep) has been a lot better on the integration front.

adamnew123456··on Fast machines, slow machines
> GIMP will stall for 10-15 seconds at startup looking for XSANE plugins. Apparently it's calling some external server, bad in itself, and that external server is slow. Worse, this delay stalls out the entire GUI for both GIMP and other programs.

Do you remember where you came across that explanation?

I'd be very surprised if it weren't something like an mDNS query with a high timeout. Which is it's own problem (ideally it'd be async), but a far cry from it trying to access something on the internet.

adamnew123456··on Come back, c2.com, we still need you
Huh, my other pages don't have the same issue. I guess the search indexer must've died - I'll restart it in an hour or two.

FWIW, the snapshot of c2 that this runs off of is somewhat dated (https://archive.org/details/c2.com-wiki_201501), so the last ~7 years of updates after the move to the federated wiki aren't present.

Does anyone know where these original pages ended up in fedwiki after the migration?

adamnew123456··on Learning Chess at 40 (2016)
You might find Chess960 interesting then. The starting position is randomized, with enough variations that memorizing an opening book no longer really helps. You have to start evaluating the board from move 1 in the same way that you do 20 moves later.
adamnew123456··on The Hipster PDA (2004)
> I think I’ve had more trouble with data loss from Evernote than those index cards, ironically…

Plain text file and a text editor app, assuming rich content isn't a requirement. There are a million of them - personally, I've never had OldSchool Editor eat my data.

adamnew123456··on Running GUI apps within Docker containers
I looked into the equivalent setup for WSL a while ago. The thing I could never solve was: how to manage the hosts windows via the virtual environment's WM? Without the integration that setup is just extra config for no gain.

Because if most tools belong to the VM, then just run a VM in full screen and use that. No need to have the display server shared if you're using mostly Linux tools that display on the VM's X server.

adamnew123456··on Installing Windows and Linux into the same partition
In case anyone wants more detail on the internals:

The initramfs is the first root filesystem a Linux system has but it resides entirely in RAM. It's initialized using an archive stored on disk, but after that point can be modified freely without touching disk at all. Very much like /tmp in distros that store /tmp in memory.

initramfs is mostly for loading stuff required for booting the system. Usually these are storage related - maybe your root filesystem lives on a disk that's encrypted, backed by RAID, etc. and it requires a password or some modules that aren't baked into the main kernel image. If you include these modules/config/etc. in your initramfs and the initramfs's init (it has a distinct init from your main system, usually a shell script) knows about them then they can be used to bootstrap your root filesystem.

Of course, it requires that the initramfs be stored on a filesystem whose code is baked into the kernel. ex2 is/was a popular choice, as well as the UEFI system partition (basically FAT). Both simpler filesystems that don't bloat the kernel too much.

Once you've mounted a filesystem of some kind in the initramfs, you call pivot_root and the root filesystem switches from being the initramfs to being whatever filesystem the initramfs mounted. Then you can exec that filesystem's init and get the full system up.

Or you could just stop in the initramfs. Usually they just contain busybox and some other system binaries so they're not practically useful, but at one point I experimented with including a Lisp there. It never ran on real hardware but I was able to boot to an SBCL REPL via QEMU, which was pretty cool. The next step was Emacs but that didn't work out for reasons I don't remember clearly.

[1] https://wiki.debian.org/InitramfsDebug

adamnew123456··on Debit cards are hidden financial infrastructure
It has to do with how long you expect a given dollar to live.

Below a certain point a dollar doesn't persist very long since you're mostly living paycheck to paycheck. If you're spending most of what you earn, then what matters is that you can pay for all the essentials. It doesn't really matter what the price is in absolute terms if your paycheck keeps pace.

(It would be really weird to cash your paycheck, buy some ETFs with it, then sell them all back a week later to pay rent and buy groceries. You'd just get back what you put in.)

Higher up a given dollar lasts a lot longer. Even the dollars in a retirement fund will last for decades - imagine if you were wealthy enough that 95% of your assets were like that. At that point you have two choices:

- Either keep it under a mattress, and lose a few percent of most of your money each year

- Or put it somewhere more active, where you have enough growth to keep pace

adamnew123456··on Micro – a modern and intuitive terminal-based text editor
> Maybe I'm going to piss many people off here, but vim is not an user-friendly text editor. An user friendly editor should pop some kind of prompt when I pressed the first g/G key and show me what I could press the next, not telling me to read :help (which probably has the volume of a dictionary at this point).

For anyone that wants this: these kinds of plugins are usually called "which key" after the Emacs mode. Most of the Emacs distros ship with which-key by default and it works very well with evil.

I get the sense that they're less popular on the Vim end, though I'm not sure why.

adamnew123456··on No, we won’t have a video call for that
I've noticed a similar pattern at $JOB - we started doing a daily "WFH status call" in early April last year. There was nothing like it previously, just a weekly report on important bugs, support items, etc. that we worked on. And the occasional (less than weekly) meeting which would include the PM and dev team.

The calls started out shorter but over time they've become a hybrid of:

- "Here's the outlay for today." The shortest are just this which only happens when things are going smoothly and everyone's tackling things of moderate difficulty.

- "Here's something that's been giving me trouble" which prompts a few minutes discussion. Usually someone has a idea to pitch in which gets the person unstuck, but it can bleed into...

- "I wanted to bring up this thing I noticed" which pulls us into a bigger half-hour discussion with some possible followups scheduled with the more senior members.

So at the extremes, any given instance of this meeting could last from 10 minutes to 45 minutes.

We usually refer to this as a "stand-up" but I could see how someone from a more regimented team would understand it to be something with a more tightly defined purpose.

adamnew123456··on Self hosting is important
> No way to get around it.

Well...none of them are particularly easy, compared to punching holes in your local firewall. CGNAT takes you one step closer to digital serfdom (all hail our managed lords!)

That said, I'd say IPv6 would work if you have a public address and a tunnel broker for v4 only networks. Failing that, some kind of overlay (maybe a .onion?) or a reverse tunnel from someone who does have a public v4 address.

adamnew123456··on Looking Glass: Run a Windows VM on Linux in a window with native performance
Not PS/Office (more of a dev workflow - VS, Intellij, DB admin tools), but I've personally found that straight KVM with the default virtual hardware is good enough. The last big adjustment I made was getting a dedicated SSD for the Windows VM and using it instead of the native file images.

Totally stable - 8hrs per day over the last 16 months with 1 hiccup - and no performance complaints. I'm not doing anything graphically intensive though so virtual display hardware isn't a bottleneck.

Most of my gaming is just Proton on the host system these days.

adamnew123456··on Gooey: Turn almost any Python command line program into a GUI application
I personally have no desire to use it outside of Windows, but Powershell fixes all there things if you're so inclined:

> flags are inconsistent

At least among the core command set, there is a set of "core flags" like -ErrorAction or -Verbose that are consistent. Though I don't know how often you'll find them in third-party commands.

> case sensitive

There's a preferred case that you'll get if you tab complete, but -Verbose is -VERBOSE is -VERBOSE.

> not good discoverable

Tab completion works for flags everywhere and each of them should be included in Get-Help regardless of if the author documents them.

adamnew123456··on It is 2018 and this error message is a mistake from 1974
You're thinking of /dev/dsp, which was an OSS thing before the move to ALSA. It still exists on the BSDs AFAIR but has to be emulated on modern Linux: https://unix.stackexchange.com/questions/103746/why-wont-lin...
adamnew123456··on Where does a candle go when it burns?
I guess that's where the What If blog went, it hasn't been updated for a while now. No timestamps on the last post but wiki says he started writing this column for NYT late 2019, which feels about right.

https://what-if.xkcd.com/

adamnew123456··on Commits are snapshots not diffs (2020)
I guess I'll be the one to make the obligatory "magit is awesome and if you use Emacs you should definitely check it out" comment.

Other that being horribly slow on Windows I can't think of any downsides. Aside from the very rare black magic incantations it does everything I've needed from a Git frontend.

If something like it existed for SVN ($JOB VCS of choice, sadly) I would abandon Tortoise in a heartbeat. IntelliJ is nice but the overhead of the VCS add-ons kill my startup time.

adamnew123456··on This Blog is now hosted on a GPS/LTE modem
Seeing the ShadySIM project mentioned on that page reminded me of this DEFCON talk, which talks about some of the capabilities of the SIM OS (some of them run Java!) and what power they grant you over phones if you have control over the underlying cell network (legitimately or otherwise).

https://www.youtube.com/watch?v=31D94QOo2gY

adamnew123456··on Why inflation is not a threat
> That's madness - I can't imagine why they'd do that.

I think your confusion is in assuming that this is something you do rather than it being the status quo that receives no attention.

Up until recently I had about $80k sitting in a HYSA while interest rates on that account dropped like a rock. I only really noticed that after crunching the numbers and figuring out that was much beyond what I would realistically need. It took a few days to figure out what I could do about that given my income and employment situation.

I'm not sure how much of this applies to someone who is natively middle-class, but I find that part of the luxury of having a good income and a minimal lifestyle is just not thinking about money. If that's where your baseline is then you need some other motivation to scrutinize your finances. It comes more easily to me because I find it interesting but I can see someone without that drive just letting cash sit and being satisfied that the number looks big enough.

adamnew123456··on Shops return to rural Sweden but are now staff-free
Agreed. I find it easier to interact with people in service situations if they're responsible for the whole experience. The point of going to a restaurant or a barbershop or getting take-out is that you're leaving the whole process in someone else's hands.

A checkout clerk just feels like a weird adjunct to the whole process. I walked to the store, pushed the cart around and grabbed all my items, yet somehow someone else has to do the quickest and easiest part for me?

adamnew123456··on LinkedIn’s Alternate Universe
> Even on a mostly non-algorithmic feed like Reddit, the highest upvoted comments on popular subs always feature an extremely predictable response, like a dad joke, followed by similarly predictable sub-comments written solely to garner upvotes.

The subreddit simulator is a good proof of this, especially once it was rebased on top of GPT-2. Generally, the closer a subreddit is to the top of the list the more it's content will look like the output of the language model.

adamnew123456··on WindowTabs: Browser-style tabbed window management on the desktop
A sibling comment mentioned Sway, and I've also used this on both Fluxbox and i3. I would be surprised if Awesome didn't have it as well.

The only problem is that (at least in Fluxbox's case) it suffers from poor discoverability, since it's a modifier to the window drag action that has no corresponding buttons or "landing zones" like what you get if you try to tear tabs out of a Firefox window.

adamnew123456··on Let's Not Dumb Down the History of Computer Science (2014)
I'm not sure fad is the right descriptor here. Unix WMs have had virtual desktops since the 90s (80s?), MacOS got them around 2006 and Windows in 2015.

Use by the non-initiated may not be that high, but that shouldn't be surprising given that user education is a very scarce resource and it's being spent elsewhere.

adamnew123456··on A rabbit hole full of Lisp
The Advent of Computing [1] podcast recently put out their episode 47 which I think provides a sort-of explanation of this line of thinking. The short answer is that the context in which Emacs was originally developed (a contemporary of Unix, and not Unix itself, which was something I wasn't aware of before) emphasized user power and lack of restriction to a much greater degree than much of the current computing landscape does. Why would you lock users or developers into a fixed, defined plugin API when you could write the application in such a way that they have access to whatever they need?

Excluding maybe NodeJS, most of the Javascript you encounter is going to be executed by a browser which has a whole ton of sandboxing and mitigation mechanisms to prevent the big bad web from abusing your computer. I don't blame it for working that way given how few trustworthy (I mean really trustworthy, as in "free range within $HOME") actors exist on the web these days, but one wonders how far we could take the web ecosystem if we tossed the idea of granting special access through WebGL or WebUSB and just gave the browser full access to calling C or executing processes on your system.

Don't get me wrong - it would be a security nightmare, but there's a cost to trying to guarantee security through mechanism rather than trust.

[1] https://adventofcomputing.libsyn.com/episode-47-its-open-com...

Page 1 of 2Next →