I don't even have a Mac yet, so no point in shipping for that if I can't debug it.
If sales are good, I'd be glad to buy a cheap macbook off ebay and port it.
1,788 karma · joined March 13, 2025
I don't even have a Mac yet, so no point in shipping for that if I can't debug it.
If sales are good, I'd be glad to buy a cheap macbook off ebay and port it.
#include <X11/Xlib.h>
#include <stdlib.h>
#define stk(s) XKeysymToKeycode(d, XStringToKeysym(s))
#define on(_, x) if (e.type == _) { x; }
#define map(k, x) if (e.xkey.keycode == stk(k)) { x; }
#define grab(...) const char *l[] = { __VA_ARGS__, 0 }; \
for (int i = 0; l[i]; i++) XGrabKey(d, stk(l[i]), Mod4Mask, r, 1, 1, 1);
int main() {
Display *d = XOpenDisplay(0); Window r = DefaultRootWindow(d); XEvent e;
XSelectInput(d, r, SubstructureRedirectMask);
grab("n", "q", "e");
while (!XNextEvent (d, &e)) {
on(ConfigureRequest, XMoveResizeWindow(d, e.xconfigure.window, 0, 0, e.xconfigure.width, e.xconfigure.height));
on(MapRequest, XMapWindow(d, e.xmaprequest.window);
XSetInputFocus(d, e.xmaprequest.window, 2, 0));
on(KeyPress, map("n", XCirculateSubwindowsUp(d, r); XSetInputFocus(d, e.xkey.window, 2, 0))
map("q", XKillClient(d, e.xkey.subwindow))
map("e", system("dmenu_run &")));
}
}
I have to say, I'm not usually a huge fan of C macros, but it works here so well, it feels so elegant and clean somehow.I agree that most software today is bloated, but I wouldn't say crappy. There are legitimate reasons to choose bloat, for example using SDL or Electron to speed up development and have easier portability. But for some reason I do strongly enjoy writing and using minimalist software. That's why I removed C++, SDL and other libs from my app (hram.dev) and just used C, native Win32 APIs, and D3D, getting it down to 1.4mb and speeding up compilation a lot. So projects like this always appeal to me, and I love seeing different ways we can be minimalist without sacrificing too much functionality or convenience.
I submitted a link to a project[0] with similar characteristics a few days ago, before I realized it was probably entirely made by AI. That's what got me wondering this in the first place.
But overall, CSS is just really difficult to scale well properly. I should probably learn Tailwind at this point, instead of continually rolling my own CSS.
So now I have DaisyUI bookmarked since the site is excellent and looks so useful.
It's a native Win32 app, with a window of 320x180 pixels, which scales upwards as you resize bigger. By itself the program does nothing except read and run a specific Lua file located in AppData. Drawing to the screen is the main operation of the program.
The Lua API has a few built in modules:
- "image" for dealing with gpu images, which includes the screen
- "lpeg" so you can write a custom parser
- "asm" so you can compile and run assembly code from Lua
- "memory" so you can read and write to real memory addresses
It uses real memory:
All the APIs, including the assembly you write, can access real memory addresses. So you can write to 0x20000 and read from it, either in Lua or Asm, and it just works. And you get raw pointers as Lua integers that you can pass around, which lets you pass them through assembly and back.
The app has a few competing primary purposes:
- Learn or practice writing x64 win32 assembly
- Learn or practice writing a programming language
- Learn or practice writing video games like it's 1979
- Learn or practice writing programs that manage raw memory
It's not that it's difficult for me, it's that it's unnatural for me.
Different people's minds work differently.
What I don't understand is why assembly feels so hard to learn in the first place?
I mean, isn't it just a simple language with a few function calls (instructions) and types (operand sizes) and fixed number of variables (registers) and a small number of control flow operators, and that's it? Why does it feel so mysterious?
https://news.ycombinator.com/item?id=22279051
https://sonictk.github.io/asm_tutorial/#introduction/setting...
https://cs.brown.edu/courses/cs033/docs/guides/x64_cheatshee...
https://people.freebsd.org/~lstewart/articles/cpumemory.pdf
https://learn.microsoft.com/en-us/cpp/build/x64-calling-conv...
> nobody in the executive branch, of any given party, independent, or otherwise should be granted these powers
Then who should be able to defund and destaff organizations? Nobody? Should they last forever simply because they were legislated at one point?
---
[ EDIT since I can't comment anymore today ]
My mistake, I did not see the word "congress" in the text I was quoting.
My mind has been shut down for about 49 days. It's difficult to think at all.
So great job making an app to make this easier.
For your core features, the "instant verse lookup" and "reading progress that sticks" look very useful.
But KJV audio? I think you'd be competing with the excellent dramatized audio book Truth and Life (RSVCE), which nobody can top.
I fully agree that software has gotten substantially more complex. There seem to be far too many levels of abstractions on top of abstractions. I do miss the days of QBasic, and that's why I'm working on the product I legitimately need to release before the end of the month.
But not every layer has the same level of low quality. For example, you brought up lazy loading. It actually can take a lot more work to properly support lazy loading, unless your framework supports it. I'm not sure what Slack uses beyond just Electron, but even in vanilla JS it's not easy to get lazy loading working properly, although the animations are very easy to get wrong with canned code.
On the note of Electron, I'm very happy to report that the last time I checked the size of my Release build for my pure Win32 app, it was sitting at 312 kb total, as a single standalone .exe file. It will of course be a bit bigger than this when I finally release it, but still, there's something so satisfying about making something with such extreme minimalism.