Earlier quoted context omitted.
I would think that making a minimal forth or lisp would be the better path towards that goal, then use that to bootstrap a c compiler.
A recent comment from LWN on that note: https://lwn.net/Articles/893608/ I asked about this on their IRC channel and got this response from oriansj: Well we did bootstrap a FORTH from hex: https://github.com/oriansj/stage0/blob/master/stage2/forth.s and we did bootstrap a garbage collecting Lisp from hex: https://github.com/oriansj/stage0/blob/master/stage2/lisp.s but if you notice: https://github.com/oriansj/stage0/…
A minimal C compiler in x86 assembly
11–20 of 79 posts
Re: A minimal C compiler in x86 assembly
#12Earlier quoted context omitted.
A recent comment from LWN on that note: https://lwn.net/Articles/893608/ I asked about this on their IRC channel and got this response from oriansj: Well we did bootstrap a FORTH from hex: https://github.com/oriansj/stage0/blob/master/stage2/forth.s and we did bootstrap a garbage collecting Lisp from hex: https://github.com/oriansj/stage0/blob/master/stage2/lisp.s but if you notice: https://github.com/oriansj/stage0/…
The link is broken.
Re: A minimal C compiler in x86 assembly
#13Earlier quoted context omitted.
A recent comment from LWN on that note: https://lwn.net/Articles/893608/ I asked about this on their IRC channel and got this response from oriansj: Well we did bootstrap a FORTH from hex: https://github.com/oriansj/stage0/blob/master/stage2/forth.s and we did bootstrap a garbage collecting Lisp from hex: https://github.com/oriansj/stage0/blob/master/stage2/lisp.s but if you notice: https://github.com/oriansj/stage0/…
That an inexperienced C programmer wrote what appears to be 5000 lines of assembly in 24 hours implementing a fully working C compiler seems... a rather extraordinary claim. The file size of around 130K would indicate typing non-stop for 24 hours at something like 100 characters per minute.
Re: A minimal C compiler in x86 assembly
#14Re: A minimal C compiler in x86 assembly
#15Earlier quoted context omitted.
A recent comment from LWN on that note: https://lwn.net/Articles/893608/ I asked about this on their IRC channel and got this response from oriansj: Well we did bootstrap a FORTH from hex: https://github.com/oriansj/stage0/blob/master/stage2/forth.s and we did bootstrap a garbage collecting Lisp from hex: https://github.com/oriansj/stage0/blob/master/stage2/lisp.s but if you notice: https://github.com/oriansj/stage0/…
That an inexperienced C programmer wrote what appears to be 5000 lines of assembly in 24 hours implementing a fully working C compiler seems... a rather extraordinary claim. The file size of around 130K would indicate typing non-stop for 24 hours at something like 100 characters per minute.
Re: A minimal C compiler in x86 assembly
#16Earlier quoted context omitted.
A recent comment from LWN on that note: https://lwn.net/Articles/893608/ I asked about this on their IRC channel and got this response from oriansj: Well we did bootstrap a FORTH from hex: https://github.com/oriansj/stage0/blob/master/stage2/forth.s and we did bootstrap a garbage collecting Lisp from hex: https://github.com/oriansj/stage0/blob/master/stage2/lisp.s but if you notice: https://github.com/oriansj/stage0/…
That an inexperienced C programmer wrote what appears to be 5000 lines of assembly in 24 hours implementing a fully working C compiler seems... a rather extraordinary claim. The file size of around 130K would indicate typing non-stop for 24 hours at something like 100 characters per minute.
Not only that. It would be typing at that speed without testing anything. In assembly. Haha. In reality what would happen is that you would type 24 hours (not in one day, I assume) and then spend the next days finding the places where you wrote R5 instead of R4.
And, of course, without losing any time on refactoring already written code (changing order of parameters, finding a better name for a function, etc.)
Re: A minimal C compiler in x86 assembly
#17Re: A minimal C compiler in x86 assembly
#18Earlier quoted context omitted.
I would think that making a minimal forth or lisp would be the better path towards that goal, then use that to bootstrap a c compiler.
A recent comment from LWN on that note: https://lwn.net/Articles/893608/ I asked about this on their IRC channel and got this response from oriansj: Well we did bootstrap a FORTH from hex: https://github.com/oriansj/stage0/blob/master/stage2/forth.s and we did bootstrap a garbage collecting Lisp from hex: https://github.com/oriansj/stage0/blob/master/stage2/lisp.s but if you notice: https://github.com/oriansj/stage0/…
> writing a C compiler in assembly that supports structs, unions, arrays, inline assembly and a bunch more was done in less than 24 hours by an inexperienced C programmer.
That’s a weird commit comment (“Implemented C version of cc_knight-native”) for a commit that adds a C compiler.
Also, how do you conclude from that that it took less than 24 hours to write that commit (or any)?
Re: A minimal C compiler in x86 assembly
#19"Minimal" being almost 5KLOC, sheesh. Actually, I'm surprised that a C compiler fits in that space. Also: --- Goal This is a set of manually created hex programs in a Cthulhu Path to madness fashion. Which only have the goal of creating a bootstrapping path to a C compiler capable of compiling GCC, with only the explicit requirement of a single 1 KByte binary or less.
Re: A minimal C compiler in x86 assembly
#20I'm surprised they wrote a minimal C compiler in assembly rather than any LISP dialects, then make a C compiler in LISP
I recommend you check out the author's GitHub page. It includes Forth and Lisp projects, explains why C was a success while those projects failed, and challenges any Forth and Lisp fan to actually substantiate their baseless claims with actual work instead of pushing beliefs that don't have any bearing on reality.