Jump to content

  • Log In with Google      Sign In   
  • Create Account

C compiler as back end


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
4 replies to this topic

#1 Dawoodoz   Members   -  Reputation: 331

Like
0Likes
Like

Posted 30 May 2012 - 02:27 PM

I want to make a compiler that parse my own language and returns C code to a lower compiler. The problem is that every free C/C++ compiler that I have tried takes around 100 megabytes with all it's dependencies. Is there any free lighweight C compiler for Windows that was made to be used as a back end?

My open source DirectX 10/11 graphics engine. https://sites.google.com/site/dawoodoz

"My design pattern is the simplest to understand. Everyone else is just too stupid to understand it."


Sponsor:

#2 zacaj   Members   -  Reputation: 643

Like
1Likes
Like

Posted 30 May 2012 - 02:58 PM

www.tinycc.org is extremely small: it can compile code at run time even. However I don't think it includes any of the C headers, which are probably what are using most of your space in the first place

#3 Dawoodoz   Members   -  Reputation: 331

Like
0Likes
Like

Posted 30 May 2012 - 03:32 PM

www.tinycc.org is extremely small: it can compile code at run time even. However I don't think it includes any of the C headers, which are probably what are using most of your space in the first place


Nice, I don't even have to compile it using another compiler. :)

My open source DirectX 10/11 graphics engine. https://sites.google.com/site/dawoodoz

"My design pattern is the simplest to understand. Everyone else is just too stupid to understand it."


#4 Zlodo   Members   -  Reputation: 246

Like
0Likes
Like

Posted 31 May 2012 - 04:54 AM

Have you considered using llvm? Generating llvm "assembly code" is pretty easy (as it abstracts away the really annoying stuff like register allocation), you can get llvm to compile it as native code or to JIT it, it can optimize it as good as the best compilers out there, or as little as you want if you prefer the compilation process to be very light and fast, and I doubt that including only the llvm libraries + the target specific back end is that big.

LLVM is pretty much designed for the very purpose of handling your type of use case.

#5 Dawoodoz   Members   -  Reputation: 331

Like
0Likes
Like

Posted 31 May 2012 - 01:27 PM

Have you considered using llvm? Generating llvm "assembly code" is pretty easy (as it abstracts away the really annoying stuff like register allocation), you can get llvm to compile it as native code or to JIT it, it can optimize it as good as the best compilers out there, or as little as you want if you prefer the compilation process to be very light and fast, and I doubt that including only the llvm libraries + the target specific back end is that big.

LLVM is pretty much designed for the very purpose of handling your type of use case.


I plan to use my front end compiler in Visual Studio projects so that I can use it together with C++. The C compiler will just make it complete for module testing.

My open source DirectX 10/11 graphics engine. https://sites.google.com/site/dawoodoz

"My design pattern is the simplest to understand. Everyone else is just too stupid to understand it."





Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS