HNHacker News
TopNewBestAskShowJobs

deckard1

4,463 karma · joined September 18, 2015

submissionscomments
deckard1··on Even if you can't write assembly, you can read disassembly
I asked it for Hello World and it got that wrong. It left out the exit syscall required at the end, which meant the CPU would continue executing until it hit a seg fault.

A few weeks later I found the exact blog post that ChatGPT copied from, down to the blog article explaining how the exit syscall was required and was intentionally missing from the first step as a pedagogical exercise. But of course ChatGPT won't know that.

If you know assembler, it's much easier and safer writing it yourself. If you don't don't assembler, you're doing stupid and dangerous things and should immediately stop.

deckard1··on Even if you can't write assembly, you can read disassembly
x86 doesn't have thousands. That's overstating it by quite a bit. The assembler I wrote contains 1095 encodings. It's from ~2004 but 100% complete at the time, so sure new instructions have been added since. But those are encodings. SAL has like 8 encodings, SAR has 12, CMP has 14, etc. These encodings are just different ways to use the same opcode but with different source/target parameters (8/16/32-bit immediates or registers, etc.)

Someone wrote a script that disassembled all the binaries on their Linux machine and counted the number of actual instructions used (mostly by gcc, of course). Only a tiny fraction of the total instructions were used:

http://0x80.pl/notesen/2014-01-01-instruction-utilization.ht...

Just take the top 30 of that chart and learn those. The x86 contains a lot of instructions that no one needs to worry about. Things related to the ancient segment mode or x87 floating point, OS-privileged instructions (context switching, HLT/LIDT/etc.), AMD-only 3DNow, etc.

The ISA is not the hard part anyway. Dealing with the ABI (System V on Linux) to interface with C/C++ code, the kernel syscall interface, position independent code/executable (PIC/PIE) are somewhat bigger concerns and are going to apply to RISC as well.

deckard1··on Ask HN: What lesser-known accessories do you use with your computer?
I have an XP-Pen as well. Works great in Linux. I'm still amazed at how high quality these non-Wacom tablets are today. I had one of those cheap 6" Wacom Graphites back in the early 2000s and that was the best you could get. My XP-Pen blows that thing away. Still haven't found a great place to put it though. I'm just stashing it off to the side but it's awkward moving it around all the time.

If you're on Linux, Gromit-MPX is a great companion app to annotate anything on your desktop. https://github.com/bk138/gromit-mpx

deckard1··on Why MMAP in llama.cpp hides true memory usage
this is probably the best source to actually understand how memory works in Linux:

https://manybutfinite.com/post/anatomy-of-a-program-in-memor... [1]

You can't really understand mmap/sbrk without understanding virtual memory and process space layout.

[1] Images are broken. Just open https://static.duartes.org/img/blogPosts/kernelUserMemorySpl... and go to advanced and "Proceed to static.duartes.org" to workaround their https issues. The duartes.org host is owned by the blog author. Refresh the blog article and images should load now.

deckard1··on Twitter's Recommendation Algorithm
It would also be a total Elon move to confuse the open sourcing of Twitter's internal code with actual transparency.

You would need, at a minimum, a neutral third-party audit of Twitter's servers to conclude that the source code we see on GitHub is, in fact, the source code running Twitter. How often will they keep their GitHub repo in sync with their internal code, I wonder.

Presumably Twitter uses a version control system. But they scrubbed the history so that's also a point against their "transparency" claims. Without knowing the when and the why of changes you can't understand what you are looking at. People are pointing to that "author_is_elon" without knowing whether that was done before Elon bought Twitter or after.

But even then, git history can be faked.

> This is a great thing.

I disagree. It's the opposite. It provides the illusion of openness without the quality of openness, thus killing the debate once and for all.

deckard1··on Google denies training Bard on ChatGPT chats from ShareGPT
Terms of Service, Terms and Conditions, and Terms of Use are all the same thing. There is no legal difference between them.

> that’s not a feature of the content, but the acquisition route.

It's neither. It's a feature of contract law.

deckard1··on Google denies training Bard on ChatGPT chats from ShareGPT
You think OpenAI is going to care unless you have a team of expensive lawyers to back you up?

Microsoft is out there laundering GPL code with Copilot. These companies live firmly in the don't give a fuck region of capitalism. Copyright law for thee, not for me.

deckard1··on The FTC wants to ban tough-to-cancel subscriptions
My dad got a Westgate timeshare back in the '90s. I was there when he was conned. And even at the young age I knew the salesman was the sleeziest guy on Earth. He drove us around in their limo to impress us, showing us their property. The way he talked just felt slimy.

My mom recently told me they tried to book their week at the timeshare and were told they would have to pay $1,000 to do so. Because it's a premium week or whatever bullshit. It's absolutely insane this predatory company is allowed to continue. I'm going to be forced to deal with this fucking thing when he dies. That's the truly insane thing. It's treated as property, but it's not. It's a fucking subscription that you can't cancel. Ever. You own nothing.

deckard1··on Research shows we can only accurately identify AI writers about 50% of the time
There is an environmental difference. Today we are inundated with information, much of it text.

People are constantly reading today. Text messages, emails, Facebook posts. But these are all low-quality. Additionally, messages have to be concise. If someone at work emails me and it's longer than a Tweet, I'm not reading it. I don't have time for it and, if it's like the majority of emails I receive, it's irrelevant anyway.

As information noise goes up, attention spans go down. Which means flowery language, formality, and long text starts to disappear. When I've been reading on a computer all day for work, do I have the patience and energy to read a long book at home? Or would I rather watch a movie and relax.

But here's the silver lining I'm hoping for: AI could be a way out of this mess. AI can sift out the noise from the signal. But it has to be on the personal level. Open source, self-hosted, private. No corporation slanting the biases.

There are a lot of interesting implications here. Much like it's impossible to get a human on the phone when calling up your wireless provider, it may become difficult to reach other humans. To "pierce" their AI shield, that protects them from The Infinite Noise.

deckard1··on My thoughts on “bad code”
> they realised there's a good reason the legacy code is the way it is. I was certainly guilty of this too when I was a junior/mid.

It's one thing for a junior dev to do this. But try working with a bunch of amateurs that somehow got promoted to lead because they kind of worked with some technology at their prior job. It's amazing watching a company replace domain expertise with superficial framework-of-the-day knowledge. Especially knowing that these devs will move on in a year escaping the consequences of their actions.

deckard1··on My thoughts on “bad code”
The Linux kernel still uses centralized exits in places, with goto to do cleanup.

https://github.com/torvalds/linux/blob/master/Documentation/...

deckard1··on TextSynth Server
I'm not at all worried, either. Because I know we already went through this. Companies tried to outsource their work to India, the Philippines, and elsewhere, and it ended in tears and expensive reversals of strategy. They discovered that someone has to check all the work.

No one wants to pay for code reviews. They don't show up on the agile board and we all collectively pretend they are "freebies" the devs give out to the company. Just like unit tests and all the other shit that we just expect devs to do in their spare time between 3 hour meetings and feature work.

I can see ChatGPT being an augmentation. But that only works because you have a human dev that does the merging and can take the blame if their code goes wrong. Remove that human and you're staring into the abyss.

deckard1··on TypeScript 5.0
silly things, mostly. Redux used them such as "@connect" if I recall. But I haven't touched those in awhile. Other team members invented various ways to use them, but none ever seemed to make things clearer or save much typing.
deckard1··on TypeScript 5.0
I don't think decorators being a proposal matters at this point. I know I've been using them for 5+ years now, and libraries such as NestJS already use them extensively.

If you like them, you're probably already drowning in them. Me, personally, I could take them or leave them.

deckard1··on Show HN: Modern Font Stacks – New system font stack CSS for modern OSs
> that the user is used to

That's not the point of typography or design. People are used to Comic Sans. That doesn't make it a good choice. Some designs call for something that stands out in a unique way.

If you are going to the trouble of finding an "atmosphere" for your site and researching the fonts you are using then why just throw that all out with a "stack" and sort of kind of but not really getting it right?

Here's the bigger problem. No two fonts have the same font metrics. Go to the Github page: https://github.com/system-fonts/modern-font-stacks#css-font-.... These fonts are all using the same font size, weight, etc. but they are drastically different. Calibri and DejaVu do not render remotely the same. DejaVu might be readable at a certain size where Gill Sans Nova is going to be rather awful. These are all within the same font stack. Even in the "Preview Rendering" you can see it cheated by having the footnote that says "These fonts have been size-adjusted for easier comparison." How are you planning to do that in CSS? You can't.

All this effort is wasted. You can just pick "sans-serif" and let the user use whatever they have set in the browser. That's better anyway, especially for a blog type layout which is the only layout that would make sense and not completely break with a font stack.

deckard1··on Show HN: Modern Font Stacks – New system font stack CSS for modern OSs
I'm going to be slightly more blunt and say, if you're using a font "stack" then you don't care about typography at all. A large segment of HN seems to hate web fonts with a passion. And I get that. But let's not pretend you can have your cake and eat it too. You may as well just do "serif" or "sans-serif" and be done with it.

For the same amount of effort it takes to research a font stack you could implement a web font loader that uses browser fonts based on prefers-reduced-motion.

deckard1··on What a good debugger can do
> Time-travelling debuggers is really a game changer

Core dumps have existed forever. They give you a stack trace and register values at the time of crash. Even better, you don't need a debugger running at the time of crash and you can dig into dumps sent from nontechnical users.

Sure, Bret Victor's demo was cool. But time travel debugging is so completely oversold at this point that I can't take anyone seriously that mentions it.

deckard1··on You don't need a build step
that sounds needlessly wasteful. You can trivially strip TS out of JS before sending off to the client. You're still going to need to check TS in the build/CI step (i.e. the time consuming part) before doing anything so you've gained exactly nothing.
deckard1··on You don't need a build step
Code reuse. If I need to render on the server (for SEO purposes, as most people do not rely on Google's dubious and unknown JavaScript processing ability) then it makes sense to want to share as much code as possible between the server and the client. If you're doing a single-page-application (SPA) you can also share routing code, as your client will need a way to route to pages client-side.

With that said, I've seen people argue against node APIs and this desire to only use web APIs on the server. I don't get that. Node's API is generally pretty good and using JS as a replacement for Python/Ruby/etc. locally is rather excellent today. You don't need neutered APIs to also write code that works in both client and server. Unless you're selling cloud native bullshit (ahem, Nextjs)

deckard1··on You can watch Pluto TV in VLC, and the MPA considers this piracy
> you agreed to watch ads

How many ads did I agree to? How long? Did I agree for them to harvest and sell my info to 3rd parties? And which ones? Did I agree to Equifax selling out my private info (including salary history) via The Work Number?

These corporations have been stealing from me forever using their lawyer thugs and endless microscopic print while having no option but to say "yes" to everything. Are you going to live without a cellular phone plan in 2023? Or internet? Or a car that is now a SaaS that tracks you via GPS and sells it to god-knows-who. Farmers can't even own their tractors today if John Deere gets their way. The rent-seeking is all a bit too much.

deckard1··on GitHub Packages Is Down
it's amazing how we never learn. Things that Perl and CPAN and Linux distros figured out decades ago are constant issues today. It wasn't that long ago that NPM didn't even have checksums. CPAN runs unit tests on install. I can't imagine how slow that would be with npm.

Package signing is, well... I suppose that's another lesson from the '90s people will learn about soon enough. With a web of trust as broad as python or npm you'll just have everyone running around with signing keys and "trusting" any key they come across because none of it is built on personal relationships. When Archlinux asks me to confirm adding package keys, what am I going to do? Say no? I don't know these people, but I want my shit to work.

deckard1··on GOTOphobia considered harmful in C
> has to write the low level C/ASM code to make it all work

shhh. Let's not disturb those that believe in the GC fairy that sprinkles their code with safety magic late at night while they soundly sleep. Firmware doesn't exist. I can't hear you. Na na na na na na na

deckard1··on GOTOphobia considered harmful in C
> comment lines before subroutines would help.

That code looks normal to me. I have a ton of BASIC books and magazines. You're talking about a time period before full screen text editors were a thing. It's almost impossible to explain to anyone that didn't have to work with TI-99 BASIC, C64 BASIC, GW-BASIC/BASICA, etc. what it was like. Once you got to QBASIC/QuickBASIC it was done. Life was easy. A few years before that, and you're printing out pages on a dot matrix printer and going line-by-line to debug. You'll notice a distinct lack of white space between lines and that comments start with "REM" and a line number. You didn't even get labels for lines. The code looks like that because those were technology limits on really rudimentary devices. You were editing code inside the BASIC interpreter, often using some command like "LIST <line#>". It was awful.

We take so much for granted today. Dual monitors. Color. More than 80x25 character display. Multiple screens and multitasking. Just getting to Linux in '95 and having F1/F2/F3/etc. switching terminals was a huge deal.

deckard1··on Building a Minimalistic Virtual Machine
welcome to the world of Forth/Lisp

It is somewhat sadly ironic that to preserve software one has to actually create software that other people care about preserving. And, as we've seen with emulators, if you have software people care about then there are no roadblocks that will stand in the way of someone figuring out how to get your ancient code to run. I take the whole 100R thing as more an interesting art project than a serious goal. More of a "what if".

With that said, I feel most devs are the same. How often do you come across a lead or senior dev that becomes passive aggressive over people modifying "their" code? Quite often, in my experience. Any code that I didn't write sucks and any code I have to touch that I didn't write is the worst code ever written. Code that I didn't write is old obsolete dog turds and code I wrote is "modern". Every dev slaps "modern" on their open source project today.

deckard1··on Neal Stephenson doesn't seem keen on crypto anymore
Meta has barely any spin on what they are trying to accomplish with the metaverse. It's out in the open that they want to create an all-encompassing privacy-destroying monopoly (sorry, platform) to suit their revenue and profit needs. Either Zuckerberg is so out of touch that he actually believes people have the same goals as Meta (possibly, considering how comically bad Meta's presentation was) or he doesn't care. They obviously see themselves as being the ones running the metaverse in Snow Crash, so I guess from their perspective it's a great time.

How many brilliant minds signed off on that metaverse presentation I wonder. I'm still shocked. That's a lot of either coercion or people that enjoy smelling their own farts. They spent billions on it. Did I mention I'm still shocked? Shocked! None of it makes sense.

deckard1··on Google asks some employees to share desks amid office downsizing
> They provided one stool for 2 standing desks

They had it better in the movie Brazil. At least they had offices!

https://www.youtube.com/watch?v=mS5WLkb_Cxk

deckard1··on The age of cargo cult Agile must end
> break everything up into smaller chunks. It gives you clearly defined guardrails

This is only true if management respects the estimates. In my experience, they do not understand why Fibonacci or t-shirt sizing, etc. are used. They mentally convert the points to some "X days" and then beat you in the head with it. They want to micromanage and they do not understand they are building software. You can't break certain tasks down further and you can't parallelize many tasks. You can bring up Fred Brooks but it's a hopeless cause. They will never get it. Then as you inch towards their arbitrary deadline (that they tell no one, by the way, because it's better the developers don't know about deadlines until the last fucking minute because "agile" and not "waterfall") they suddenly act shocked that 9 women really can't make a baby in one month.

But I digress.

deckard1··on An overview of single-purpose Linux distributions
You can create your own.

In the days before Docker what we would use is CentOS with custom scripts using Anaconda[1]. You start with the base system and then add on whatever you need. You can also configure /etc however you need. The output is an ISO of your own custom Linux distribution.

One neat thing about Anaconda is you can add a provision script that runs on initial boot. So if you need to "bake" in your app but leave a certain amount of configuration for install-time, that's the way you do it.

[1] https://access.redhat.com/documentation/en-us/red_hat_enterp...

deckard1··on Tesla recalls 360k vehicles, says full self-driving beta may cause crashes
What is made easy will become inevitable.

OTA updates carry a perverse set of incentives. Look at the gaming industry. They went from putting out rock solid games because of necessity (the reality of publishing physical cartridges and CD-ROMs without network updates) to the absolute dogshit of No Man's Sky and Cyberpunk 2077. Gamers have effectively become an extension of QA to the point that some game devs simply stop doing QA at all. Which we are seeing clearly with the "beta" version of self-driving software.

To make matters worse, firmware devs are on the lower totem pole of the developer hierarchy. They live more on the cost center side than the profit center side (think airbag control vs. the guy that did the whoopee cushion sounds). The quality of firmware is already incredibly poor across the range of consumer devices. OTA incentivizes corporations to release software earlier than they currently do knowing that they can always fix it later if necessary.

deckard1··on Tesla recalls 360k vehicles, says full self-driving beta may cause crashes
I feel like The Expanse will probably be a more accurate picture of the realities of a Mars colony
← PreviousPage 3 of 30Next →