6 ms·
Frame – Linux X server in Assembly
- Tiberium 2mo agoWas there a reason to add an AI-generated image to the top of the article? :(
- stonogo 2mo agoThe article about an AI-generated X11 server? Why not?
- mikepavone 2mo agoArticle reads like it was AI-generated too
- VortexLain 2mo agoThis guy vibecodes his whole stack, from X server, WM, terminal emulator, to shell and text editor. It would've been weird not to have an AI-generated image in an article =)
- mintflow 2mo agothis is impressive, even with claude i think the guy have enough deep understanding of the OS and the varioius topic make it works recently i also rewrite most of the app's underlying core function to rust, just like the guy do for the phone perhaps i should also do more stuffs given codex reset too quickly
- system7rocks 2mo agoInteresting. I've never quite found that Linux is more optimized on battery-powered machines for energy savings, even though supposedly there is a lot of room to tweak and optimize settings -- from selecting a low resource window manager/DE to turning off various services to switching up power management utilities. But this does seem like an approach that might produce that kind of fruit?
- c0balt 2mo agoYou might want to take a look at TLP[0]. It, among other things, backs the power mode/profile panels in Gnome/KDE. Many distros already try to push good defaults, but you can do a whole lot when optimizing for a mobile experience. You can also do some fun stuff with it, like running a script[1] when going from ac->bat power to, e.g., turn of a service, lower refresh rate or reduce brightness. [0]: https://linrunner.de/tlp/index.html https://linrunner.de/tlp/index.html [1]: https://linrunner.de/tlp/usage/run-on.html#run-on-ac-run-on-bat https://linrunner.de/tlp/usage/run-on.html#run-on-ac-run-on-...
- cogman10 2mo agoThe really unfortunate thing about linux is the defaults tend to be not battery friendly. For example, I recently got another 1 hour out of my old laptop's battery because I didn't realize for the intel video card driver I needed to add some modprobe flags to get it to load up a firmware binary blob. Doing that enabled hardware video decoding, faster performance, and lower power usage. There's a bunch of setting like this that you need to make sure are turned on to get the best battery performance. Some OSes are better about toggling them than others and mine (gentoo) let's you discover later that you forgot to turn them on :).
- exe34 2mo agoHey could you tell me about this flag please? I have an intel gpu and might need it too!
- vinceguidry 2mo agoVidar wrote one in pure Ruby. https://github.com/vidarh/ruby-x11 https://github.com/vidarh/ruby-x11
- yjftsjthsd-h 2mo agoAt a glance, that looks like an X client library, not an X server?
- vinceguidry 2mo agoAh! You're right, I had read somewhere that he'd implemented his own X windows but I suppose I was mistaken.
- vidarh 2mo agoI had Claude prototype one, but it's not complete or public yet...
- yjftsjthsd-h 2mo agoI am loving the shift from 'X11 is too big and messy to ever reimplement' to 'there are multiple wildly different X servers being built from scratch'. Also, has anyone run it successfully? I got as far as building and running with --display and then running `DISPLAY=:7 dwm` and `DISPLAY=:7 alacritty`, but I can't seem to focus the window to actually type. Given that the author posted a picture of the thing actually running a live environment and claims to actually be using it, I'm pretty sure this is a me problem but I haven't been able to figure out where it is. Mouse works, too.
- Kelteseth 2mo ago> 'there are multiple wildly different X servers being built from scratch' by claude code. So this was only possible since no human had to bear looking at X original source code.
- vidarh 2mo agoI think not looking at the original X source code is probably a good thing. The protocol is reasonably well specified, and you can further use the XML specification used for XCB. Most of the requests are pretty simple. For some of the trickier ones it might be worth diving into an X11 implementation, but you can also defer most of the trickier ones other than getting the event handling right (most of the old school drawing API mostly matters if you want to run 30+ year old software that hasn't been updated much since; that said it might be nice to be able to run twm and xeyes - I have a whole separate file in my own X11 server for legacy stuff required to run twm and xeyes and similar ancient software, but not useful for anything else I actually care to run...)
- bogdan 2mo agoTry running `tile` as a wm. I imagine it's not fully compliant to support dwm.
- yjftsjthsd-h 2mo agoHuh. So it's not the window manager. It's individual applications that are working or not. Working: tile, dwm, pcmanfm-qt, feh, dmenu, glass Not: alacritty, st So... Thus far, anything but a terminal other than glass. I'd think the problem was alacritty doing fancy things with APIs that frame doesn't have, but st??
- ConanRus 2mo ago[dead]
- ToyKeeper 2mo agoIt's funny to see someone using a LLM as a compiler, making it convert higher-level operations into assembly, instead of just using a compiler.
- pjmlp 2mo agoEventually that will be the way, revenge of COBOL and 4GLs.
- idiotsecant 2mo agoThere is evidence that LLMs are capable of making assembly that runs a great deal more efficiently than the compiler can manage on its own.
- wild_egg 2mo agoThere are a ton of optimization opportunities that hinge on the intent of a piece of code which static compilers can never detect at scale. LLMs can actually navigate that and write surprisingly optimal assembly. I've had all my side projects being written in x64 for the last 6 months and it is shockingly effective.
- VortexLain 2mo agoThey can navigate that, if specifically targeted towards that, with proper adversarial reviews (including human reviews). The question is, if one takes their time and has enough competence to do that.
- Agingcoder 2mo agoDo you have references ?
- kibwen 2mo agoThe purpose of an optimizing compiler is not merely to produce efficient assembly. The goal of an optimizing compiler is to produce efficient assembly while confidently preserving a program's observable logical semantics. Asking an LLM to spit out raw unstructured assembly based on inferred context from a specification given in English is a contender for one of the worst ideas I have ever heard; I award you no points, and may God have mercy on your soul.
- adrian_b 2mo agoWhen first looking at the source code, I wondered why one would waste so much time to write 25k lines in raw assembly language, but then I saw that it was generated with Claude, for whom it does not matter much how expanded is the written text. If someone had written this program manually, the strategy would have been very different. With a good macro-assembler (and nasm is good enough) one should define a great number of macros, to encapsulate all the tedious boilerplate, especially for things like function prologues, epilogues and invocations. With a well written macro library, an assembly program can be almost as compact as a C program, instead of containing many text lines for each equivalent high-level language statement. Such an assembly source with good macros can be read and understood much more easily than raw assembly language, like in this "frame.asm". Otherwise, this is interesting work.
- tty456 2mo agoSounds like another prompt is in order to re-write the code
- kees99 2mo agoClaude has surprisingly good knowledge of X11 protocol. The other day, colleague showed me a (pretty basic) terminal emulator written in one-shot by Opus. Kicker is - that was compiled to a 30 KB static binary. That's right. No libX11, no libXfont, not even libc.
- glitchc 2mo agoNo libc? It used inline assembly routines?
- kees99 2mo agoYes, something like this: static inline long read(int fd, void *buf, long count) { register long rax asm("rax") = __NR_read; register long rdi asm("rdi") = (long)fd; register long rsi asm("rsi") = (long)buf; register long rdx asm("rdx") = count; asm volatile( "syscall" : "+r"(rax) : "r"(rdi), "r"(rsi), "r"(rdx) : "rcx", "r11", "memory" ); return rax; }
- NetOpWibby 2mo agoBeautiful. Using LLMs to create perfect tools for yourself is my favorite thing about them. No dependencies and better performance? Fantastic.
- elendilm 2mo ago<I am not sure this laptop has a fan anymore. Except me.> I wish mine had no fan too except me.
- inigyou 2mo agoYou can just open it up and take out the fan. Might experience thermal throttling or shutdown though. For extra credit, go into the BIOS and underclock it until that doesn't happen.
- fhn 2mo agoWas browsing some of the other rust projects(https://isene.org/fe2o3/#tools https://isene.org/fe2o3/#tools) and https://github.com/isene/torii https://github.com/isene/torii says "Mozilla removed Firefox's "Open network login page" banner". I'm on windows and still see the banner so don't know if this is true. Is the really true on Linux?
- spikk 2mo agoI wonder if very cheap code generation will make software monocultures less relevant here. Because lots of incompatible devices is awful to work with, security stuff may also hurt
- pjmlp 2mo agoUp voting as it kind of makes the point I believe in, regarding how this AI powered tooling eventually will land on. COBOL and 4 GL dreams coming into reality.
- gen2brain 2mo agoI would like to see a similar project that fixes Wayland. Like, can someone vibe-code window positioning, add SSD to GNOME (damage was already done, but still), and add the ability to send events so you can automate and drive the app offscreen for testing.
- edumucelli 2mo agoOMG, yes, please, get rid of all those composers, all that mess that people are doing. X11 is 40 years of battle testing. Wayland in 22 years (it already has 18) will be 100x worse than X11. A Dockbar I am working on https://github.com/edumucelli/docking/ https://github.com/edumucelli/docking/ is a pain to build on Wayland. It already supports a lot of composers and even mutter/gnome with that Gnome shell extension, but at what cost ...
- hacker_homie 2mo agoDaniel Stone from linux.conf.au 2013, The Real Story Behind Wayland and X https://www.youtube.com/watch?v=RIctzAQOe44 https://www.youtube.com/watch?v=RIctzAQOe44 You can always use XWayland if you feel that way.
- inigyou 2mo agoWayland is designed not to support all that stuff. If you're going to reimplement X in Wayland you might as well just use X.
- deleted 2mo ago[deleted]
- Chu4eeno 2mo agoOne of the issues with Wayland is that it forces every compositor to reimplement the X server, badly. So you can't really "fix it", short of patching e. g. Gnome's compositor, with patches that will never be accepted upstream.
- fc417fc802 2mo ago
- shevy-java 2mo ago> The underlying graphics engine, the thing that puts pixels on the screen. X11 is 4 million lines of code, a beast very few can claim they understand. Working on it: https://github.com/X11Libre/xserver https://github.com/X11Libre/xserver And they also deleted old code too. A lot of the old code could probably be removed, but is it really that relevant whether you have 4 millions line of code or 2 million lines of code? C is in my opinion too overbose. Rust is even worse. Which language would yield fewer lines of code without speed penalty? C is king largely because of the speed gains. We don't see people use python for an xserver.
- inigyou 2mo agoThe biggest problem with Xorg refactoring is that the entire surface area, every non-static function, is module API and there are closed-source modules everyone relies on (mostly Nvidia).
- elcritch 2mo agoNim gives me similar performance to C++ in generally half the LOC. For example I had Codex port Kiwi Cassowary C++ to Nim: https://github.com/elcritch/kiwiberry https://github.com/elcritch/kiwiberry
- out-of-ideas 2mo agocan it run Doom?
- dlojudice 2mo agoHow many times have people posted here about how software is no longer optimized because CPUs keep evolving, making programmers lazy? It seems things have changed. The question is: will LLMs manage to squeeze the most out of this hardware, better than compilers do? In the few tests I’ve run, yes, a lot.
- jcs 2mo agoMost of the gain seems to come from choosing a much smaller program. Frame implements enough X11 for this one desktop and leaves out decades of compatibility work that a compiler would still have to preserve.
- Yokohiii 2mo agoFor that to happen people have to prompt for it. Usually they already struggle to get basic stuff done.
- bogwog 2mo ago> I wrote my own I see the growing trend of words losing all meaning is still going strong in 2026. I wonder what human communication will look like in the near future?
- QwenGlazer9000 2mo agoYou're absolutely right!
- deleted 2mo ago[deleted]
- ape4 2mo agoI wrote my own.... symphony, novel, programming language, etc
- xkriva11 2mo agoReminds me this meme: https://pbs.twimg.com/media/HNIjjQQasAA77yl.jpg https://pbs.twimg.com/media/HNIjjQQasAA77yl.jpg
- deleted 2mo ago[deleted]
- orphereus 2mo agoI wrote my own comment on hackernews. This is the prompt I used...
- gspr 2mo agoThank you. I dread where we're heading.
- cassianoleal 2mo agoI already see a lot of people say they've "read" a certain book when they mean they listened to the audiobook instead.
- yndoendo 2mo agoWords matter to me. This why I say "consumed" vs read. Audiobooks are great for walks and long car drives.
- casey2 2mo ago>I wrote AI wrote*
- throwaway613746 2mo ago[dead]
- kosolam 2mo ago״I am not sure this laptop has a fan anymore. Except me״ huh nice one
- Quitschquat 2mo agoI'm a prolific vibe coder too, but I'm not going say I WROTE MY OWN Emacs for Commodore 64.
- asveikau 2mo agoI can have a machine generated X server in assembly too. It's called cc -s. Or: $ objdump --disassemble /usr/lib/xorg/Xorg Maybe I'm getting too old for this, but I really don't see the point in having AI generate assembly code for this.
- wojciii 2mo agoIt's just you. Everything that can be done with LLMs is better than without. Why use tooling at all when you just can use a LLM? Maybe just make the LLM generate machine code for your tager directly. Just like making digital systems that are "better" than analog ones from the past because of digital.
- asveikau 2mo agoThat hasn't been my experience at all. The quality of these things is absolutely terrible. Maybe if you have no taste and no actual skill, you can't tell the difference. The fact that you have chosen to say this about generated amd64 assembly is telling. This is a terribly pointless exercise. Further, the llms are bad at more niche languages especially. Even experimenting with having them write C, which is quite a bit more common than writing straight assembly, I have seen them fall over quite severely.
- ozhero 2mo agoThis is the very definition of "scratching your own itch" lol. Very inspiring and I applaud your efforts. I haven't written assembler in years but this inspires me to do a small project for the fun of it.
- segmondy 2mo agoWith the crazy lack of supply for hardware and ridiculous prices, seems we are going to have to start squeezing more juice out of our existing hardware. What I would love to see is how well this runs on an ancient system. Will this for instance run on an old PI and make it snappy?
- vidarh 2mo agoAn X11 server is rarely on the hot path for rendering. Most X11 apps does most of the rendering to shared memory buffers themselves.
- orphereus 2mo agoAt first I was so interested into this guy, writing his own everything, thinking this has got to be something to aspire to, to be as good a programmer as this guy. Then I realised LLMs wrote this, and I was so very disappointed. It was naive and stupid of me to think otherwise, but here I am.
- VortexLain 2mo agoThis person's idea is that if LLMs can create personalized and efficient software on the fly, it's good enough to use such software instead of more bloated, existing software which has to accommodate for usecases outside of his. Sortof like suckless.org, but vibecoded on the fly. I've found his Rust android development framework quite interesting, and will probably try using that to vibecode some software I've always wanted to have for my own personal use, but I've never had the time to code properly, especially considering it won't be useful for anyone else. Of course, I'll probably release it under a FOSS license, in case somebody finds it useful anyways.