Better HN
topnewbestaskshowjobs
Log inSign up

aaaashley

228 karma · joined Apr 30, 2023 (3y ago) · 49 submissions

https://aaaa.sh

i'm looking for work. contact: me@aaaa.sh

Submissions

comment 5mo ago · link · parent

yes! i had this exact idea. i also thought about integrating geometric/clifford algebra using zig's type system so that you could have one mathematical multivector object instead of complex / quaternion types, etc.

comment 5mo ago · link · parent

Not GP, but I've written game engines and rendering engines. Vector operations are just common enough that having to write `.mul` every time is a huge pain, especially when you put many of them together for a large formula. Compare:

(physics_data.velocity + omega * change) * frame_delta_time

to

physics_data.velocity.add(omega.mul(change)).mul(frame_delta_time)

We learn to read and think about math a certain way, which is incompatible with Zig. Also, Zig's design philosophy of "reading code over writing code" is incompatible with the kind of small modification-test-cycles required when doing games, and creative programming in general. So Zig is sort of DOA anyway for that kind of thing.

But I've been using Zig for non-game projects and it's been fantastic, so definitely not "Blind leading the blind" for the overall language design, imo.

comment 10mo ago · link · parent

Except social media feeds are designed to addict. A smoker will spend their time smoking instead of not smoking. Does that mean that smoking is good? Why else would they do it, if not smoking was better? It's not that simple. When we blame the users, we forget tech monopolies are spending billions to engineer systems which are stealing our time.

comment 11mo ago · link · parent

Seems like these are the asahi linux articles being taken from:

https://asahilinux.org/2023/03/road-to-vulkan/ https://asahilinux.org/2022/11/tales-of-the-m1-gpu/

Also, if you're looking for quality content about GPUs, this series of blogposts is a little outdated but still relevant:

https://fgiesen.wordpress.com/2011/07/09/a-trip-through-the-...

Seems like this is someone who just started learning GPU programming and is just throwing stuff onto the internet. See, their [recent blogpost, which is just a list of unwritten vulkan tutorials](https://hyeondg.org/vulkan_tutorial/0).

comment 11mo ago · link · parent

Funny thing about that n[static M] array checking syntax–it was even considered bad in 1999, when it was included:

"There was a unanimous vote that the feature is ugly, and a good consensus that its incorporation into the standard at the 11th hour was an unfortunate decision." - Raymond Mak (Canada C Working Group), https://www.open-std.org/jtc1/sc22/wg14/www/docs/dr_205.htm

comment 1y ago · link · parent

I don't think that fashion trends are comparable. I think that fashion trends are fine in concept–things get old and we switch things up. It's the way the human superorganism is able to evolve new ideas. Unfortunately, capitalism accelerates these changes to an unreasonable pace, but even in Star Trek communism, people get bored. The cultural energy that birthed one style is no longer present, we always need something new that appeals to the current time.

But clothes still have to look nice. Fashion designers have a motivation to make clothes that serve their purpose elegantly. Inelegance would be adding metal rails to a skirt so that you could extend its length at will. Sure, the new object has a new function, and its designer might feel clever, but it is uglier. But ugly software and beautiful software often look the same. So software trends end up being ugly, because no one involved had an eye for beauty.

comment 1y ago · link · parent

The "development time is more important than performance" motto treats bad performance as the problem with software, when in reality poor performance is a symptom of growing software complexity. I'm sure that each individual coder who has contributed to software bloat believed that their addition was reasonable. I'm sure everyone who has advocated for microservices fully believes they are solving a real-world problem. The issue is that we don't treat complexity as a problem in-and-of-itself.

In physical disciplines, like mechanical engineering, civil engineering, or even industrial design, there is a natural push towards simplicity. Each new revision is slimmer & more unified–more beautiful because it gets closer to being a perfect object that does exactly what it needs to do, and nothing extra. But in software, possibly because it's difficult to see into a computer, we don't have the drive for simplicity. Each new LLVM binary is bigger than the last, each new HTML spec longer, each new JavaScript framework more abstract, each new Windows revision more bloated.

The result is that it's hard to do basic things. It's hard to draw to the screen manually because the graphics standards have grown so complicated & splintered. So you build a web app, but it's hard to do that from scratch because the pure JS DOM APIs aren't designed for app design. So you adopt a framework, which itself is buried under years of cruft and legacy decisions. This is the situation in many areas of computer science–abstractions on top of abstractions and within abstractions, like some complexity fractal from hell. Yes, each layer fixes a problem. But all together, they create a new problem. Some software bloat is OK, but all software bloat is bad.

Security, accessibility, and robustness are great goals, but if we want to build great software, we can't just tack these features on. We need to solve the difficult problem of fitting in these requirements without making the software much more complex. As engineers, we need to build a culture around being disciplined about simplicity. As humans, we need to support engineering efforts that aren't bogged down by corporate politics.

comment 1y ago · link · parent

Speaking of using custom CSS with YouTube, I do the following for my experience:

- Completely hide the recommended tab

- Make every thumbnail grayscale (to mitigate eye-catching thumbnails)

- Make every video title lowercase (to mitigate eye-catching titles)

Here's my code, although I have to update it every once and a while when YouTube changes:

  yt-thumbnail-view-model { filter: grayscale(); }
  h3[title] { text-transform: lowercase; }
  .ytd-watch-flexy #secondary { display: none !important; }
It's amazing how much a couple small changes can make on your browsing experience. The companies that own these products have a huge incentive to make every element purposefully addictive. I've also patched the iOS Instagram app to remove all Reels (using FLEXtool & Sideloadly), so I can keep up with my friends without falling into the traps. As developers, we have the ability to target these manipulative tactics and remove them, and I encourage you to do this as much as possible.

comment 1y ago · link · parent

Unfortunately, no :( I was hoping someone would recognize the book and reply...

comment 1y ago · link · parent

I think CSS tools like that appeal to people who learned web development in a kind of ad-hoc way. When I first started, I just wanted to make designs I had in my head. I kind of went from "header, text, and image on the page" to, "how do I center this?", "how do I change this color?", "how do I space these elements out?" It wasn't long before I had developed a toolkit of CSS ideas, but once you do that, you lose out on a lot of the finer details that make CSS work well. I knew how to work around weird issues using position: absolute and transform, but I wasn't familiar with block formatting contexts, or the intricacies of the box model. When all of your CSS knowledge is just band-aids placed on your other shoddy CSS knowledge, you're working on fumes. At that point, you could imagine the appeal of grabbing a prebuilt toolkit of composable styles that takes away your access a lot of the available CSS footguns.

What changed things for me was reading an short online book-style series about learning HTML/CSS from the ground up. It introduced everything from first principles, and had an approach where they explained why things were the way they were. They didn't just give you their "top 10 ways to center a div" and ask you to leave. I read the whole thing in an afternoon and it changed the way I think about web development. For the life of me, I can't remember what the book was called. If anyone's read something similar I'd love a reference, it was a while ago now and I'd still like to reference it. I specifically remember them saying "display: block is like a word document, and display: flex is like how you'd expect things to work," which illuminated a lot for me, not just about the display property, but generally about the way HTML & CSS were designed.

comment 1y ago · link · parent

That's a really good way to think about it! (Bonus points for ASCII diagrams.) IIRC, I had some similar visualizations in the article but I cut them. And nice paper, interesting way to solve that problem.

comment 1y ago · link · parent

JavaScript! It's not perfect, but it's the easiest language to run in the browser :)

comment 1y ago · link · parent

Haha, I don't know why I didn't think to include a raycast scene, especially since that's what I was using the algorithm for!! Glad you liked it.

comment 1y ago · link · parent

Original author here. I've been reading this website for years. Imagine my shock when I saw my own article on the front page! I'm glad people are enjoying it.

Quick fact about the way the interactivity is done, all of the code for it is in this blogpost.js file: https://aaaa.sh/creatures/blogpost.js, which is only about 100 lines long. Each block has a list of scripts that it pulls from like so:

<div class="code-example" scripts="grid-sm 2d-vector-gfx-lib draw-grid full-algo-intro feather-canvas-edges"></div>

and then there's a set of script tags with those ids. I figured it was a nice solution!

comment 1y ago · link · parent

My argument is that using these non-standard extensions to do important things like memory management in a C library is malpractice—it effectively locks down the library to specific C compilers. I'm sure that's fine if you're writing to clang specifically, but at that point, you can just write C++. libfreetype & stb_* are used and continue to be used because they can be relied on to be portable, and using compiler-specific extensions (without ifdefs) defeats that. If I relied on a clang-specific `defer`, I'm preventing my library from possibly being compiled via a future C compiler, let alone the compilers that exist now. To me, that's the point of writing C instead of C++ for a library (unless you're just a fan of the simplicity, which is more of an ideological, opinion-based reason).

comment 1y ago · link · parent

For me, the point of writing something in C is portability. There were C compilers 30 years ago, there are C compilers now, and there will almost certainly be C compilers 30 years from now. If I want to write a good, portable library that's going to be useful for a long time, I'll do it in C. This is, at least, the standard in many gamedev circles (see: libsdl, libfreetype, the stb_* libraries). Under that expectation, I write to a standard, not a compiler.

comment 1y ago · link · parent

My understanding is that the only qualifier for something on hackernews is that it has to be "deeply interesting":

https://news.ycombinator.com/newswelcome.html

Deeply interesting tech, or otherwise.

comment 1y ago · link · parent

Maybe I'm wrong and this is new to a lot of people! I have a limited perspective based on my programming journey, which winds mostly through gamedev, graphics programming, and DSP, both (typically) low level domains. But I think if the title if the article were more accurate, (e.g. "What are pointers?"), my reaction would be more clear. I'm also kinda taken aback by the "old grey beard" comment. Look at all the kids using Rust, Zig, even C and tell me that this is obscure knowledge.

When I took my first programming class at RIT, visualizing the stack, variables, and pointers was one of the first classes we had. It's one of those beginner diagrams that I feel like everyone is familiar with. But I can understand that there are programming domains with equivalent complexity which don't require that base knowledge. I apologize if I came off as elitist.

comment 1y ago · link · parent

Absolutely, like I said, there's no problem with what this person is doing or the way that they're exploring computers, I'm just confused as to why it's being posted here.

comment 1y ago · link · parent

Yeah I found this article super weird. Explaining pointers & dereferencing is reasonable, but doing it in the context of Zig specifically, like Zig is the first language to feature dereferencing, is odd. Especially since pointers are such a fundamental part of low-level (really, any) programming. Also not sure why it's posted here?

Edit: Going through this author's website, it seems like a lot of their posts are about rediscovering low-level programming concepts through Zig. Like this article, where they discover you can't compare strings directly, and you have to use memcmp:

https://www.openmymind.net/Switching-On-Strings-In-Zig/

They claim that they blog because they "find that [they] retain things better when I write about them." No problem with that. Just a little odd to see on the hn front page, I suppose.

comment 1y ago · link · parent

What do you mean by "motivational?" Are you talking about how the creator is against adding new features to the language? I actually think that's perfectly fine. One of my favorite things about Odin is the simplicity; the entire language and all of its rules can be understood by reading the Odin overview document. I'm actually thrilled to have a creator that doesn't want to bloat the language.

comment 1y ago · link · parent

Bryce Bostwick does super cool & inspiring work on debugging and reverse-engineering apps. I found him on YouTube; His video on modding TikTok to only show cat videos (https://youtu.be/YW3jL2gI9IE) inspired me to mod Instagram to remove everything except the message feature, which is the only part I use. I've been meaning to get more into modding & reverse engineering–specifically modding Windows in the style of Windhawk (https://windhawk.net/). Bryce gives a great intro to doing that sort of thing on iOS with live, step-by-step videos.

comment 1y ago · link · parent

Fair, though when I say "quality decline" I'm mostly talking about extraneous useless features and overly complicated node-based architectures that require GUIs. There are simpler ways to do all of this stuff. This engine, Tramway, is proof of that. Godot sits somewhere in the middle, I've used it a little but I don't know enough about it to say whether it's overly complex or not.

You are correct: I definitely agree that not all gamedevs should be making stuff from scratch, but I also think that Unity is a little too much. There's a good middle ground somewhere slightly above raylib.

My argument is that the promotion of engines that live near this middle ground is blocked by education: people who want to be able to sell long courses to the people who look up "how to make a video game."

comment 1y ago · link · parent

I don't think that the developers of Slay The Spire were taught by complexity loving professors, no. But education does more than influence the people at universities. Education informs norms, traditions, and styles that permeate through industries. An example from outside tech: the music notation app Finale found a strangle hold on the education market, and now it's one of the standards for notation, despite being the worst option (source: have you tried Finale?).

I've never played the game, but my understanding is that Slay the Spire largely impresses on a design and artistic front, not a technical one. Its engine requirements were not based on feature set or code quality, but on what developers knew. So they probably picked Unity because it was ubiquitous. Education starts the problem, and then devs who need something common they care hire for continue the problem. I don't blame devs for this, it's the right choice to make and obviously Slay the Spire is great, but I am saying that this is a force that drives down the quality of game engines.

comment 1y ago · link · parent

Oh, absolutely. I maintain the engine for my video game and it's ultra-minimal tailored to my needs. That leads to better performance, and a much slimmer build size. (currently sitting at ~900KB for the optimized build of a nontrivial game, assets bundled separately). It's also a better development experience, imo.

My argument was mainly about these more generalized engines, like raylib, 'Tramway', or Source.

comment 1y ago · link · parent

It's all done using the HTML canvas API.

comment 1y ago · link · parent

I'm starting to believe there is an external force that drives down the quality of game engines over time. In most tech, the things that catch on are the things that are the easiest to develop curriculum for. The shape of a node-based editor like Unity is uniquely suited to explaining over a number of classes. (Source: I had to learn Unity at my University) On the other hand, an engine like raylib can be grokked in an afternoon, so a university-level raylib class wouldn't work. So you have all these amateur game developers and programmers coming out of diploma mills, and all they know is Unity/Unreal, so companies hire Unity/Unreal, so universities teach it, etc. See also: Java being popular. Then of course, all these companies have wildly different needs for their Unity projects, so Unity, being a for-profit company that serves its customers and not a single disgruntled programmer, has to conform their engine. So you end up with 'turbobloat.' (amazing term, btw)

The Half-Life and Morrowind engines are in a unique situation where they're put together by enthusiastic programmers who are paid to develop stuff they think is cool. You end up with minimal engines and great tech, suited to the needs of professional game developers.

This seems like something that sits in between a raylib and a Unity. I haven't used it, but I worry that it's doesn't do enough to appeal to amateur programmers, but it does too much to appeal to the kind of programmer who wants a smaller engine. I could be very wrong though, I hope to be very wrong. Seems like the performance here is very nice and it's very well put together. There's definitely a wave of developers coming out frustrated from Unity right now. As the nostalgia cycle moves to the 2000's, there's a very real demand to play and create games that are no more graphically complex than Half-Life 2.

Anyway, great project. Great web design. Documentation is written in a nice voice.

28.

Show HN: Interactive Explainer for DDA Line Drawing Algorithm(aaaa.sh ↗)

2 points · by amjoshuamichael · 1y ago · 2 comments

comment 1y ago · link · parent

Personally, I don't care about the library, and just want the pure math implementation for shaders and such. For that, they have the algorithm available here in GLSL, vec3 mixbox_lerp is the function you want:

https://github.com/scrtwpns/mixbox/blob/master/shaders/mixbo...

I don't have time to whip up a demo, but it seems like it's pretty well optimized and it looks really nice in the examples. Great work from these folks.

12