Latest Posts (5 found)
seated.ro 4 months ago

Devlog 001

This is a general devlog covering what I’ve been up to over the past few months! Hakyll is a Haskell library for generating static websites (yes, you do not, in fact, need Next.js for your personal site). The previous iteration of my website was written with Go + templ, and it was not static. I wrote everything myself, and it was, quite frankly, a horror to maintain. The templ LSP actually hinders more than it helps, and since I did not statically generate the content, it was kind of slow for a personal website. I did not like it. I added some very minor CSS fixes and a theme toggle button for my friend’s new website ludwigabap.com, and I saw the light that is Hakyll. :kneel: So I nerd-sniped myself into rewriting my personal website in Hakyll so that it generates beautiful HTML at build time (it uses Tailwind, too). All the dynamic bits of the website, like my silly stats and coding time, are served from a single Rust Axum server binary on my Hetzner VM that serves other stuff too (Memegrep’s server, among other things). This segues into my next nerd-snipe, or rather, my favorite new pill: the Nix pill. My entire website is built with a single Nix flake, including the Hakyll build step, the Cargo build step, and generating the resulting Docker image. Although, to be honest, the learning curve is very steep and I simply do not have it in me to master this language anytime soon, I like the principles, and it seems to me the least bad build system out there. I do most of my work on a MacBook running a NixOS VM as well. (seatedro/dotnix on GitHub.) It’s so much nicer to have a real dev workflow versus whatever the fuck macOS is. Sorry, but Homebrew is not good software. The reason I started programming was that I was playing a game called Midtown Madness as a wee lad and decided that one day I would build a cool game like that. So, after 15 years, I’ve decided to embark on a small adventure to build a cool physics simulation (and eventually a voxel) engine. It’s written entirely in Zig because I enjoy writing Zig and did not want to touch C++ (although there were times I thought about committing this sin). When Ember gets far enough, I might write separate devlogs, but with what’s written so far, there isn’t enough to justify one. I was knee-deep in the mines because I wanted extremely specific features like multi-viewport docking with ImGui, and the off-the-shelf Zig libraries did not want to ship that for some reason. So there were many adventures in getting this shit to compile neatly. Ember now uses SDL3 for windowing and has an abstract rendering API (rudimentary, but the backends are in place) with SDLRenderer3, OpenGL, and WGPU-native backends that can be neatly switched at . I’m using a bunch of cool resources to learn more about how to do this because I’ve never really written any game-dev related code before. I just want to build some cool simulations, and I will get there no matter what. github / seatedro / ember After 5 years, I have finally built a new personal computer. I will be running NixOS as my main operating system with Hyprland and Wayland. I will also have Windows installed on a separate drive mainly for video games, though I expect to use Linux more often. It’s so nice not having to worry about my 256 GB SSD getting filled up on my MacBook Air. :> Also, I joined Exa last month to work on the back-end team, and it has been so fun! I am soaking up as much knowledge from my significantly smarter peers at a good pace. As per custom, I revisited @ludwigABAP ’s post: On becoming competitive when joining a new company . (PS: it’s on a new website.) Back to the code cave I go—going to extract the polymorphic.

0 views
seated.ro 8 months ago

If you don't tinker, you don't have taste

Growing up, I never stuck to a single thing, be it guitar lessons, art school, martial arts – I tried them all. when it came to programming, though, I never really tinkered. I was always amazed with video games and wondered how they were made but I never pursued that curiosity. My tinkering habits picked up very late, and now I cannot go by without picking up new things in one form or another. It’s how I learn. I wish I did it sooner. It’s a major part of my learning process now, and I would never be the programmer person I am today. Have you ever spent hours tweaking the mouse sensitivity in your favorite FPS game? Have you ever installed a Linux distro, spent days configuring window managers, not because you had to, but purely because it gave you satisfaction and made your workflow exactly yours? Ever pulled apart your mechanical keyboard, swapped keycaps, tested switches, and lubed stabilizers just for more thock? That is what I mean. I have come to understand that there are two kinds of people, those who do things only if it helps them achieve a goal, and those who do things just because. The ideal, of course, is to be a mix of both. when you tinker and throw away, that’s practice, and practice should inherently be ephemeral, exploratory, and be frequent - @ludwigABAP There are plenty of people who still use the VSCode terminal as their default terminal, do not know what vim bindings are, GitHub desktop rather than the cli (at the very least). I’m not saying these are bad things necessarily, just that this should be the minimum, not the median. This does not mean I spend every waking hour fiddling with my neovim config. In fact, the last meaningful change to my config was 6 months ago. Finding that balance is where most people fail. Over the years I have done so many things that in hindsight have made me appreciate programming more but were completely “unnecessary” in the strict sense. In the past week I have, for the first time, written a glsl fragment shader, a rust procedural macro, template c++, a swift app, furthered my hatred for windows development (this is not new), and started using the helix editor more (mainly for good defaults + speed). I didn’t have to do these things, but I did, for fun! And I know more about these things now. No time spent learning, is time wasted. Acquiring good taste comes through using various things, discarding the ones you don’t like and keeping the ones you do. if you never try various things, you will not acquire good taste. And what I mean by taste here is simply the honed ability to distinguish mediocrity from excellence. This will be highly subjective, and not everyone’s taste will be the same, but that is the point, you should NOT have the same taste as someone else. Question the status quo, experiment, break things, do this several times, do this everyday and keep doing it.

0 views
seated.ro 8 months ago

rabbit hole learning

Pretty much the best way to learn that I have found is to refrain from suprressing your innate curosity and let it go wild. Most of the time, you will encounter a term or concept that you do not know, instead of glancing at it briefly, go all in. Google it, read the wiki page, found someone’s blog post? Read it. Watch that youtube video (I only do this if it’s not 3 hours like your average Sphaerophoria stream). Dive head first into rabbit holes. I’ll outline an average day where I have two types of goals: - Concrete goals: Like finish implementing X feature in Y project - Loose goals: Learn about X or Y. I will include rough timestamps but they are pretty much meaningless because productivity levels vary immensely throughout the day. Shifted to working on memegrep (v2). This is where I already know the goals I want to accomplish before the day ends. I implemented a pub/sub flow to help with scale when users upload their private memes. Rough sketch in mind: Spent the next 6 hours coding without even realizing 6 hours had passed (bliss) Ended up with multi-file upload, search, deployed a CLIP model, added all the scaffolding needed in the UI for this. At the end of the day I ended up with more questions, but I definitely had more answers than when I started! Here’s a DAG of my exploration for fun: Decided to learn about document parsing. Links: EPUB specification , I found out that EPUBs are just an archive with HTML, and nearly had a crisis. (Now I know.) Immediate questions: so I need to parse the EPUB, extract metadata, fetch the XML and parse that too. Eventually I would have to use a WebView to render the HTML/CSS on the screen to render the book. (Unfortunate.) Found out that in order to read the PDF spec, you need to pay like 350 swiss francs! Spend time perusing SwiftUI docs, and asking grok about how I can render things on the screen with Swift. Fiddle with XCode, marvel at how Swift gets pretty much everything right but uses for declaring functions. It has though, so forgiven. Began reading Computer Systems: A Programmer’s Perspective (CSAPP) Studied numeric representations, created Anki cards for hexadecimal conversion Rabbit holed into learning so much about UTF-8 Bookmarked to learn more about UTF-8 and UTF-16 and writing a parser for it later (ILY @zack_overflow ) Taking a break, lunch + watching a movie. Read Jon Olick’s single file resize implementation in C++ as reference (ILY @gizmobly ) to roll my own resize library for use in glyph Rabbit holed into learning more about Sinc filters and the Lanczos Kernel . Shifted to working on memegrep (v2). This is where I already know the goals I want to accomplish before the day ends. I implemented a pub/sub flow to help with scale when users upload their private memes. Rough sketch in mind: Spent the next 6 hours coding without even realizing 6 hours had passed (bliss) Ended up with multi-file upload, search, deployed a CLIP model, added all the scaffolding needed in the UI for this. I posted something about pointers on twitter and ended up reading some history about the nomenclature just for fun. Links: pointers , handles are the better pointers Also saw something about reference counting being used in the libvips library earlier in the day, so decided to check out their implementation since i’ve only used it in rust quite often. reference counting , Rc and Arc Was in bed and saw a post linking an amazing article by Valve on Source Engine Networking , so ended up being a nice and light read.

0 views
seated.ro 1 years ago

two weeks is all you need

I built a website (twoweeksisallyouneed dot com) with just Claude 3.5 Sonnet, zero lines of code written by me. So a couple weeks back I had a computer vision midterm and i was allowed a single page of notes. I decided to use Claude to generate a cheat sheet in LaTeX. It was crazy lol, I was able to cook up something usable in 15 mins. claude is the best, this was made in 15 minutes pic.twitter.com/0tvIsdv34d Someone had asked me to make a similar cheatsheet for ML, but I thought why not get claude to make an entire website instead? I didn’t really give claude any specific information except what I wanted to build. My plan was as follows: > build out the UI skeleton first > populate with some dummy data > set up a content pipeline > tie up the ui with the data > fix bugs Claude decided to use react (Shocking). With just a couple of chats I was able to get the retro/hacker/matrix style UI down. (It’s going to be hard for frontend engineers to keep up with AI at this rate) I spent some time building and adding secrets/easter eggs to the website which no one has found yet lmaoooo. If/when all the easter eggs are found, I will open source the repository. Good hunting until then bros. Things got really annoying, really fast. As soon as I wanted to build some sort of content pipeline, everything went to shit. Claude, no matter how smart of an AI, is not human. It did not think ahead. If I was going to build out this website I would not have started with a barebones react/vite app. I would have probably gone for a full stack framework like sveltekit instead. Generating content for the website was/is a nightmare. LLMs hallucinate, this is known, but did you also know how incredibly frustrating it is to get them to follow instructions? There were multiple instances where Claude (with all the 40% of project context of javascript code) generated a TypeScript interface and proceeded to spit TypeScript code. This project has 0 TypeScript???? The new edit in place nonsense was getting on my nerves. Half the time the output artifact wouldn’t even change, and the other half it would mess up the changes. I have to mention “please use a new artifact” if I wanted any real usable code. I was enthusiastic about building something with just Claude the first few days, then I started getting weary, and then eventually I wanted to take a sabbatical from using AI. When the project context grows, (think like 20% or more), Claude seems to have a hard time using that information. Often times I found myself hitting send, and Claude would spit some nonsense, I would hit stop and paste any relevant code directly and then get some useful code. Context is probably the biggest annoyance I’ve had with LLMs. Perplexity (with claude 3.5) is great (to an extent) because it’s essentially a RAG search so I was able to get somewhat up to date content for the resources and references sections from it. I feel like I was able to ship something of decent quality for sure, but I lost a lot of brain cells during the process. Do not take away from the programmer the only thing he wishes to do, program . I didn’t particularly do anything unique to get the best out of my prompts/chats. I did do everything in a Project on claude dot ai though, which let me set Project Instructions like so: LLMs seem to be much more open to doing anything you ask if you gaslight them, so go ahead and do it. Here are some prompts that I used while building the website: One time I asked Claude to add something and it started changing the existing UI????? So many times I ended up editing the prompt and adding lines like this: I’ll just add some random prompts here This was a good experiment, a success. If you have a clear vision for what you want your product to be, then AI can help you achieve that vision quite well! However, I don’t think I will be using AI for the foreseeable future. I feel like my learning is stagnating the more i use AI and I want to write my slop code with my own two hands. I might use to quickly write some duplicated code here and there but by god, I miss coding. Actual coding.

0 views
seated.ro 1 years ago

a weekend love story - raylib/zig

Before this weekend, I was a plebeian who used JavaScript for 80% of my tasks. Now I am an esoteric plebeian who has used zig once. Anyway, I decided to give zig a shot and try to build a game with it. There was really only two libraries I wanted to learn (sokol and raylib), I went with raylib. I went through the official raylib docs to get a feel for the API, then I searched for zig bindings and found two, Not-Nik/raylib-zig and ryupold/raylib-zig The second one hasn’t been updated in 6 months, and it isn’t using the zig package manager. Ergo, leaving me no choice but to use the first one. Fairly easy to set things up, I just needed to install zig and raylib-zig. NOTE : We will be using zig v0.12.0 instead of v0.13.0, we will see why later. I used zvm to make life easier mangaging various zig versions, but you can install zig however you want. Follow this part of the docs to install raylib-zig. Do this inside your game directory. This adds raylib-zig as a dependency to our project. You can check the file to verify. Now the most important part if you want to compile your game for the web with emscripten. IF YOU’RE NOT BUILDING FOR THE WEB, PLEASE SKIP . Install as mentioned here: emscripten installation guide and make sure to do the command. NOTE : Just make sure not to clone the emsdk into $HOME/.emscripten, because emscripten uses that as the default cache directory. It will fuck your build up. (I didn’t do this at all) If you followed the raylib-zig installation guide, your build.zig should look something like this: If it isn’t, it should be now! Now we need to add a block specific to the emscripten target. I missed this code block and was stuck trying to figure out how to get the emscripten run step to work. :( I wrote an asteroids clone following along with this video: zig space rocks - jdh . Go write whatever game you want! Here is a screenshot of the game in action: Here are some other cool games made in zig: tetris , terrain-zigger Below is some cool zig code I wrote that I quite like: This syntax is so fucking cool, I will never forget to again. This code is for deciding when to play the low/high bloop sound. It increases in intensity the longer a player is alive. Makes it feel like the game is getting harder. Pretty cool! Also avoided for loops with bit shifting. absolutely unnecessary. But I did it anyway. One thing I think is important is for some reason I wasn’t able to just use a for the heap allocations. So i reused some code from the ryupold/examples-raylib.zig repo and made a custom emscripten allocator. Without this, I was getting issues. I also increased the memory limit to 16MB. Idk which of those fixed it, but it works now! After that, I was sitting at a solid of memory usage, so I think I was good. You can build the game for desktop with . For the web, you need to run the following command: Now, as to why we used . For some reason the build command above fails for the emscripten target with as mentioned in this open issue . If someone can figure out why, please mention it in the issue! You can drop everything in the folder and host it wherever. Was a fun start to my zig arc! I hope you guys don’t waste time debugging shit like me lol. May we zig harder every day. Source Code

0 views