Earlier quoted context omitted.
This tutorial is multipart, the code emitting is in the 3rd part.
I'll believe it when I see it.
Let's make a Teeny Tiny compiler
11–20 of 39 posts
Re: Let's make a Teeny Tiny compiler
#12I'm sorry to be negative here, but this article, like most articles about compilers, is bike shedding. For those not aware of the bike shedding metaphor, it's the assertion that when discussing the design of a nuclear power plant, everyone will want to discuss the color of the shed where the workers store their bikes because they understand it. Meanwhile, nobody will want to discuss the nuclear reactor itself, becaus…
Part 3 is the emitter that produces C: https://web.eecs.utk.edu/~azh/blog/teenytinycompiler3.html
Re: Let's make a Teeny Tiny compiler
#13I'm sorry to be negative here, but this article, like most articles about compilers, is bike shedding. For those not aware of the bike shedding metaphor, it's the assertion that when discussing the design of a nuclear power plant, everyone will want to discuss the color of the shed where the workers store their bikes because they understand it. Meanwhile, nobody will want to discuss the nuclear reactor itself, becaus…
Part 3 is the emitter that produces C: https://web.eecs.utk.edu/~azh/blog/teenytinycompiler3.html
Congrats on at least having an emitter, but I'm still searching for an article that shows how to emit assembly of any kind.
Re: Let's make a Teeny Tiny compiler
#14I'm sorry to be negative here, but this article, like most articles about compilers, is bike shedding. For those not aware of the bike shedding metaphor, it's the assertion that when discussing the design of a nuclear power plant, everyone will want to discuss the color of the shed where the workers store their bikes because they understand it. Meanwhile, nobody will want to discuss the nuclear reactor itself, becaus…
i know what the bike shedding metaphor is and frankly you're stretching it a bit because all this person is trying to do is educate and they're not even saying this is the only way to do it.
seems odd to pull out the bike shed metaphor for every case there's an abundance of technical articles on a subject matter. There's lots of tutorials on for loops in X language. Do you consider that bike shedding?
Re: Let's make a Teeny Tiny compiler
#15Earlier quoted context omitted.
I'll believe it when I see it.
I'll take "what is due diligence" for 300, Alex.
Re: Let's make a Teeny Tiny compiler
#16Earlier quoted context omitted.
Part 3 is the emitter that produces C: https://web.eecs.utk.edu/~azh/blog/teenytinycompiler3.html
Ah, okay. It looks like you're taking a fairly C-like language and transforming it to C--I'd call this a transpiler rather than a compiler. You're not wrong to call it a compiler, but it's a pretty noncentral example of a compiler. Congrats on at least having an emitter, but I'm still searching for an article that shows how to emit assembly of any kind.
My favorite was always context-sensitive, interprocedural points-to analysis. And dataflow analysis in the presence of higher-order controlflow constructs.
Re: Let's make a Teeny Tiny compiler
#17Re: Let's make a Teeny Tiny compiler
#18Earlier quoted context omitted.
This tutorial is multipart, the code emitting is in the 3rd part.
I'll believe it when I see it.
Re: Let's make a Teeny Tiny compiler
#19Earlier quoted context omitted.
I'll take "what is due diligence" for 300, Alex.
I guess I was technically wrong in that it does have an emitter, but I wasn't wrong in that it still doesn't emit assembly. gcc (or whatever you're using to compile your C) is still doing all the nuclear reactor part.
Re: Let's make a Teeny Tiny compiler
#20Earlier quoted context omitted.
Part 3 is the emitter that produces C: https://web.eecs.utk.edu/~azh/blog/teenytinycompiler3.html
Ah, okay. It looks like you're taking a fairly C-like language and transforming it to C--I'd call this a transpiler rather than a compiler. You're not wrong to call it a compiler, but it's a pretty noncentral example of a compiler. Congrats on at least having an emitter, but I'm still searching for an article that shows how to emit assembly of any kind.
so instead of
self.emitter.emitLine("printf(\"" + self.curToken.text + "\\n\");")
you do something like self.emitter.emitLine("STRING DB " + self.curToken.text + "', '$'")
...
self.emitter.emitLine("LEA DX,STRING")
self.emitter.emitLine("MOV AH,09H")
self.emitter.emitLine("INT 21H")