View Full Version : I need some programming help.
azorne
August 18th, 2012, 12:25 PM
Right, I haven't even finished high school, and my CS teacher has given me a compiler as a project. Because I'm not exactly in his good books, I've decided to 1UP him and plow ahead. The only problem is, we use a really antiquated version of C++, (yes I know, C++ is a nightmare, but its a school thing) so no STL. Meaning I've got to implement everything from scratch. Can someone debug my code? PM me, and I'll send it to you.
Cheers, Alex.
root
August 18th, 2012, 12:26 PM
yeah sure. i'll try.
TheMatrix
August 18th, 2012, 04:15 PM
It took many years and a lot of effort to write a compiler. One does not simply "just write one", because you would not only need to be a super excellent programmer, but you'd need knowledge of all the platforms you intend to compile on. That means you need to implement every instruction for the target processor, and there are many of those.
And that's not even starting with the other hardware.
Do you know the details of any specific processor? Perhaps OpenRISC is a good place to start, and you can actually implement it on an FPGA. Go to Xilinx or Altera or someplace and buy yourself a nice board. Xilinx's Virtex on a Spartan is widely used.
And as a matter of fact, the RTL compiles without too many modifications.
You'd be wasting your time, though, there's already GCC backends that have been tested time and time again. Oh, and by the way, good luck writing a compiler in C++. That won't be easy.
darkwoon
August 18th, 2012, 07:32 PM
Right, I haven't even finished high school, and my CS teacher has given me a compiler as a project. Because I'm not exactly in his good books, I've decided to 1UP him and plow ahead. The only problem is, we use a really antiquated version of C++, (yes I know, C++ is a nightmare, but its a school thing) so no STL. Meaning I've got to implement everything from scratch. Can someone debug my code? PM me, and I'll send it to you.
Cheers, Alex.
You need to be more specific about what the assignment is, and which tools you are using.
If you have a specific question/issue, ask. But debugging a homework assignment as a whole? That's part of what YOU are supposed to do by yourself, I think :)
Do you know the details of any specific processor? Perhaps OpenRISC is a good place to start, and you can actually implement it on an FPGA. Go to Xilinx or Altera or someplace and buy yourself a nice board. Xilinx's Virtex on a Spartan is widely used.
And as a matter of fact, the RTL compiles without too many modifications.
I have doubts the assignment goes as far as that :)
vBulletin® v3.8.9, Copyright ©2000-2021, vBulletin Solutions, Inc.