What was java written in
In principle almost anything, usually C. Get answers to millions of questions and give back by sharing your knowledge with others. Sign up for an account. Close Sign up. I forgot which one.
In theory, you could use any language to implement the JRE, as long as it can compile to a representation that a Java program can understand. Good luck with that, cyotee. What would your JVM run on? Show 3 more comments. We can imagine how the Java compiler was written in Java like this: The Java compiler is written as a Java program and then compiled with the Java compiler written in C the first Java compiler.
SH 2 2 gold badges 9 9 silver badges 20 20 bronze badges. Computerphile on YouTube has a good video about this and "T diagrams" — iono. Does that also answer the chicken and egg problem : — Skynet. Skynet self-hosted chicken — sportzpikachu. In theory, you dont' even need the bootstraping compiler. You can refer to the Java Language Specification and manually translate the Java Compiler code into bytecode class file , hence bootstrapping.
Though I only tried manually do that with a HelloWorld. Show 2 more comments. Sev Sev For example, it says "Java bytecodes are translated on the fly to native machine instructions interpreted and not stored anywhere" which has not been true for about 5 years! Well, since when has documentation been really up-to-date, especially after large changes?
What compiles Java? Well, how do you get Java? Compile it. Hide TOC. The Java Technology Phenomenon. Java technology is both a programming language and a platform. An overview of the software development process. The Java Platform A platform is the hardware or software environment in which a program runs. Simple Object oriented Distributed Multithreaded Dynamic.
While it's true that the first C compilers obviously couldn't be written in C, it's certainly possible now. Show 19 more comments. Is each and every language written in C language? If the evaluation of the expression is terminated by a break-expression , next-expression , or redo-expression , the behavior is unspecified. Otherwise, let O be the resulting value. The value of the for-expression is the resulting value of the invocation.
Each concept OOP etc is all implemented in C language? TehShrike 7 7 silver badges 14 14 bronze badges. This criticism happens in spite of the fact that C has not yet been invented FrancisDavey: Thanks. I started out compiling the list from memory, then I added dates I didn't remember by looking them up on Wikipedia. After that, I found a timeline of languages on Wikipedia, and picked a few more languages from there. I'll remove the duplicate. In your list, is not "htroF" spelled backwards?
Show 4 more comments. Most of the core of many important languages is written in C, but things are changing: the reference implementation of Python CPython is written in C but there are other implementations written in other languages, e.
There are many reasons why C was often chosen: performance, portability, experience. Somewhat related: Is functional language without runtime written in C possible? Community Bot 1. In addition it has directly or indirectly influenced many later languages at least syntactically. NET base class library is written in C. Counter-examples would help, but your choices are still descended from C. For example, even if Java, Python, etc. The aspiration for many languages is, of course, to be implemented as far as possible in itself.
However, it seems like most languages depend on C because most languages need to be able to call C to be useful; the majority of modern operating system APIs and useful libraries tend to have C bindings. You also have to be careful about what you mean by "written in".
A language implementation typically has multiple parts: at least a compiler and a runtime system. Runtime systems are often written in C to better interface with the OS.
Show 3 more comments. Shane A. Workman 5 4 4 bronze badges. Ofir Ofir 1 1 silver badge 4 4 bronze badges. There are many implementations of Java, most are written in Java. Language designers are certainly influenced by other languages, but they can choose to ignore those influences if they so wish. And in this case, the 'conceptual ancestor' is important but the compiler language is just a barely relevant technical nuance that can change over time.
That last link if of dubious value - too many mistakes in it to really take it seriously. SebastianGodelet: HotSpot is not an implementation of the Java language. It's an implementation of the JVM bytecode language. Those are two completely different languages. Show 6 more comments. I would make this a comment if I could, but I can't so here goes: One of the reasons C seems so ubiquitous is because it is one of the earliest languages developed, and an enormous amount of modern languages are based off of its structure Java, Go, PHP, Perl, etc.
WannabeCoder WannabeCoder 2, 5 5 gold badges 14 14 silver badges 19 19 bronze badges. See cm. Add a comment. There are many ways to write the first compiler of a language which are called bootstrapping Moreover most compilers try to achieve self-hosting , or compile itself it its language, mainly to promote the language and the compiler itself.
0コメント