Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

self hosting

Name: Anonymous 2010-10-26 2:47

hey /prog/ how does one make a language self-hosting?

for example, what would it take to make clojure compile directly into an x86 binary

Name: Anonymous 2010-10-26 4:13

>>1
read the dragon book

First of all, compilers may be self hosting or not self hosting, but this is not a property that describes languages.  "Self hosting language" doesn't make sense.  "Clojure is self hosting" means that the Clojure compiler (not the language) is written in the Clojure language and that it can compile itself, NOT that it produces x86 binaries.

So your question should be, "How does one write an x86 back-end for a compiler?"  That is a completely different question from the one you asked.  The answer is, "Same way you write any other back end.  The x86 architecture is not special."  However, writing new back ends for x86 is not a productive pastime.  Use an IL like LLVM or C, unless you are an expert or are okay with producing slow binaries.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List