Can a second version of a programming language be written in that language?

This question is what I’ve been thinking about lately. Can a programming language be written in that language as a second implementation? like Java. Is it possible to rewrite the Java programming language using the Java programming language?

Sorry if this is a stupid question, but I need to know!

Gf

+6
java programming-languages
source share
13 answers

Yes it is possible. Check out BootStrapping .

+9
source share

Always. Any Turing-Complete is the Turing-Complete language. If you can write a compiler in one full language, you can write it in any equivalent language.

+12
source share

Yes for any Turing Complete language. Lisp comes to mind as one of the easiest languages ​​to write an interpreter / compiler for yourself.

+7
source share

He can. A recent example is that python has pypy . A bit more information is on the Wikipedia page and some good links.

+6
source share

Of course.

Many years ago, one of my first home computers, the Vic 20, came with a built-in BASIC interpreter, but that’s all. So I wrote the first assembler version for it in BASIC. Then I used my first primitive assembler to write better assembler.

+4
source share

Yes. As long as the Turing Complete language, you can implement the language on its own.

+3
source share

There are many practical examples of this, one example is the Oberon language, which is of interest to this discussion because the compiler code is very readable in the Project Oberon book, available for free:

http://www.oberon.ethz.ch/bibliography/publications

http://en.wikipedia.org/wiki/Bootstrapping_(compilers)

+2
source share

GCC compilers are written in C.

It has been a long time since anyone created C compilers from the assembly.

+2
source share

Not just possible, but for compilers with native code, this is the most common implementation technology . A good guide for the guide is Andrew Apel's article Axiomatic Download: A Guide for Compiler Hackers .

+2
source share

It can not only, it is. ecj (the Eclipse compiler) is one example, and I think the SDK itself comes with a pure Java compiler, although I could be wrong about that.

+1
source share

writing a java compiler in java is not a problem at all. actually i think java javac is written in java.

however, "java" usually means more than just javac, so your question is not very clear.

+1
source share

Of course. I even saw someone write a COBOL compiler written in COBOL! (OK, not a complete compiler ... but at least a parser.)

0
source share

Check out 3- LISP

-one
source share

All Articles