IRC channel logs

2026-09-06.log

back to list of logs

<attila_lendvai>aggi: re handwritten, humanely conprehensible assembly vs compiler output: what about compiler asm output that is also comprehensible? i think it's possible when optimization is not the one and only goal.
<agg3>attila_lendvai: good point, preaching to the choir
<agg3>c-compiler output cannot yet retain something else however, that is hand-written comments inside *.asm sources
<attila_lendvai>agg3, sure, but if the asm has the same label names as in the source language...
<attila_lendvai>maru, this lisp i'm playing with, feels like C in that you can see the asm behind it if you squint a little...
<attila_lendvai>it even compiles to the c ABI, so it can rather directly interact with the C universe
<attila_lendvai>eval1.s is 800k x86 asm, or 375k for eval1.ll, and there wasn't any time spent on making it smaller. i think there are some pretty low hanging fruits...
<attila_lendvai>e.g. i'm about to rewrite the bootstrap that will emit the heap of the next generation as the ELF data segment of the binary. that will remove a the literals which is lot of these numbers
<aggi>attila_lendvai: i've just begun re-iterating over x86 asm (after 20years of absense in this))
<attila_lendvai>err, scratch that, eval1.ll is 1.6 MB
<aggi>i'm focussing on system-integration aspects mainly, and depart into asm realm for the reason only to salvage isohybrid.bin and cdrdtools for live-bootstrap
<attila_lendvai>i don't know much about x86 asm, but then simple compilers don't need much either...
<aggi>isolinux.bin i meant
<aggi>only wanted to say, as before, i'm not a proficient asm hacker
<attila_lendvai>BTW, there's this x86 assembler which is implemented in #define's. if it's of any interest here and not known...
<attila_lendvai>expands to C functions that emit the machine code
<attila_lendvai>this is how in maru a local PEG syntax transforms it into lisp code: https://github.com/attila-lendvai/maru/blob/maru.10/source/assembler/gen-x86-instructions.l
<attila_lendvai>ACTION learned programming in M68k asm on an Amiga 500, but haven't write much asm ever since then
<aggi>when seeing lisp, it appeals as a type of pseudo-code almost, for structural thinking required when hacking machine code
<aggi>even when you haven't got a LISP compiler/interpreter during early bootstrapping stages
<aggi>a simplistic language can help with relating high-level programming to machine code
<aggi>conservative C seems not bad either (i hardly could imagine a macro-expansion for #generic __thread and similar to low level machine code)
<aggi>i'll try to finish the NASM book next week, then get back to tiny-bootstrap and cdrtools/syslinux/isolinux.bin there
<attila_lendvai>when/if i'm done with my current phase of vision, it'll be basically something like a lisp-C amalgam in that looking at the code you will be able to see the asm it compiles to (with things like multiple dispatch), and lisp in that the compiler will be online in an interactive repl. no GC (only stack allocation), and no interpreter.
<attila_lendvai>total LoC well below 10k, probably in the ballpark of 6k, with zero external dependencies, emitting ELF files
<attila_lendvai>well, the only dependency is a bootstrap binary to animate the whole process, which can come from an eval.c, or whatever else we care to produce. i might as well write a C compiler backend that would produce a pretty readable C code.
<aggi>thanks so far attila_lendvai, have to sleep; and i do read the channel backlog here always - just in case i don't respond to everything
<attila_lendvai>aggi, gn! i need to go also... o/
<xentrac>I just got Claude Opus to write a Harvard RISC CPU for me in 86 lines of Verilog, along with a Python simulator and assembler and disassembler for it, and also a Verilog te\
<xentrac>oops!
<xentrac>stbench!
<xentrac>I left out the stbench
<jackdk>Has anyone here been able to get live-bootstrap to boot from usb and to write the bootstrapped system to nvme (bare metal)? The documentation seems a bit thin on the ground re: how to set the target drive etc
<matrix_bridge><Andrius Štikonas> jackdk: yes, my current gentoo system is bootstrapped from usb
<matrix_bridge><Andrius Štikonas> I had to use no kernel bootstrap option though, since it doesn't support BIOS API, only UEFI
<matrix_bridge><Andrius Štikonas> I've just bootstrapped it on USB, then followed mid-kid's guide https://mid-kid.root.sx/git/mid-kid/bootstrap/src/branch/master/gentoo-2025.8/gentoo.txt (it was an older more complicated version though)
<matrix_bridge><Andrius Štikonas> and used internal nvme drive for gentoo prefix
<matrix_bridge><Andrius Štikonas> oh, you want slightly different thing though
<matrix_bridge><Andrius Štikonas> you want to just boot from usb and write to nvme...
<matrix_bridge><Andrius Štikonas> I don't think that's supported
<matrix_bridge><Andrius Štikonas> live-bootstrap scripts assume particular directory structure
<matrix_bridge><Andrius Štikonas> e.g. biuld tree and source tree are nearby
<matrix_bridge><Andrius Štikonas> well, I guess /usr could in principle be mounted elsewhere, but we don't even have mount command at the beginning
<stikonas>jackdk: can you run bootstrap on usb and then copy it to nvme manually?
<jackdk>I possibly could but I was on USB mass storage and the poor machine didn't like something down the line (and rebooted, so I couldn't see what it was). As much as I'd love a "fully bootstrapped" machine I may have to content myself with a nixos built without substituters as a consolation prize
<matrix_bridge><Andrius Štikonas> Perhaps also issues with kernel boitsteap
<matrix_bridge><Andrius Štikonas> Especially of you use bios compat layer
<notgull>Isn’t there a UEFI stage0 somewhere?
<matrix_bridge><Andrius Štikonas> notgull: yes, j wrote it for this reason
<matrix_bridge><Andrius Štikonas> But it stage0- uefi, not full bootstrap
<matrix_bridge><Andrius Štikonas> Well, i have some posix compat layer that can run mes-m2
<matrix_bridge><Andrius Štikonas> And mescc
<matrix_bridge><Andrius Štikonas> But that's it, remaining features are missing
<matrix_bridge><Andrius Štikonas> Probably need to implement memory mapping to proceed further
<matrix_bridge><Andrius Štikonas> https://codeberg.org/stikonas/stage0-uefi