My First Compiler
Community Forums/Showcase/My First Compiler
| ||
I designed a small language and wrote a compiler and interpreter for it. It's really only for drawing graphics turtle style. But you can do some pretty complex drawings with it. Check it out in the gallery! http://blitzbasic.com/gallery/view_pic.php?id=1845&gallery=&page=1 I still need to implement a debugger and maybe rewrite the scanner. But once it's finished would anyone be interested in trying it out? |
| ||
Oooh, that looks terribly exciting. How fast does it draw? |
| ||
The shown drawing takes less than a 10th of a second and thats with compiling first. I should run some tests to see exactly how long it takes. I haven't even optimized the interpreter yet. |
| ||
Amazing. |
| ||
I've never been really interested in all that tortoise that swims stuff from the 80's (and probably before). Can you get this thing up to real-time speed? |
| ||
If I wrote an assembler and byte code interpreter I bet it would be usable in real-time. Which is within my realm of understanding. So maybe that will be my next project? |
| ||
Right you are. How long will this take? |
| ||
It could be hacked out in a weekend. |
| ||
By tomorrow? |
| ||
Awesome. I love the graphics turtle style |
| ||
By tomorrow? Sure if I neglected all responsibility.. which I did to get to my current position. My brain has an itch thats telling me to at least take a shower first. I would say don't count on it. |
| ||
Sweet. That looks like a lot of fun. |
| ||
Well, make it a quick shower - save the environment and all that. |
| ||
I'll start on the assembly and byte code interpreter this weekend. I'm going to write it in C++ to ensure better runtime speed. |
| ||
@puki - I started on the byte code interpreter and I've made a lot of progress. I'll keep you updated. |
| ||
Ah, puki... This is fantastical, I'm curious, are you going to publish how you did the compiler? |
| ||
As soon as I'm done I'll release the source code. Either that or I'll write a tutorial. Status Update: The Generic Virtual Machine has been finished. Written entirely in C++ it is the backbone for all of my future interpreters. Now all I need to do is write an assembler. Hopefully I'll get to it later this evening. |
| ||
Wow. This is a contribution of epic proportions! |
| ||
Update: The assembler is finished and the interpreter is at about 80% completion. Tomorrow I'm going to rewrite the compiler. Also, complex drawings are now being rendered at about 1/100th of a second now which should make this language usable in real-time. |
| ||
Wrote my own asembler an interpreter earlier this week. Would love to see the code for the compiler, since mine is doing nothing more than going through a string and checking for known words and filling an array with the opcode equalient. :) |
| ||
...going through a string and checking for known words and filling an array with the opcode equalient. That sounds more like an assembler. I'll release the code to the compiler when this project wraps up. |
| ||
Fantastics stuff! |
| ||
cool |
| ||
sound exciting :) |
| ||
I like the graphics... and M2plays paper planet.cool |
| ||
You got mad skilz. |
| ||
very nice daniel, take a look at the exe builder i wrote sometime back here http://www.blitzbasic.com/codearcs/codearcs.php?code=1116 you might be-able to patch your bytecode into it and create your own exe files :) kev |
| ||
Kev - That is fantastic! I'm going to try and use it this weekend. I'll let you know if I get something working. |