|
Post by smc44 on Jan 10, 2009 21:13:13 GMT -5
Hi just informing you guys on the forum that i will be writing a program, its going to be my own mini compiler , it will take you text and compile using GCC Compiler basically re compiled into my own compiler, it will start out with very simple commands, like system("start www.google.com"), but they will be in my very own format, for example i might be this instead sys("start, function or const char), well anyways anyone that has, ideas, suggestions or comments that would be helpful go ahead and post away , thanks you guys.
|
|
|
Post by Supermonkey on Jan 11, 2009 13:09:14 GMT -5
|
|
|
Post by smc44 on Jan 11, 2009 14:46:40 GMT -5
Thanks just added those to my favorites, very helpful, ill be very busy
|
|
|
Post by matthew on Jan 11, 2009 15:33:27 GMT -5
You might also want to take a look at this thread created by tom a few years ago. It shows you how to create a simple script interpreter in Basic4GL.
|
|
|
Post by Supermonkey on Jan 11, 2009 16:00:57 GMT -5
One thing I would say as well is to make sure you plan what features you want in your language. You'll find if you don't form some kind of idea about what features you want to include (as well as features you may want to add later on) you'll end up writing very sloppy code which will be hard to build upon.
[edit] Oh and don't expect to get it right first time, especially if you have very little knowledge of how to write a compiler.
|
|
|
Post by DJLinux on Jan 11, 2009 17:22:04 GMT -5
last night i got my first windows exe from my compiler 3040 bytes in size then i switched to Linux and got a binary 2800 bytes in size
both will compile and run but on Linux the same code has one problem a simple box isn't visible if it is rotating if i comment out glRotatef() then the box is visible on Linux too must be a strange bug in my code generator or my opengl version on Linux after 6 hours of debugging i gave up i will setup a second Linux box with Mesa (software OpenGL) and will test it again next week.
by the way the hardest part from my point of view is to generate clever code for large/complex expressions and the code optimization in general
but on the other side it's really cool to create your own language and compiler.
Joshy
|
|
|
Post by smc44 on Jan 11, 2009 17:36:24 GMT -5
Thanks you guys for all of the advice, it should help me
|
|
|
Post by Empyrion Martyr on Jan 12, 2009 6:56:31 GMT -5
smc44, I done a very similar project back in 2005 for school, and then modified it later on. It was named Emerald... It was basically a B4gel program that translated code from my language to gcc c++ and i tell ya it was incredibly entertaining to build. Such a program is difficult to do properly, but you should have a lot of fun in the process .
|
|