Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » Community » Coffee corner » "(national) C compiler"
Re: "(national) C compiler" [message #20693 is a reply to message #20690] Tue, 31 March 2009 20:38 Go to previous messageGo to previous message
cbpporter is currently offline  cbpporter
Messages: 1401
Registered: September 2007
Ultimate Contributor
I would recommend porting something. C is an extremely complex language and unfortunately you do have to implement most features to have something functional. I would recommend implementing at first two basic types: char and int. That should get you started. Combine with simple pointers, and you have something capable of most tasks that don't require structs. Programing languages are my hobby and I implemented once a "new C++", but I gave up the moment I discovered D.

Code generation is another hard part. Witting x86 assembly is relatively difficult and very difficult if you want to write an optimizing compiler. But if you leave out code generation phase and pass it on to a different tool, you could get a functional mini compiler in about 3000-5000 lines of code. With code generation and optimization you will need hundreds of thousands of lines of code, a full team and at least 10 years of development Smile.

I would recommend checking out Clang. It is based on LLVM. It's not quite ready yet, but the code is relatively simple to understand. Or maybe D sources. They are not that long, but more difficult to understand. And there was a "simple retargetable C compiler" I played around about 5 years ago called lcc.

I hope you find something to get you started in those projects. With Clang you should be able to change the keywords in hours. But still, please don't waste too much time on C Razz Twisted Evil.

 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Potential U++ job in CZ
Next Topic: subversion client recommendation
Goto Forum:
  


Current Time: Sun May 12 12:16:28 CEST 2024

Total time taken to generate the page: 0.02348 seconds