LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 05-11-2017, 02:36 PM   #1
Xeratul
Senior Member
 
Registered: Jun 2006
Location: UNIX
Distribution: FreeBSD
Posts: 2,357

Rep: Reputation: 213Reputation: 213Reputation: 213
Best alternative to the famous GCC ?


Hello,

I am looking for a possible more simple alternative to GCC?

Actually, I would be happy actually to have a small minimal source code of a C compiler for learning experience - learning in-depth C programming.
 
Old 05-11-2017, 03:13 PM   #2
Didier Spaier
LQ Addict
 
Registered: Nov 2008
Location: Paris, France
Distribution: Slint64-14.2.1.2 on Lenovo Thinkpad W520
Posts: 9,921

Rep: Reputation: Disabled
From Fabrice Bellard: https://fr.wikipedia.org/wiki/Fabrice_Bellard on his home page: https://bellard.org/ see TCC and OTCC.
 
Old 05-11-2017, 03:36 PM   #3
Xeratul
Senior Member
 
Registered: Jun 2006
Location: UNIX
Distribution: FreeBSD
Posts: 2,357

Original Poster
Rep: Reputation: 213Reputation: 213Reputation: 213
Quote:
Originally Posted by Didier Spaier View Post
From Fabrice Bellard: https://fr.wikipedia.org/wiki/Fabrice_Bellard on his home page: https://bellard.org/ see TCC and OTCC.
he is really a king of programming, by excellence.

Code:
Tiny C Compiler (tcc), compilateur C, petit, mais complet ; à l'origine, il a été écrit pour gagner le concours humoristique « International Obfuscated C Code Contest » (concours du code le plus obscur en langage C).
 
Old 05-11-2017, 03:43 PM   #4
Laserbeak
Member
 
Registered: Jan 2017
Location: Manhattan, NYC NY
Distribution: Mac OS X, iOS, Solaris
Posts: 508

Rep: Reputation: 143Reputation: 143
clang/LLVM

https://clang.llvm.org

It has Apple behind it.
 
Old 05-11-2017, 03:53 PM   #5
Didier Spaier
LQ Addict
 
Registered: Nov 2008
Location: Paris, France
Distribution: Slint64-14.2.1.2 on Lenovo Thinkpad W520
Posts: 9,921

Rep: Reputation: Disabled
Quote:
Originally Posted by Laserbeak View Post
clang/LLVM
I don't think it has "a small minimal source code of a C compiler for learning experience" as requested.
 
Old 05-11-2017, 03:58 PM   #6
Xeratul
Senior Member
 
Registered: Jun 2006
Location: UNIX
Distribution: FreeBSD
Posts: 2,357

Original Poster
Rep: Reputation: 213Reputation: 213Reputation: 213
Quote:
Originally Posted by Didier Spaier View Post
I don't think it has "a small minimal source code of a C compiler for learning experience" as requested.
welcome - we have free mind - we use linux, bsd or the free unix family
 
Old 05-11-2017, 03:58 PM   #7
Laserbeak
Member
 
Registered: Jan 2017
Location: Manhattan, NYC NY
Distribution: Mac OS X, iOS, Solaris
Posts: 508

Rep: Reputation: 143Reputation: 143
Quote:
Originally Posted by Didier Spaier View Post
I don't think it has "a small minimal source code of a C compiler for learning experience" as requested.
Perhaps, but it's the only viable freeware alternative to gcc that I know of that will compile complex programs.
 
Old 05-11-2017, 04:05 PM   #8
Laserbeak
Member
 
Registered: Jan 2017
Location: Manhattan, NYC NY
Distribution: Mac OS X, iOS, Solaris
Posts: 508

Rep: Reputation: 143Reputation: 143
It has taken over gcc in Apple systems, gcc is just a link to it:

Code:
| =>  gcc -v
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 8.0.0 (clang-800.0.42.1)
Target: x86_64-apple-darwin16.6.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
 
Old 05-11-2017, 04:13 PM   #9
Didier Spaier
LQ Addict
 
Registered: Nov 2008
Location: Paris, France
Distribution: Slint64-14.2.1.2 on Lenovo Thinkpad W520
Posts: 9,921

Rep: Reputation: Disabled
Quote:
Originally Posted by Laserbeak View Post
Perhaps, but it's the only viable freeware alternative to gcc that I know of that will compile complex programs.
Did you try the Tiny C Compiler? Here is what Fabrice claims
Quote:
"TCC is a tiny but complete ISOC99 C compiler which enables you to use C as scripting language. TCC has its roots in the OTCC project. The TCCBOOT boot loader demonstrate the speed of TCC by compiling and launching a Linux kernel in less than 15 seconds."
Oh and about LLVM:
Code:
didier[/storage/slackware64-14.2/source/d/llvm/llvm-3.8.0.src]$ find -name "*.c"|wc -l
52
didier[/storage/slackware64-14.2/source/d/llvm/llvm-3.8.0.src]$ find -name "*.cpp"|wc -l
1649
So Xeratul, see you in a few years if you want to study all these source files thoroughly

PS Now to know how many lines of code you need to study:
Code:
didier[/storage/slackware64-14.2/source/d/llvm/llvm-3.8.0.src]$ find -name "*.cpp" -exec wc -l '{}' ';'| sed "s/ .*//" > /tmp/linescpp
didier[/storage/slackware64-14.2/source/d/llvm/llvm-3.8.0.src]$ for i in $(</tmp/linescpp);do nblines=$(($nblines + $i)); done; echo $nblines
4242656
didier[/storage/slackware64-14.2/source/d/llvm/llvm-3.8.0.src]$
Good luck.

Last edited by Didier Spaier; 05-11-2017 at 04:40 PM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
famous numbers in science sycamorex General 37 07-16-2010 12:26 AM
so famous but still complicated - os and kernel vkmgeek Linux - General 5 08-01-2008 08:33 AM
Famous Last Words perry Linux - General 13 09-11-2007 04:05 PM
the famous ndiswrapper problem... rgistered Slackware 10 03-29-2006 11:48 PM
Famous People on LQ :) MasterC General 9 07-02-2003 05:19 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 02:43 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration