Bitcoin Forum
May 06, 2024, 12:21:35 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Bitcoin and C++  (Read 341 times)
project_delta (OP)
Jr. Member
*
Offline Offline

Activity: 98
Merit: 2


View Profile WWW
September 26, 2018, 09:53:42 AM
 #1

I came across that the Bitcoin's core programming language was written in C++. My question is why?

PROJECT DELTA
Shaping the Future of Blockchain
Project DELTA develops a game-changing Blockchain Protocol; projectdelta.io/
1714954895
Hero Member
*
Offline Offline

Posts: 1714954895

View Profile Personal Message (Offline)

Ignore
1714954895
Reply with quote  #2

1714954895
Report to moderator
Remember that Bitcoin is still beta software. Don't put all of your money into BTC!
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
aleksej996
Sr. Member
****
Offline Offline

Activity: 490
Merit: 389


Do not trust the government


View Profile
September 26, 2018, 11:35:12 AM
Merited by Carlton Banks (1), ABCbits (1)
 #2

C languages are one of the most popular and efficient programming languages that are used today, so I would rather ask a question, why not?

Bitcoin Core can be quite a resource intensive program, since it is verifying all the transactions on the network and downloading all the blocks.
Using something like Java, whose VM can be quite memory greedy or script languages, such as Python, that do not compile to machine code, wouldn't be the right fit.

We need something fast, powerful and very familiar to the open source community to use as a reference client for the Bitcoin network.
C++ is a right fit for that.
Carlton Banks
Legendary
*
Offline Offline

Activity: 3430
Merit: 3071



View Profile
September 26, 2018, 12:10:09 PM
Last edit: September 26, 2018, 07:52:38 PM by Carlton Banks
Merited by ABCbits (1)
 #3

Bitcoin Core can be quite a resource intensive program, since it is verifying all the transactions on the network and downloading all the blocks.
Using something like Java, whose VM can be quite memory greedy or script languages, such as Python, that do not compile to machine code, wouldn't be the right fit.

Right, well designed C++ is what makes it possible to run the Bitcoin client on e.g. Raspberry Pi type machines, as well as other embedded systems such as a point of sale terminals (although a BTC point of sale terminal running Bitcoin would need to be much more powerful than a typical PoS). Bitcoin written in Java or other memory managed languages would push the minimum requirements up far enough that low power computing devices would cope far worse, and possibly make them not viable platforms for running the Bitcoin client altogether.

C would probably slow development down too much. Some may try to make a case for using newer languages like Go or Rust, or more esoteric ones such as Erlang or Haskell. But I think using C++ is probably more widely used than these, and so will attract more contributors and reviewers. C++ is almost certainly the best suited language for the job.

Vires in numeris
odolvlobo
Legendary
*
Offline Offline

Activity: 4298
Merit: 3214



View Profile
September 26, 2018, 07:21:14 PM
 #4

I have a related concern with the idea that the Bitcoin Core source code is the Bitcoin protocol specification.

Eventually, the C++ language will go the way of COBOL. Very few people will be able to interpret and maintain the specification in the not-too-distant future.

Join an anti-signature campaign: Click ignore on the members of signature campaigns.
PGP Fingerprint: 6B6BC26599EC24EF7E29A405EAF050539D0B2925 Signing address: 13GAVJo8YaAuenj6keiEykwxWUZ7jMoSLt
Ix
Full Member
***
Offline Offline

Activity: 218
Merit: 128


View Profile
September 26, 2018, 09:54:35 PM
 #5

I have a related concern with the idea that the Bitcoin Core source code is the Bitcoin protocol specification.

Eventually, the C++ language will go the way of COBOL. Very few people will be able to interpret and maintain the specification in the not-too-distant future.

COBOL was never designed as a general purpose language. Part of the problem with C/C++ is that we are absolutely, irrevocably stuck with it because it is so integral in so many things. It means that newer and potentially better-designed languages have slim chances of succeeding because of C++'s dominance. It isn't going anywhere anytime soon.

With that said, it might be beneficial to move the core to some high level language/script that is then interpreted by a C++ or any other compiler.
apimembership
Full Member
***
Offline Offline

Activity: 448
Merit: 124



View Profile
September 27, 2018, 03:24:25 AM
 #6

I have a related concern with the idea that the Bitcoin Core source code is the Bitcoin protocol specification.

Eventually, the C++ language will go the way of COBOL. Very few people will be able to interpret and maintain the specification in the not-too-distant future.

COBOL was never designed as a general purpose language. Part of the problem with C/C++ is that we are absolutely, irrevocably stuck with it because it is so integral in so many things. It means that newer and potentially better-designed languages have slim chances of succeeding because of C++'s dominance. It isn't going anywhere anytime soon.

With that said, it might be beneficial to move the core to some high level language/script that is then interpreted by a C++ or any other compiler.
additionally, still there are many improvements for C++, some people thinks C/C++ still has 1999 standards. People should look at C++11, C++14 and C++17 standards to understand how powerful language C++ is.
https://en.wikipedia.org/wiki/C%2B%2B11
https://en.wikipedia.org/wiki/C%2B%2B14
https://en.wikipedia.org/wiki/C%2B%2B17
HeRetiK
Legendary
*
Offline Offline

Activity: 2926
Merit: 2091


Cashback 15%


View Profile
September 27, 2018, 08:33:51 AM
 #7

I have a related concern with the idea that the Bitcoin Core source code is the Bitcoin protocol specification.

Eventually, the C++ language will go the way of COBOL. Very few people will be able to interpret and maintain the specification in the not-too-distant future.

COBOL was never designed as a general purpose language. Part of the problem with C/C++ is that we are absolutely, irrevocably stuck with it because it is so integral in so many things. It means that newer and potentially better-designed languages have slim chances of succeeding because of C++'s dominance. It isn't going anywhere anytime soon. [...]

To add to that, C/C++ compilers are much better understood and tested than compilers of newer languages. If only by merit of being around for much longer. So while newer languages may seem better designed and more appropriate they still have a couple of years, maybe even decades left until they reach the level of trust and performance of C/C++.

I mean just look at Ada. That language is even older than C/C++ but there's a reason why to this day it's still being used for military and avionic software development.

.
.HUGE.
▄██████████▄▄
▄█████████████████▄
▄█████████████████████▄
▄███████████████████████▄
▄█████████████████████████▄
███████▌██▌▐██▐██▐████▄███
████▐██▐████▌██▌██▌██▌██
█████▀███▀███▀▐██▐██▐█████

▀█████████████████████████▀

▀███████████████████████▀

▀█████████████████████▀

▀█████████████████▀

▀██████████▀▀
█▀▀▀▀











█▄▄▄▄
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
.
CASINSPORTSBOOK
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀▀█











▄▄▄▄█
bob123
Legendary
*
Offline Offline

Activity: 1624
Merit: 2481



View Profile WWW
October 05, 2018, 05:59:10 AM
 #8

In addition, c++ provides hight level security.

Uhm.. what?  Huh

How shall this be understood ?
A programming language can never provide any level of security.

The security of a project/program/whatever is determined by the way it is programmed, the used functions/checks/etc.. not the programming language..

Rather stability and performance can be determined by the programming language, but definitely not the security.

Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!