C compiler

PM development, programming, hacking and all that fun stuff.
zoranc
Posts: 298
Joined: August 13th, 2010, 18:13
Contact:

C compiler

Post by zoranc »

I consider porting some C compiler to generate PM code. So here are some questions:

- Would you like to use it?

- What features you consider essential? Maybe it will be striped down of some features like float point numbers, no std library etc.

- Do you think that C++ would be actually useful for PM?
Nekotaku
Posts: 10
Joined: July 23rd, 2010, 17:13

Re: C compiler

Post by Nekotaku »

Hi Zoranc, best of luck with your project!
Regarding your questions:
* Yes, I'd definitely use it. Programming in assembly is fun, but for ambitious projects C would make a huge difference.
* Basically everything that either doesn't quite fit in the PM's architecture is probably best left out. Libraries will probably get made soon enough once the basis is solid. Providing proper access to the sprite and bg tile rendering of the Mini does seem essential, though, so that might be worth spending attention on.
* Object orientation seems like so much overhead for such a little machine. I think one step up from asm is quite enough.
User avatar
KR155E
Admin
Posts: 60
Joined: April 10th, 2010, 20:31

Re: C compiler

Post by KR155E »

gccPM? :)

A C compiler is definitely needed for the PM! With a decent library of defines and functions, that would ease development so much, especially for new people and those who don't know ASM (like me).
User avatar
Agilo
PM.net Staff
Posts: 34
Joined: October 1st, 2008, 01:38
Location: The Netherlands
Contact:

Re: C compiler

Post by Agilo »

Personally, I wouldn't use a C compiler for the PM.
I think it's a good idea though; it would really benefit new developers.
Lupin
Team Pokémé
Posts: 94
Joined: January 10th, 2005, 13:06

Re: C compiler

Post by Lupin »

I would actually pay a small bounty if you would make a working C compiler for the PM.

I already started to look for compilers that should be easy to port. The vbcc compiler looked quite simple to port (but it's still a lot of work).
http://www.compilers.de/vbcc.html

First you'd need to port the assembler (vasm) for PM and integrate the instructions as described in the tech wiki:
http://wiki.sublab.net/index.php/Pokemon_Mini

The best way to program the mini would be a combination of asm+C code.

A basic compiler would also be very much appreciated :)

Edit: only basic features would be needed. Of course no floating point numbers. Optimization isn't important (fast code should be written in asm). The most important point for a C compiler is to have more readable code than asm.
zoranc
Posts: 298
Joined: August 13th, 2010, 18:13
Contact:

Re: C compiler

Post by zoranc »

i had similar design targets myself too. make it possible for easier to read projects. easier to write big software projects. no big emphasis on the size and performance of the generated code. also floating point, CLIB and C++ support would be optional.

somehow i draged away from the projects since my idea to combine with another similar project failed. the compilers i was looking into most were EDG and LLVM but i guess they are more complicated than the one you pointed out.

also i lost interest in PM software development, since only flash card that i have doesn't fit the original cart so it's not that portable. besides i have just one of them and would have to keep it only for myself.

this amount of money is atm not very interesting to me. i'd rather put more in the bounty pot myself, of there is someone with more free time and motivation.
Lupin
Team Pokémé
Posts: 94
Joined: January 10th, 2005, 13:06

Re: C compiler

Post by Lupin »

Of course i would also add (new) flashcarts and linkers to the bounty pot once i have them ready (i resumed workin on the flashcarts, but i think i will have to revise the design and order new boards)
zoranc
Posts: 298
Joined: August 13th, 2010, 18:13
Contact:

Re: C compiler

Post by zoranc »

new flash cards! awesome news coming on my birthday!
zoranc
Posts: 298
Joined: August 13th, 2010, 18:13
Contact:

Re: C compiler

Post by zoranc »

Back to the compiler topic - it seems that vbcc would be great choice for our system. Relatively easy to write an back-end. Flexible design that allows lot of tweaks in the back-end code generation.

I'm also considering to do the port myself. For that I'll need better understanding of the processor capabilities. Some design decisions also have to be made, concerning easier implementation and better performance.
Nekotaku
Posts: 10
Joined: July 23rd, 2010, 17:13

Re: C compiler

Post by Nekotaku »

We'll be rooting for you! Actually, even hand-optimizing the ASM wouldn't matter much, just having it generated from something higher-level would be a huge jump in productivity.
Post Reply