DEV Community

Miraly
Miraly

Posted on

Bootstrapping: A compiler written in its own language

Bootstrapping: A sign of the maturity of programming languages

Bootstrapping is the process by which a programming language or its compiler is written in the same language. This is an indicator of his maturity.

What language are compilers written in?
For example, many people believe that C++ is written in C, and this is true, but only partially. In the past, the first versions of C++ were indeed written in C, but today languages like C, C++, Java, Rust and Go are largely written in themselves. Interestingly, the nasm assembler compiler is written in C. Many might assume that it is written in "zeros and ones", but this is not the case.

The value of Bootstrapping

Bootstrapping demonstrates that the language has sufficient flexibility and maturity to support its own implementation. It also means that the language can serve projects of various levels of complexity, from small scripts to large systems. For example, Rust, written on its own, is actively used to create secure and efficient software, from embedded systems to server applications.

Varieties of Python

You've probably asked yourself if Python is written in Python. The main version of Python, CPython, is indeed written in C, as are most of its libraries. However, there is also a version of Python written in PythonPyPy. Although Python is not by nature the fastest language, PyPy is significantly faster than CPython thanks to JIT-compilation (Just-In-Time). This process optimizes code execution during its execution, which can lead to significant performance gains, but also requires more RAM than a Java virtual machine.

There are also alternatives:
Jython, a version written in Java that allows you to use Java libraries directly from the Python code. However, it does not support all the features of Python, such as some C extension modules.
IronPython is a version for .NET that allows you to use .NET libraries and create interfaces with applications on the .NET platform.

Besides these options, there are others such as:

  • MicroPython
  • CircuitPython
  • Brython
  • Transcrypt
  • Stackless Python
  • Pyjamas
  • Nuitka
  • Pyston

Conclusion

Bootstrapping is a sign of the maturity of the language. If the compiler or interpreter of a language is written in the same language, this indicates the quality and development of the language.

Hi! My name is Mirali. I study hacking and low-level development, going down to the very bottom to see what lies behind a ton of layers of abstractions. I write in Asm, C, C++, and also use scripting languages: Python and JavaScript. This is my first post, and I'd be interested to know which versions of Python you prefer and why. Subscribe if you want to learn more about low-level programming or hacking!

Top comments (1)

Collapse
 
lemper29 profile image
Another

Very interesting article thank you