Don't miss our holiday offer - up to 50% OFF!
Ethereum: Why does Github say that the Bitcoin project is 74% TypeScript?
Ethereum: The Unlikely JavaScript Roots of One of Blockchain’s Most Valuable Assets
In a recent examination of the open-source code on Github, cryptocurrency enthusiasts have uncovered a surprising finding that challenges conventional wisdom about the programming languages used to build Bitcoin and Ethereum. Specifically, when clicking “Show language statistics” for the Bitcoin project, one is presented with an astonishing 74% TypeScript codebase.
The seemingly incongruous ratio raises questions about how Bitcoin’s development team managed to create such a large body of code using a language often associated with web development and enterprise software applications. To understand this phenomenon, let’s delve into the history of the Bitcoin project and its source code repositories on Github.
Bitcoin: The C++ Revolution
The first version of Bitcoin (2009) was written almost exclusively in C++. This choice of programming language was deliberate, as the developers sought to create a lightweight, efficient, and secure implementation. The C++ community at the time offered robust performance characteristics and a vast array of libraries, making it an ideal choice for building complex applications.
In fact, the Bitcoin codebase is so heavily invested in C++ that even the developer team’s documentation mentions this aspect: “Bitcoin is written almost entirely in C++. Any language choices were made with the goal of achieving maximum performance.”
Ethereum: The JavaScript Enabler
Fast forward to 2014, when Ethereum (later known as Ethereum Classic) was born. As a separate project from Bitcoin, Ethereum’s developers also chose to use C++ for its core functionality. However, they soon realized that this choice would make it difficult to reuse existing libraries and frameworks.
That’s when JavaScript became the “holy grail” of programming languages for building blockchain applications. With the rise of the web and Node.js, JavaScript had become a widely adopted language with a vast ecosystem of development tools and libraries.
In 2015, Ethereum developers began integrating JavaScript-based technologies into their codebase, leveraging popular frameworks like React, Angular, and Vue.js. This strategic move not only bridged the gap between C++-domesticated Bitcoin and JavaScript-driven Ethereum but also allowed for greater flexibility and scalability.
The TypeScript Revelation
So, why did Github show 74% TypeScript in the Bitcoin project’s source code? The answer lies in the fact that Ethereum developers started using Node.js and other JavaScript-based environments to compile their C++ code into JavaScript. This process, known as “transpilation,” allowed them to leverage popular frameworks and libraries while still maintaining compatibility with the original C++ codebase.
In 2017, Ethereum’s developer team announced the introduction of Solidity, a high-level programming language for building smart contracts on the Ethereum network. This move further cemented JavaScript’s place in the Ethereum ecosystem, as developers could now create more complex and sophisticated applications using this popular language.
Conclusion: A Harmonious Union
In conclusion, the apparent paradox between Bitcoin’s C++ dominance and Ethereum’s JavaScript-driven development raises interesting questions about how different programming languages can coexist and thrive. While it is true that TypeScript was not the primary language used in the Bitcoin project, its 74% presence in Github statistics may seem surprising.
The key takeaway from this analysis lies in understanding how developers can choose to integrate multiple languages and frameworks into their projects while maintaining compatibility with existing codebases.