Tiny-C Compiler (2001)
iro.umontreal.ca
Tiny-C Compiler (2001)
1–10 of 82 posts
Re: Tiny-C Compiler (2001)
#2Re: Tiny-C Compiler (2001)
#3Re: Tiny-C Compiler (2001)
#4It’s worth noting that this is a compiler for the Tiny-C language, and not as one might think a tiny compiler for the C language.
Calling it a compiler is (to me) really stretching things, I can't see any code to emit any other form of the code, it's all aimed at evaluating (executing) it.
Edit: oops, I didn't read the code closely enough, it does emit code but only internally, that code is what gets executed. Thanks for the corrections!
Re: Tiny-C Compiler (2001)
#5Here's why real languages are better than stripped down languages: Anyone with programming knowledge can implement a Brainfuck interpreter in a few hours and run any Brainfuck program. Anyone with a tiny bit of CS knowledge can implement a Tiny BASIC interpreter in just a day and then you can run any real Tiny BASIC program from the late 70s. It's cool to run real programs people actually used. With this stripped down C, there are no pre-made real programs...
0:https://en.wikipedia.org/wiki/Brainfuck 1:https://en.wikipedia.org/wiki/Tiny_BASIC
Re: Tiny-C Compiler (2001)
#6It’s worth noting that this is a compiler for the Tiny-C language, and not as one might think a tiny compiler for the C language.
Compiler for the Tiny-C Language (2001)
In fact, that is exactly how the source code describes itself in the comments.
Re: Tiny-C Compiler (2001)
#7The second assignment was writing a Scheme interpreter.
Re: Tiny-C Compiler (2001)
#8It’s worth noting that this is a compiler for the Tiny-C language, and not as one might think a tiny compiler for the C language.
It's probably better to call it an interpreter, since it will also run the program and print the values of all non-zero variables afterward. Calling it a compiler is (to me) really stretching things, I can't see any code to emit any other form of the code, it's all aimed at evaluating (executing) it. Edit: oops, I didn't read the code closely enough, it does emit code but only internally, that code is what gets execu…
Re: Tiny-C Compiler (2001)
#9https://news.ycombinator.com/item?id=8558822
The 26 predefined integer variables make this look like a variant of minimal BASIC, except with structured control flow instead of only GOTO.
Re: Tiny-C Compiler (2001)
#10It’s worth noting that this is a compiler for the Tiny-C language, and not as one might think a tiny compiler for the C language.
It's probably better to call it an interpreter, since it will also run the program and print the values of all non-zero variables afterward. Calling it a compiler is (to me) really stretching things, I can't see any code to emit any other form of the code, it's all aimed at evaluating (executing) it. Edit: oops, I didn't read the code closely enough, it does emit code but only internally, that code is what gets execu…