Compiler

Programming, for all ages and all languages.
Post Reply
emfader
Posts: 7
Joined: Mon Sep 05, 2011 5:58 am

Compiler

Post by emfader »

Hey guys, I am set to start on OS project from scratch.
My question is should I build a compiler or I can use an existing one?
I mean the OS will be in assembly language form when compiled, so why should I build a compiler.
Hope I explained my concern correctly.
User avatar
NickJohnson
Member
Member
Posts: 1249
Joined: Tue Mar 24, 2009 8:11 pm
Location: Sunnyvale, California

Re: Compiler

Post by NickJohnson »

A compiler for a new language (or an old one) is a pretty big project; probably equal or greater in magnitude than a whole OS. If you're just starting out, I'd highly recommend writing your OS using an existing language toolchain like C/GCC. Once you're more experienced, you can try doing language development and OS development at the same time.
User avatar
iansjack
Member
Member
Posts: 4685
Joined: Sat Mar 31, 2012 3:07 am
Location: Chichester, UK

Re: Compiler

Post by iansjack »

I wouldn't recommend trying to write a compiler (one thing at a time, please), but you almost certainly want to build a cross-compiler. See the Wiki for details.
User avatar
Love4Boobies
Member
Member
Posts: 2111
Joined: Fri Mar 07, 2008 5:36 pm
Location: Bucharest, Romania

Re: Compiler

Post by Love4Boobies »

emfader wrote:I mean the OS will be in assembly language form when compiled, so why should I build a compiler.
This is an illogical sentence, like "If soup is good for you, why use toilet paper?" How does it follow that you should or shouldn't build a compiler from the target language (i.e., assembly) of the compiler(s) you will use?
"Computers in the future may weigh no more than 1.5 tons.", Popular Mechanics (1949)
[ Project UDI ]
Post Reply