Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

A language that doesn't use 'C'?

Just curious. I may be wrong, but as far as I know, most languages are created using 'C' sources.

For example: perl , php , python, java(?), go ...

Is there any language that doesn't use C as a low level interpreter/compiler ? (fortran ?)

like image 406
Pierre Avatar asked Nov 16 '09 10:11

Pierre


People also ask

What language can replace C?

Some programmers consider popular languages like Rust, Go, D, and Carbon as C/C++ replacements. Meanwhile, some programmers consider using those languages as C/C++ alternatives that might replace C/C++ in the future.

Is Java written in C?

The very first Java compiler was developed by Sun Microsystems and was written in C using some libraries from C++. Today, the Java compiler is written in Java, while the JRE is written in C.

Are all languages written in C?

Every language uses C language in variable capacity. For example, Python uses C for creating standard libraries, whereas the syntaxes and control structures of languages like C++, PHP and Perl are based on C.

What does C++ have that C doesnt?

C++ was developed by Bjarne Stroustrup in 1979. C does no support polymorphism, encapsulation, and inheritance which means that C does not support object oriented programming. C++ supports polymorphism, encapsulation, and inheritance because it is an object oriented programming language.


1 Answers

C is the language that most modern operating systems are written in, and thus pretty much every other language that wants to run on modern operating systems and modern hardware has to have the ability to interface to C if it wants to interact with the rest of the world at all. Also, because of this, C compilers are ubiquitous, so you can pretty much always rely on a C compiler being available for any platform you're interested in. For these two reason, many languages are either implemented in C (at least in part), or are written to compile to C (so the version compiled to C can be used to bootstrap).

That said, there are still some languages that have very little contact with C. Clozure Common Lisp (formerly OpenMCL, before that Macintosh Common Lisp, before that Coral Common Lisp) is written entirely in Common Lisp. You need to download binaries of it for some platform in order to be able to compile it. It's very common for Lisps to be written in Lisp (sometimes another dialect, sometimes the same one), as Lisp is much older than C. There were even Lisp Machines in the 1970's and 80's that were designed to run Lisp, and the entire operating system and development environment was written in it.

There are many languages that have a compiler and some libraries written in that language, while some libraries and bits of the runtime are written in C. For instance, CMUCL (and its derivative SBCL) are primarily written in Common Lisp, but they have a small C runtime. The same is true of GHC, the Glasgow Haskell Compiler; it's written in Haskell, so you need an existing Haskell implementation to build it (usually Hugs, as that's written in C and thus makes bootstrapping easier), but it has some C code in its runtime.

Scheme 48 is a Scheme that is is written in PreScheme, a limited dialect of Scheme that can be compiled to C, which is itself written in Scheme. The fact that it compiles to C makes bootstrapping easier; the Scheme 48 distribution comes with the code compiled to C already, so you just need to compile that with your system C compiler to get yourself up and running.

There are plenty of other languages written in languages other than C as well. There's Free Pascal, a version of Pascal written in Pascal. There are plenty of languages written in Java, though the JVM itself is mostly written in C. Erlang was originally written in Prolog (which strongly influenced its syntax), but is not written in a combination of C and Erlang.

All programming languages have to be written in something, if you want them to run on an actual computer. In the beginning, the only choice was writing machine code directly. Soon after, people wrote assemblers (originally in machine code, and later themselves in assembler) to make writing machine code easier. That was then followed by high level languages; FORTRAN, Lisp, COBOL, ALGOL, and later still Simula, Smalltalk, C, Pascal, ML, Prolog. Each of these had to be written in something; the earliest were written in assembler, then later some were written in themselves, and others written in another high level language. By the 80's, C was pretty much the dominant systems programming language, and thus it became the default choice for writing a new language in; and that continues to today. But look back to languages from before then, and you'll find plenty implemented in other languages, or even themselves.

like image 169
Brian Campbell Avatar answered Sep 20 '22 23:09

Brian Campbell