2

I'm curious from a performance perspective if writing a cryptocurrency from the ground up in a language other than C/C++ be stupid?

For example, if I wanted to write a cryptocurrency and protocol in Python or Nodejs, would I run into performance and speed issues later down the rode since these languages aren't as "low-level"?

Or are there any other issues besides performance I would run into?

Any thoughts are appreciated. Thanks

1

There's no reason why a cryptocurrency needs to be written in a low level language. It's just that Satoshi's original implementation of Bitcoin happened to be in C++ (perhaps that was the language he/they felt most comfortable with), so now a lot of people seem to think it has to be that way. It doesn't.

You could certainly implement a cryptocurrency (either an existing one, or a totally newly designed one), in Python, or Javascript, or pretty much anything else. Wallet software is mostly managing a big database with a bunch of hashing.

1

Writing a fully fledged cryptocurrency in an interpreted language will see many performance issues. The difference is not whether you implement the code in a high or low level language, it’s whether that language is compiled or interpreted.

JavaScript was traditionally an interpreted language, but many new JS engines (including Google’s V8, used in Node.js as well as Chromium) are actually Just-In-Time (JIT) compilers, meaning source code is taken as input and compiled to machine code at runtime. This is why we see many Bitcoin and other cryptocurrency libraries in JavaScript: performance gains of compiling to machine code, but using a high level language for what some consider a better development experience. Python, on the other hand, may be a poor choice, depending on your runtime (I know there are now Python environments that can compile to machine code, but it is mostly an interpreted language today)

Wallet software may be implemented in different languages to resolve concerns about portability+ease of setup, as performance should be less of an issue here than it would for software designed for validating transactions and mining.

  • There is no bright-line distinction between "compiled" and "interpreted" programming languages. In any case, such a distinction would not be a property of the language, but rather of the implementation of the language. Since a language can have multiple different implementations, you can't attach such a label to the language as a whole. Also, Python has always compiled to an internal bytecode, which is no less compiled than say Java is. Python would be a perfectly reasonable choice to write wallet software, it can handle databases just fine and hashing is implemented in native code. – Greg Hewgill Dec 19 '17 at 23:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.