Prev: USB drives, caching and sync
Next: Which CPU to choose?
From: mike on 11 Jan 2010 14:05 Philipp Klaus Krause wrote: > I asked this question here about one and a half years ago. I'm posting > again since I'm curious about the current situation. > > I want to look at alternatives to C for Z80 programming using languages > that compile to C. There are the following requirements: > > - Compiles to C > - Free compiler > - Low memory usage (I have only 1KB of RAM, 32KB of ROM) > > Has anyone come across such a language? > > The last requirement seems to be a rather hard one. Many languages that > compile to C include relatively large overhead or do dynamic allocation > of memory, etc. So far bitc (http://bitc-lang.org/) seems to be the > closest match, but it's abandoned. > > Philipp Won't help you with the Z80, but flowcode is worth a look for ideas.
From: Philipp Klaus Krause on 11 Jan 2010 14:18 Doug McIntyre schrieb: > http://www.antlr.org/ Isn't antlr just a parser generator like yacc? Philipp
From: -jg on 11 Jan 2010 14:26 On Jan 12, 3:21 am, Philipp Klaus Krause <p...(a)spth.de> wrote: > I asked this question here about one and a half years ago. I'm posting > again since I'm curious about the current situation. > > I want to look at alternatives to C for Z80 programming using languages > that compile to C. There are the following requirements: > > - Compiles to C > - Free compiler > - Low memory usage (I have only 1KB of RAM, 32KB of ROM) > > Has anyone come across such a language? > > The last requirement seems to be a rather hard one. Many languages that > compile to C include relatively large overhead or do dynamic allocation > of memory, etc. So far bitc (http://bitc-lang.org/) seems to be the > closest match, but it's abandoned. > > Philipp What exactly are you trying to do, or trying to avoid ? just asking for 'any language' is strange.... The Z80 is going to have many compiler choices, but few that target C - why would they ?. When you go through another hop like this, you loose important debug coupling to your source code, and it's not clear what you gain. The Z80 is also not likely to attract truckloads of active development ;) An alternative would be to find an abandon-source form of the language you want, and create a C-ASM output format - that should give 'other language in', and give other-C-linking, which I am guessing is why you need C. In the PLD realm, it is now common to see Verilog/VHDL, as low-level 'assembler' languages inside the tool chains. If you do not need other-C-linking, just take the language native Z80 output ? -jg
From: Jon Kirwan on 11 Jan 2010 16:58 On Mon, 11 Jan 2010 15:21:02 +0100, Philipp Klaus Krause wrote: >I asked this question here about one and a half years ago. I'm posting >again since I'm curious about the current situation. > >I want to look at alternatives to C for Z80 programming using languages >that compile to C. There are the following requirements: > >- Compiles to C >- Free compiler >- Low memory usage (I have only 1KB of RAM, 32KB of ROM) > >Has anyone come across such a language? > >The last requirement seems to be a rather hard one. Many languages that >compile to C include relatively large overhead or do dynamic allocation >of memory, etc. So far bitc (http://bitc-lang.org/) seems to be the >closest match, but it's abandoned. I'm not sure what you are _really_ trying to find. C++ used to be translated to c with something called cfront. Up until version 4, when growing exception handling requirements finally forced a transition to true c++ compilation to object code. cfront is largely dead, now. But that doesn't mean it wouldn't still be an option. It did a great job for what it did. Of course, I have no way to know if it meets your needs. There's p2c for a Pascal. Klaus Bothe wrote these two papers, for example: "Rules for the Transformation from Pascal to C," 1987 "A portable high-speed PASCAL to C Translator," 1989 I remember something called f2c, as well. There was also RATFOR, back in my college school days, which translated a "nicer" version "rational FORTRAN" to FORTRAN II code. It was very easy to implement on your own and worked well. And GNU compiler front ends exist, as well. Even for ADA, I believe. Could you talk about _exactly_ what you feel you need here, and why? Jon
From: Grant Edwards on 11 Jan 2010 17:07
On 2010-01-11, Jon Kirwan <jonk(a)infinitefactors.org> wrote: > On Mon, 11 Jan 2010 15:21:02 +0100, Philipp Klaus Krause > wrote: > >>I asked this question here about one and a half years ago. I'm posting >>again since I'm curious about the current situation. >> >>I want to look at alternatives to C for Z80 programming using languages >>that compile to C. There are the following requirements: >> >>- Compiles to C >>- Free compiler >>- Low memory usage (I have only 1KB of RAM, 32KB of ROM) >> >>Has anyone come across such a language? >> >>The last requirement seems to be a rather hard one. Many languages that >>compile to C include relatively large overhead or do dynamic allocation >>of memory, etc. So far bitc (http://bitc-lang.org/) seems to be the >>closest match, but it's abandoned. > > I'm not sure what you are _really_ trying to find. C++ used > to be translated to c with something called cfront. Up until > version 4, when growing exception handling requirements > finally forced a transition to true c++ compilation to object > code. cfront is largely dead, now. But that doesn't mean it > wouldn't still be an option. It did a great job for what it > did. Of course, I have no way to know if it meets your > needs. I think we've got a pretty good clue that it won't meet his needs: 1KB RAM and 32KB of ROM. :) -- Grant Edwards grante Yow! We are now enjoying at total mutual interaction in visi.com an imaginary hot tub ... |