Prev: USB drives, caching and sync
Next: Which CPU to choose?
From: Rob Gaddi on 11 Jan 2010 12:42 On 11 Jan 2010 17:33:28 GMT Doug McIntyre <merlyn(a)geeks.org> wrote: > don <don> writes: > >Any compiler that compiled to C was created to help people convert > >to C so they can get a modern supported language. > >That transition was do in the 1980s. > >I doubt that anyone would be doing this conversion as an active > >project, why would they. > > Thats not true, C makes a good generic low-level portable universal > target to compile to, much like ANTLR or LLVM or any of the other > independant platform target platforms. There have been many historical > comments that C is mainly a higher level version of assembly on the > original platforms it was developed on (especially ancient historical > versions). > > You'd probably easily find a few dozen modern languages that compile > to C as output. > > >As you have noticed, not much out there. > > There are many out there that compile to C. > The main issue is none of them are exactly lightweight memory users, > suitable for embedded systems programming which is what he is looking > for. > > >And, why would you want to write in any dead language, then convert > >it to C ? > > Most likely because he has a C compiler for his target platform, and > the likelyhood of finding a higher level language that compiles to C > is much greater than finding a higher level language that he likes > that compiles down to Z80 assembly. An argument could certainly be made that, if you need something higher level than C in order to clearly express the problem you're working on, a Z80 might not be the tool of choice. -- Rob Gaddi, Highland Technology Email address is currently out of order
From: David Brown on 11 Jan 2010 13:16 Doug McIntyre wrote: > don <don> writes: >> Any compiler that compiled to C was created to help people convert to C >> so they can get a modern supported language. >> That transition was do in the 1980s. >> I doubt that anyone would be doing this conversion as an active project, >> why would they. > > Thats not true, C makes a good generic low-level portable universal > target to compile to, much like ANTLR or LLVM or any of the other > independant platform target platforms. There have been many historical > comments that C is mainly a higher level version of assembly on the > original platforms it was developed on (especially ancient historical > versions). > There you have mentioned one possibility - LLVM has a backend generating reasonable C, and has various front-ends. Again, most of these will be too big for the Z80 - just because you /can/ use LLVM to generate C code from Python, Ruby, etc., does not mean the results will fit on the device!
From: don on 11 Jan 2010 13:35 Doug McIntyre wrote: > You'd probably easily find a few dozen modern languages that compile > to C as output. > > There are many out there that compile to C. Please, no offense, but do you have any links ?? I did use a Fortran to C compiler when I was in school in the early 80s. don
From: Niklas Holsti on 11 Jan 2010 13:50 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) Rob Gaddi wrote: > An argument could certainly be made that, if you need > something higher level than C in order to clearly express > the problem you're working on, a Z80 might not be the > tool of choice. I would strongly disagree with such an argument. A 32 KB program can be quite complex, even if only 1 KB of RAM is used, so this Z80 is certainly large enough for a complex application. If the target is constrained, the programmer needs all the help he or she can get, and a high-level language can be a much more powerful "tool for thought" than C. Of course, some "high level" languages need lots of RAM, but others do not; it depends on what one means with "high level", and what kind of targets a particular implementation is meant to support. I don't know of any *free* compilers that would satisfy the OP, however. -- Niklas Holsti Tidorum Ltd niklas holsti tidorum fi . @ .
From: Doug McIntyre on 11 Jan 2010 13:55
don <don> writes: >Doug McIntyre wrote: >> You'd probably easily find a few dozen modern languages that compile >> to C as output. >> >> There are many out there that compile to C. >Please, no offense, but do you have any links ?? The two projects I referenced are going to be the biggest places. http://www.antlr.org/ http://llvm.org/ There will be many front ends on these platforms, utilizing their C backend output engines, look through the various projects built on these platforms. Other than those two, the most recent language that comes to mind is Google Go http://golang.org/ >I did use a Fortran to C compiler when I was in school in the early 80s. And the original C++ cfront did output C code as well. |