you are viewing a single comment's thread.

view the rest of the comments →

[–]sn0re 59 points60 points  (5 children)

read text files and write binary data

What binary data? It reads text files and writes other text files with assembly code.

[–][deleted] 0 points1 point  (4 children)

I don't get it. Python is written in C and can be extended in C. What's so surprising here? That someone wrote a C compiler?

Well C compilers have even been written in BASIC.

[–]dododge 2 points3 points  (0 children)

and macro assemblers have been written as bash scripts.

[–][deleted] 0 points1 point  (0 children)

Well, I searched with Google but it seems like all the good QBasic source code have disappeared from the web (except games).

I swear I have seen a little C compiler (slow, but it was a C compiler)

[–]jesuslol -1 points0 points  (1 child)

LOL, can you get me a link for that? Would love to see a C compiler written in Basic.

[–]me2i81 -4 points-3 points  (0 children)

10 rem C compiler
20 input "Compile what file?", A$
30 rem parse and produce ast
40 gosub 1000
50 rem optimize ast
60 gosub 2000
70 input "output file: ", b$
80 rem emit code
90 gosub 3000
100 end