MrCrank (OP)
|
|
February 08, 2018, 09:28:42 AM |
|
Hi,
I want know, Is Python good for bitcoin apps?
I want to try make easy bitcoin app and heard that Python is best for coding blockchain.. Is it really? (I choose new stack for code)
or best stack MEAN?
What language you use for coding?
Thanks.
|
|
|
|
bob123
Legendary
Offline
Activity: 1624
Merit: 2481
|
I want know, Is Python good for bitcoin apps?
Depends on what you mean with "apps". Python is a scripting language. You won't be able to comfortably code "big" software using python For small scripts, sure.. python is awesome IMO. I want to try make easy bitcoin app and heard that Python is best for coding blockchain.. Is it really?
There is no "best for coding blockchain". Blockchain is a technology. Bitcoin utilizes blockchain. The best programming language to code scripts/programs is the one you are most comfortable with! If you are just starting to program and you don't want to code a wallet like electrum from scratch i would say Python is pretty good to get started. Its straight forward and lets you pretty much "do whatever you want" without having to worry about memory allocation, etc.. too much What language you use for coding?
I personally use either C, Java or Python. Most preferably i use python because.. well.. its basically like writing pseudo code. Additionally you can basically modify strings/data in python any way you want without having to write 100's of lines just for a simple modifying function.
|
|
|
|
jackg
Copper Member
Legendary
Offline
Activity: 2856
Merit: 3071
https://bit.ly/387FXHi lightning theory
|
|
February 08, 2018, 11:51:45 AM |
|
Python is used a lot of programming apps as it's easier to program and is a bit more forgiving syntax wise than other programming languages are.
There are some useful code snippets on github depending on what specifically you're trying to program for? If you want to look into basic stuff, there's a Python module called Bitcoin-tools that might be helpful if you don't want to code from scratch.
As an extra note, Python is quite slow as a language to run (not entirely sure why) so you can't make really complex stuff using it, for that you'd turn to C/C#/C++.
|
|
|
|
Julia_KA
Member
Offline
Activity: 96
Merit: 15
|
|
February 08, 2018, 11:55:58 AM |
|
Python is used a lot of programming apps as it's easier to program and is a bit more forgiving syntax wise than other programming languages are.
There are some useful code snippets on github depending on what specifically you're trying to program for? If you want to look into basic stuff, there's a Python module called Bitcoin-tools that might be helpful if you don't want to code from scratch.
Thank you for a cool tip! Will definitely check github out. I'm not that good at Python but it's interesting to see what people came up with. Thanks again!
|
|
|
|
bob123
Legendary
Offline
Activity: 1624
Merit: 2481
|
|
February 08, 2018, 12:43:22 PM |
|
As an extra note, Python is quite slow as a language to run (not entirely sure why) ...
For the ones of you who are interested in why phyton is slower than other languages (C for example): 1) Python is more of a interpreted than compiled language. (This is dependend on the implementation. Bust mostly its interpreted) 2) Initialization of variables is dynamically, not statically. In C the compiler knows the type of a variable by its definition. In Python the interpreter only knows that assigned variables are objects. The interpreter has to create/initialize a new python object to hold the returned value when the code is already running. 3) Pythons object model leads to inefficient memory access Regarding Arrays: In C you have a pointer to a contiguous data buffer. In Python (list) you have a pointer to a contiguous buffer of pointers, each of which points to a python object which has references to its data. This make python more expensive in terms of storage and access time.
|
|
|
|
bitcoinvamp
|
|
February 08, 2018, 05:41:00 PM |
|
Hi,
I want know, Is Python good for bitcoin apps?
I want to try make easy bitcoin app and heard that Python is best for coding blockchain.. Is it really? (I choose new stack for code)
or best stack MEAN?
What language you use for coding?
Thanks.
I think choosing a language is not what matters but what matter is that in which language you are more comfortable and which language you know better. But i guess python is way more easy to operate than java , c++ or even C . I personally like to use either python or perl both are extremely easy to use compared to java and c++. Python is preferred more because it can be compiled into a executable code or even can run uncompiled. Python is way easier to understand even for beginners so choosing python over java and C++ will be a good choice.
|
|
|
|
TechPriest
Sr. Member
Offline
Activity: 377
Merit: 282
Finis coronat opus
|
|
February 08, 2018, 10:12:08 PM |
|
But i guess python is way more easy to operate than java , c++ or even C . I personally like to use either python or perl both are extremely easy to use compared to java and c++ Python is good for script programs: parsers, bots and others. But many "big" programs writed on Python. Pywallet, electrum and others. Python is preferred more because it can be compiled into a executable code or even can run uncompiled.
Every code can be compiled into exe. You can run code uncompiled only if you have python interpreter. Python is way easier to understand even for beginners so choosing python over java and C++ will be a good choice.
It's hard to say what's "easier". It depends what you are learning before in your life.
|
In science we trust!
|
|
|
Welsh
Staff
Legendary
Offline
Activity: 3318
Merit: 4116
|
|
February 08, 2018, 11:07:13 PM |
|
Python is considered simple by nature and is a little easier to pick up than some programming languages which require a little bit more work to get things to work but, I believe you can learn more from actually running into more problems and figuring them out. The easy way isn't always the most beneficial.
|
|
|
|
MrCrank (OP)
|
|
February 09, 2018, 01:53:02 AM |
|
I want create script and use blockchain node API and create "little" online/offline game Thanks for answers. I will try get few lessons "Python coding" and after will make choose.
|
|
|
|
GarrySingh
Jr. Member
Offline
Activity: 77
Merit: 2
CarnaLife.io
|
|
February 09, 2018, 05:49:14 AM |
|
Hi,
I want know, Is Python good for bitcoin apps?
I want to try make easy bitcoin app and heard that Python is best for coding blockchain.. Is it really? (I choose new stack for code)
or best stack MEAN?
What language you use for coding?
Thanks.
According to me, if you have complete knowledge of even one kind of programming language, you won't find it difficult to understand a code in another language, I don't think it is necessary to learn python from scratch for this purpose.
|
CarnaLife | Revolutionizing Healthcare (https://carnalife.io/en)
|
|
|
jackg
Copper Member
Legendary
Offline
Activity: 2856
Merit: 3071
https://bit.ly/387FXHi lightning theory
|
|
February 09, 2018, 04:26:41 PM |
|
I want create script and use blockchain node API and create "little" online/offline game Thanks for answers. I will try get few lessons "Python coding" and after will make choose. JSON and URLLIB (preisntalled in Python are helpful - if you are pulling info from it). I started fiddling with pulling block data from it. They do have a limit of one request per 10 seconds which is quite slow if you want to pull quite a few blocks (I haven't tried going below it but now and again if you make 2 requests in the same 10 seconds it might go unnoticed).
|
|
|
|
Welsh
Staff
Legendary
Offline
Activity: 3318
Merit: 4116
|
|
February 10, 2018, 02:32:25 AM |
|
I want create script and use blockchain node API and create "little" online/offline game Thanks for answers. I will try get few lessons "Python coding" and after will make choose. You could tie into that via Python. I would imagine that there's several APIs out there which support the blockchain and Python. Bitcoin is written in c++ but, isn't one of the easiest languages to learn as it's quite awkward in certain areas.
|
|
|
|
aplistir
|
|
February 10, 2018, 08:55:32 AM |
|
I want know, Is Python good for bitcoin apps?
Python is excellent for bitcoin apps. What makes is so good is that it already has good easy to use libraries for doing all the math behind bitcoin. Support for: big numbers, SHA256, ripemod160, elliptic curve operations etc... Those can be a real PITA if you have to write any of them in C++, or whatever. Actually C++ also has some libraries you can use, but at least those that I have seen are quite difficult to use and complicated. On python being slower... yes, compiled languages are faster, but you wont be needing to use the full capabilities of a computer for doing bitcoin operations. One example of a python program is Electrum
|
My Address: 121f7zb2U4g9iM4MiJTDhEzqeZGHzq5wLh
|
|
|
bestr17
Member
Offline
Activity: 89
Merit: 10
|
I would say that if you plan on working on wallet software, learn javascript and how Node.js works. If you would like to work on bitcoin's core components and someday be a Satoshi 2.0... then learning C++ is the way to go. If you want to be and all-rounder. Python is an amazing language, and can do things all the way from powering wallets like Electrum and Armory, all the way to powering blockchain parsers and the like.
If I had to pick one, I'd say Python. It's easy to learn.
|
|
|
|
bob123
Legendary
Offline
Activity: 1624
Merit: 2481
|
I would say that if you plan on working on wallet software, learn javascript..
No. Just no. Some reasons for javascript to suck hard: - JS supports "Number" as the only number format -> Supports only 64bit Doubles
The problem with large intergers with floating point variables is, that you won't be able to represent large number correctly. 99999999999999999 == 100000000000000000 evaluates to true in javascript. Its kinda suicide to use javascript for handling large numbers (private-/public keys). - JavaScript heavily depends on global variables.
You not just can use them.. you have to use them. This makes it a pain in the ass to get a structure over a complex program (e.g. wallet) - There are a lot of traps you have to watch out in JS
For example: -1 < Number.MIN_VALUE returns true, because Number.MIN_VALUE returns the lowest positive number and the real lowest number is -Number.MAX_VALUE, - JS has a TON of vulnerabilities. You don't want to have security vulnerabilities in your wallet. To name the most common JS is so vulnerable to: XSS[1] and CSRF[2]
Those were a few reasons. There are way more. But this should give a small insight why you shouldn't use javascript to code a wallet. In fact, you shouldn't use javascript at all. [1] https://en.wikipedia.org/wiki/Cross-site_scripting[2] https://en.wikipedia.org/wiki/Cross-site_request_forgery
|
|
|
|
MysteryMiner
Legendary
Offline
Activity: 1512
Merit: 1049
Death to enemies!
|
|
February 10, 2018, 11:35:44 AM |
|
As a interpreted language instead of compiled, it is not good for anything serious. Python is modern day version of 90ties Visual Basic.
|
bc1q59y5jp2rrwgxuekc8kjk6s8k2es73uawprre4j
|
|
|
bob123
Legendary
Offline
Activity: 1624
Merit: 2481
|
|
February 10, 2018, 05:25:05 PM |
|
As a interpreted language instead of compiled, it is not good for anything serious. Python is modern day version of 90ties Visual Basic.
You do realize that: 1) Python scripts can be compiled and 2) Electrum is written in python Your statement is completely senseless. Unless, of course, you consider electrum as "not serious". Python is one of the (if not) the best scripting langauge to process/handle data and strings. It provides a lot of useful functions which you would have to write yourself in other languages (e.g. C/C++/Java).
|
|
|
|
jackg
Copper Member
Legendary
Offline
Activity: 2856
Merit: 3071
https://bit.ly/387FXHi lightning theory
|
|
February 10, 2018, 06:21:08 PM |
|
As a interpreted language instead of compiled, it is not good for anything serious. Python is modern day version of 90ties Visual Basic.
You do realize that: 1) Python scripts can be compiled and 2) Electrum is written in python Your statement is completely senseless. Unless, of course, you consider electrum as "not serious". Python is one of the (if not) the best scripting langauge to process/handle data and strings. It provides a lot of useful functions which you would have to write yourself in other languages (e.g. C/C++/Java). I think MysteryMiner is referring to the main console only allowing interpreting of the software. Microsoft and other companies have made powerful compilers of it though however and yes electrum is mostly written in Python. Even theymos says they like to use electrum for small amounts of bitcoins that he wants to transfer/store.
|
|
|
|
MysteryMiner
Legendary
Offline
Activity: 1512
Merit: 1049
Death to enemies!
|
|
February 10, 2018, 07:09:11 PM |
|
As a interpreted language instead of compiled, it is not good for anything serious. Python is modern day version of 90ties Visual Basic.
You do realize that: 1) Python scripts can be compiled and 2) Electrum is written in python Your statement is completely senseless. Unless, of course, you consider electrum as "not serious". Python is one of the (if not) the best scripting langauge to process/handle data and strings. It provides a lot of useful functions which you would have to write yourself in other languages (e.g. C/C++/Java). Yes, I realize that 1) is true 2) also is true. I consider Electrum as usable software, just as other software written in Python. But remember that a lot of hacking software in early 2000 was written in Visual Basic. It worked, but was nightmare, all those ocx files and also for just simple sending few magic packets and repeating it made like 700KB executable files while same functionality could be implemented in C/C++ that weighs less than 4KB. Can You optimize Python program to take advantage of various CPU hardware features same as C with inline Assembler does? I doubt. Python is high-level programming/scripting language. By definition it cannot be as good and powerful as low level language like C and ASM. Only advantage of high level language is relatively fast development, ease of portability between Windows and *nix and it is friendly to noobish programmers.
|
bc1q59y5jp2rrwgxuekc8kjk6s8k2es73uawprre4j
|
|
|
TechPriest
Sr. Member
Offline
Activity: 377
Merit: 282
Finis coronat opus
|
|
February 10, 2018, 09:19:54 PM |
|
Only advantage of high level language is relatively fast development, ease of portability between Windows and *nix and it is friendly to noobish programmers.
I counted four in your text. Also, i can tell about one more advantage: high level language is better for small projects, like blockchain parser or transaction accelerator or data storage.
|
In science we trust!
|
|
|
|