HNHacker News
TopNewBestAskShowJobs

Validark

368 karma · joined March 23, 2024

https://validark.github.io
submissionscomments
Validark··on Why is homeschooling becoming fashionable?
Honestly a school shooting drill was probably near the bottom of the causes of psychological problems when I was in school.
Validark··on Zig's comptime is bonkers good
What can you do in Mojo that you can't do in Zig?
Validark··on Zig's comptime is bonkers good
I think if you integrated with the build system, yes, Zig can do things only when the file changed. But I'm not sure that Zig figured out incremental comptime yet. That's way harder to accomplish.
Validark··on Zig's comptime is bonkers good
By your definition practically any code is a compiler unless you literally typed out every individual thing the machine should do, one by one.

"Understanding compilers is hard."

I think this is just unnecessarily pessimistic or embracing incompetence as the norm. It's really not hard to understand the concept of an "inline" loop. And so what if I do write a compiler so that when I do `print("%d", x)` it just gives me a piece of code that converts `x` to a "digit" number and doesn't include float handling? That's not hard to understand.

Validark··on Zig's comptime is bonkers good
Zig disallows ALL shadowing (basically variable name collisions where in the absence of the second variable declaration the first declaration would be reachable by the same identifier name).

Generating a text file via a writer with the intent to compile it as source code is no worse in Zig than it is in any other language out there. If that's what you want to do with your life, go ahead.

Validark··on How AI is unlocking ancient texts
This is actually hilarious and I'm sad you are getting downvoted for it.
Validark··on How AI is unlocking ancient texts
It's cut off on archive.is too. Can Springer Nature not afford us all to be able to read the full article or what? Do they really need $70 for a single page of information again?
Validark··on How AI is unlocking ancient texts
Interesting point in theory but I'd love to get to the point where our problem is that we solved all the problems we already know how to solve.
Validark··on I wrote a Game Boy Advance game in Zig
> As it would turn out, the Game Boy Advance has quite a bit of “weird memory” that you have to work around in weird ways. I know that this is a long shot, but it would be nice if there was some way to specify how memory in certain address ranges need to be addressed.

Could you elaborate on this? Does LLVM support this feature? If so, it might not be too hard to get it into Zig.

Validark··on I wrote a Game Boy Advance game in Zig
> Unfortunately, it only has support for one output. Some of the BIOS functions on the GBA that you might use inline assembly for output multiple values in different registers, which is problematic for Zig. This is currently being worked on so it might be improved in the future.

Can you post the code that's impossible to write properly?

Validark··on BSD kqueue is a mountain of technical debt (2021)
A good start to an article, but unfortunately it feels like it was cut off before the asserted argument was demonstrated to be true.
Validark··on Ada's dependent types, and its types as a whole
Very interesting. As a Zig enthusiast I've long suspected that Ada has the ability to express more invariants and types that we will want in Zig (some, like ranges, are planned, last I heard). I'm definitely interested to learn more about Ada.
Validark··on Bit-twiddling optimizations in Zed's Rope
I guess it depends how many different compilers you are targeting but generally speaking, compilers look for trivial implementations of popcount and can replace it with the single instruction.

However, as someone already mentioned, this is not equivalent to a pair of popcounts.

Validark··on Bit-twiddling optimizations in Zed's Rope
AMD machines prior to Zen 3 had a micro-coded implementation of pdep and pext, so they're actually relatively expensive for those earlier Zen machines (as well as Bulldozer). Some people still have Ryzen 3000 series chips.

On the Intel side, pdep has been fast since its release with the Haswell in 2013, so pretty much everyone using Intel should be fine in this regard.

Validark··on The Onion buys Infowars
What does this mean?
Validark··on Claude AI to process secret government data through new Palantir deal
Woosh. It was most likely facetious. The fact that one is Amazon and one is Microsoft is not a massive difference.
Validark··on Show HN: Aide, an open-source AI native IDE
I believe I get the metaphor. Why is it confusing?
Validark··on Pretty.c
Evil, yet beautiful. Hats off to you.
Validark··on Breaking Bad: How Compilers Break Constant-Time~Implementations
Good for the authors for putting the idea out there I guess, but to me it seems pretty obvious that people who never look at their assembly would have no idea whether it matches their expectations.

And it's not hard. Godbolt.org is free for everyone.

Checking if the code branches is super easy, you don't need a super smart runtime analysis tool to figure out if there's a branch. Ditto for everything else you want to check.

Validark··on Do U.S. Ports Need More Automation?
For the original commenter to be wrong you'd have to argue that they've been underutilizing what's possible in the state of the art. Looking at the Wikipedia page, I don't get that impression. It sounds like giant engines and equipment on the terminal side are the main limitations, and I assume those capabilities have increased over time. Maybe the original commenter is wrong, although I highly doubt that cargo technology has been underutilized unless the cost of state of the art is/was truly so astronomical such that it genuinely doesn't make financial sense.
Validark··on I Am Tired of AI
One thing that I hate about the post-ChatGPT world is that people's genuine words or hand-drawn art can be classified as AI-generated and thrown away instantly. What if I wanted to talk at a conference and used somebody's AI trigger word so they instantly rejected me even if I never touched AI at all?

This has already happened in academia where certain professors just dump(ed) their student's essays into ChatGPT and ask it if it wrote it, and fail anyone who had their essay claimed by ChatGPT. Obviously this is beyond moronic, because ChatGPT doesn't have a memory of everything it's ever done, and you can ask it for different writing styles, and some people actually write pretty similar to ChatGPT, hence the fact that ChatGPT has its signature style at all.

I've also heard of artists having their work removed from competitions out of claims that it was auto-generated, even when they have a video of them producing it stroke by stroke. It turns out, AI is generating art based on human art, so obviously there are some people out there whose stuff looks like what AI is reproducing.

Validark··on The unknowns surrounding the mysterious rise of cancer in young adults
> tobacco use

What's the worst part of a cigarette, the fact that it has tobacco, or the fact that it has like 100 different cancer causing toxins?

Validark··on One in five genetics papers contains errors thanks to Excel (2016)
It's insane to me that you'd throw away a whole language, toolchain, ecosystem, and community, just because you disagree with the caret operator not taking precedence over a unary minus. Do they not have parentheses on the keyboards where you're from?
Validark··on One in five genetics papers contains errors thanks to Excel (2016)
This is probably the most overly pedantic, nitpicky reason for not using a program I've ever heard.

I'm aware that there are two different conventions on this issue, so I just use parentheses to get the behavior I want.

But, growing up, as the top math student in my class, it never occurred to me that somebody out there wants -3^2 to equal -9, I thought it was just a weird quirk in some calculators/programs. How would you read that expression aloud? I think of it as "negative three squared" so that's why (-3)^2 makes sense to me. Do you say "the negative of three squared"?

In 8th grade, I remember being instructed to type such an expression into the calculator to observe how it does something contrary to what we expect it to. From that moment on, I thought, "Huh, guess you have to use parentheses." It certainly wasn't cause enough to throw out my calculator, let alone tell others not to use it, just because I prefer a slightly different precedence convention.

Validark··on We're not going to run out of new anatomy anytime soon
It's sad to think about how little of our resources are dedicated to work like this. Although I enjoyed the Marvel movies growing up, it would be nice if similar funding could be found for a project like the author describes (and, of course, you could have a sort of documentary showing people what they discovered).
Validark··on Lisp implemented in Rust macros
This is super awesome!
Validark··on Data sleuths who spotted research misconduct cleared of defamation
“[s]cientific controversies must be settled by the methods of science rather than by the methods of litigation”

Boom. And the researchers didn't accuse a person of fabrication, they accused the data of being fabricated.

Validark··on Can LLMs Generate Novel Research Ideas?
Considering the fact that we know the names of the individuals who came up with new ideas in physics, it's extremely rare. If every other college kid was in that category, then we could call it "human ability".
Validark··on A good day to trie-hard: saving compute 1% at a time
It's silly to use Big-O to describe the number of comparisons when the goal is to analyze performance. Comparisons cost 1 cycle, and you can do many of them per cycle with instruction level parallelism and SIMD. The main bottleneck, the actual source of slowness, is memory. It costs thousands of cycles to go to memory, sometimes tens of thousands or hundreds of thousands (if you need a TLB walk or OS interrupt). If you want to use Big-O, use it to estimate the number of cache misses.

I'd probably go with a custom perfect hash function. And Phil Bagwell's popcount trick. That would be faster than everyone else's solution that involves multiple lookups in memory.

The CPU is fast, memory is slow.

Validark··on A good day to trie-hard: saving compute 1% at a time
If the bit twiddling is independent in each u64, then probably. If it's treated as one giant bitstring, probably not.
← PreviousPage 4 of 5Next →