Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How much work would adding a new backend be? #52

Open
AbleTheAbove opened this issue May 7, 2024 · 2 comments
Open

How much work would adding a new backend be? #52

AbleTheAbove opened this issue May 7, 2024 · 2 comments
Labels

Comments

@AbleTheAbove
Copy link

I have been looking for a small c compiler to hack a backend into for my bytecode virtual machine and so far most are not approachable at all..

@rofl0r
Copy link

rofl0r commented May 8, 2024

the amount of needed code seems to be roughly 2 KLOC judging by the removal of a backend: 2a18041
now divide that linecount by your average LOC/h and you know how much work it will be.

@alexfru
Copy link
Owner

alexfru commented May 10, 2024

If you're OK with everything (int, float, pointer/address) being 32-bit and smaller (16-bit and 8-bit for smaller integer types) and your architecture is sufficiently regular, it should be relatively straightforward. Look at that removed code generator mentioned above or the MIPS32 code generator (they're similar to one another). Supporting 64-bit types with the current design/implementation of SmallerC is quite hard.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants