HNHacker News
TopNewBestAskShowJobs

IAmLiterallyAB

567 karma · joined March 22, 2018

submissionscomments
IAmLiterallyAB··on The NSA Furby Documents
Which part, unSP? There is a PDF floating around the Internet called "unSP Programmer's Guide". Annoyingly didn't find that PDF until after I had already REed everything
IAmLiterallyAB··on The NSA Furby Documents
Fun fact: the 2016 model Furby uses an obscure ISA you've never heard of (and if you have, let me know!) called µnSP. I managed to get Pong running on a Furby a few years ago and by far the hardest part was figuring out that completely undocumented instruction set.

Wrote added support for it to Ghidra which was a cool learning experience

IAmLiterallyAB··on IDEs we had 30 years ago
Android Studio is IntelliJ
IAmLiterallyAB··on 4B If Statements
But that probably isn't the function you want, because that will return -1 if the input is negative.

What you want to return is a boolean. And in that case the code generated is much simpler https://godbolt.org/z/5dq7MnrEx

IAmLiterallyAB··on The C++20 Naughty and Nice List for Game Devs
Wondering the same. Seems like you could provide your own implementation or use a third party implementation. Be curious to see a write up on the bloat, what exactly it looks like
IAmLiterallyAB··on A KDE Plasma theme that aims to replicate the look and feel of Windows 7
I know there's been improvements to the defaults in Plasma 6 which is set to release in February. Stuff like double click instead of single click for opening folders. I plan to try it once it releases.
IAmLiterallyAB··on C++ Should Be C++
As someone who reads C++ disassembly/decompilation for a living... Yeah kinda. It depends.

If the target code is full of virtual function calls, yeah it gets gross. But if you need dynamic dispatch, C isn't going to be any better, you'll just be reinventing vtables by hand. Similarly, resource acquisition and release happens in C too, you just have to do it by hand instead of letting the destructor do it for you.

One ultra gross thing I see all the time in C++ disassembly though: constantly creating copies of a std::string, using them once for a comparison or something trivial, and then throwing them away. Multiple times in the same function. Its the developers fault, they shouldn't be creating new objects, they should be passing a pointer or a string_view or something. Unfortunately, C++ is copy rather than move by default, so its too easy to do this by accident.

Another gross thing? (Not C++ specific) 20 functions in a row that are just a single return instruction. Since functions have to have distinct addresses (that's my understanding at least) the compiler/linker can't easily fold identical functions together. Implementations can optimize as long as everything still works (the "as-if" rule). And I know some compilers do. But in practice, it seems they suck at it. So I get to look at 20 lines of assembly in a row that are just `bl`.

IAmLiterallyAB··on C++ Should Be C++
> You've essentially described C

I'd disagree pretty strongly with that. C is more focused on being relatively simple to implement and backwards compatibility with the past 50 years. (I read a blog post by a C committee member talking about that recently, wish I could find the link)

Just look at the garbage fire which is the standard library. qsort. strtok. rand.

C++ should (in theory at least) be able to match or surpass C for _any_ performance benchmark, because it simply gives you more tools in your toolbox. For example, C is never going to be able to beat std::sort because it can't monomorphize in the compare function.

I'm not saying C++ is perfect either (looking at you unordered_map and regex). But I am saying people look at C with rose colored glasses.

IAmLiterallyAB··on So you want custom allocator support in your C library
? This is exactly how snprintf works, which is what we're discussing.
IAmLiterallyAB··on So you want custom allocator support in your C library
For the first idea: Yes, but both of those would have to interpret the format string and determine the character lengths of the arguments which is duplicated work. I'd imagine its a large portion of the work. I'm not convinced its any more efficient than snprintf.

The second idea is neat though... it could return an extra argument which is a pointer to the first part of the format string that wasn't printed

IAmLiterallyAB··on SSH3: SSHv2 using HTTP/3 and QUIC
Looks neat. Have you looked into using the new WebTransport protocol?

https://datatracker.ietf.org/doc/html/draft-ietf-webtrans-ov... https://datatracker.ietf.org/doc/html/draft-ietf-webtrans-ht...

Still early stages, but it looks promising! Notably it supports multiple streams and unreliable datagrams since it goes over QUIC

IAmLiterallyAB··on Show HN: A pure C89 implementation of Go channels, with blocking selects
If that was sarcasm, I don't think it landed. If not, well, let's not discourage people from admitting when they are wrong. It's a healthy thing to do.
IAmLiterallyAB··on Show HN: A pure C89 implementation of Go channels, with blocking selects
They edited their original comment before you saw it, apparently the original tone was a bit harsh
IAmLiterallyAB··on I'm building a self-destructing USB drive (2022)
Wow really? That's annoying. Why go to all the trouble to add the switch if they won't implement it correctly
IAmLiterallyAB··on Baldur's Gate 3 Wins Game of the Year at the Game Awards
I haven't played DOS (though now I might). My understanding is that BG3 is more story and character focused. And while they've done a surprisingly good job adapting D&D combat to video game format, it's definitely not perfect.

I definitely recommend it

IAmLiterallyAB··on For processing strings, streams in C++ can be slow
> assuming 32 bit ints

That's really not a valid assumption. There are 16 bit int platforms, I've worked on them. It's not even that uncommon.

Casting in this scenario is simply incorrect. The correct thing to do is to use the formatting macros e.g. PRIuFAST16. Which noone ever does because it's gross and most developers don't actually care about portability.

IAmLiterallyAB··on For processing strings, streams in C++ can be slow
It always surprises me how slow streams are. fscanf should be relatively slow because it has to parse the format string at runtime. So the new C++ format should be (and I believe is) much faster
IAmLiterallyAB··on An Open Letter to the Python Software Foundation
Based on that map, South Africa would seem to be the best choice
IAmLiterallyAB··on Virtual Machine as a core Android Primitive
Android apps can already run native code, so there's no performance benefit.

Also, Java "virtual machines" and native virtual machines are two very different things, they shouldn't be equated.

IAmLiterallyAB··on Dogbolt Decompiler Explorer
Honestly just use Ghidra. It has it's quirks but it's pretty good. And open source. If it's good enough for the NSA it's probably good enough for recreational use.
IAmLiterallyAB··on Integrity-178B: Safety Critical Real-Time OS
Why would they care about that...
IAmLiterallyAB··on Fortran 2023
Do you have a link to that thread?
IAmLiterallyAB··on NAND Error-correction Code
This is true, Linux developers could write their own fully featured FTL. However, it's difficult. To quote the MTD docs

"Unfortunately it is a rather difficult task to create a good FTL layer and nobody still managed to implement one for Linux."

IAmLiterallyAB··on Braid, Anniversary Edition trailer [video]
See also The Witness, an amazing puzzle game by Jonathan
IAmLiterallyAB··on Why is int in C in practice at least a 32 bit?
Yes, and I'm excited about that! Though I do wish the syntax sucked less. Also would be interesting to see it be the primary integer type of the language.

I'm also interested in a more advanced version for setting arbitrary bounds. E.g. an integer that goes from 1-10. Adding two of those would be an integer from 2-20. The goal being that the compiler could help enforce that you don't pass a value that is OOB. Might make more sense for that to be a library. Perhaps some C++ template magic. But I digress

IAmLiterallyAB··on Why is int in C in practice at least a 32 bit?
I agree. And I find it interesting that everyone seems to think the alternative is having a handful of hard coded sizes (8, 16, 32, 64). I don't think that's the answer either.

I imagine a language without any concrete integer type, instead you have to parameterize. For example int<32> for a 32 bit integer. Syntax is debatable but that's the idea.

It's great cuz it can work on even weird hardware, I can make an int<13> for 13 bit machines.

And you can make typedefs for common stuff. Like a size_t mapping to int<32> or a word_t mapping to int<16>. Whatever you need.

I've been meaning to make a compiler to test the idea out. Someday maybe

IAmLiterallyAB··on Intel Itanium IA-64 Support Removed with the Linux 6.7 Kernel
I really like the idea of VLIW CPUs, it's a shame none of them have worked out. Does anyone know of any other cool more modern CPU designs? Stuff like RISCV is fine but doesn't feel particularly innovative
IAmLiterallyAB··on Cooperative C++ Evolution – Toward a TypeScript for C++
Precisely. He mentions that in the full talk in the video
IAmLiterallyAB··on Cooperative C++ Evolution – Toward a TypeScript for C++
Yeah you really have to watch the talk video to understand the article. Which is a time sink but I felt it was worth it
IAmLiterallyAB··on Cooperative C++ Evolution – Toward a TypeScript for C++
It's about 100% compatibility and interop
← PreviousPage 4 of 8Next →