HoBzY (OP)
Newbie
Offline
Activity: 24
Merit: 2
|
|
October 09, 2022, 04:40:16 PM Last edit: December 06, 2022, 05:05:01 PM by HoBzY |
|
What is the best language to write a miner in?
|
|
|
|
jackg
Copper Member
Legendary
Offline
Activity: 2856
Merit: 3071
https://bit.ly/387FXHi lightning theory
|
The one you're most comfortable writing with. Most of the time the language you use doesn't matter, most systems have APIs that allow you to call other programs in other languages too (like how python's os module lets you run command line tasks).
If you're fairly new to programming there's ups and downs to using langiages that are statically typed (like c based languages and java) and ones that are dynamically typed (like python).
If you find you're very comfortable (/enjoying) programming one specific language, whatever it is, write it in that. If you don't care, you could always try both types.
|
|
|
|
|
HoBzY (OP)
Newbie
Offline
Activity: 24
Merit: 2
|
|
October 09, 2022, 05:27:25 PM |
|
The one you're most comfortable writing with. Most of the time the language you use doesn't matter, most systems have APIs that allow you to call other programs in other languages too (like how python's os module lets you run command line tasks).
If you're fairly new to programming there's ups and downs to using langiages that are statically typed (like c based languages and java) and ones that are dynamically typed (like python).
If you find you're very comfortable (/enjoying) programming one specific language, whatever it is, write it in that. If you don't care, you could always try both types.
What is the best language for hash generation speed? Is it worth learning C++?
|
|
|
|
NotATether
Legendary
Offline
Activity: 1778
Merit: 7372
Top Crypto Casino
|
|
October 09, 2022, 05:31:07 PM Merited by Welsh (4), n0nce (2) |
|
What is the best language for hash generation speed? Is it worth learning C++?
Assuming mining difficulty is low enough for CPU mining. C++ for a command-line frontend is OK, but the mining library itself must be written in pure C (no STL constructs) or even better in assembly, for maximum performance. I'd stay away from all other languages including Rust.
|
|
|
|
DannyHamilton
Legendary
Offline
Activity: 3486
Merit: 4832
|
|
October 09, 2022, 06:45:30 PM |
|
What is the best language for hash generation speed? Is it worth learning C++?
It depends on your skills with the language. It is possible to write some VERY inefficient and slow code in C, and some very fast and efficient code in other languages. Choosing a language without having a good understanding of computing principles isn't going to get you the best possible results.
|
|
|
|
n0nce
|
|
October 09, 2022, 06:47:17 PM |
|
What is the best language for hash generation speed? Is it worth learning C++?
It depends on your skills with the language. It is possible to write some VERY inefficient and slow code in C, and some very fast and efficient code in other languages. Choosing a language without having a good understanding of computing principles isn't going to get you the best possible results. I believe if he had such understanding though, he wouldn't ask this question. So maybe best to use what's already available (if it's about performance), as I described above. Or use any language they like, if it's about education / learning, because performance doesn't matter. We really need more information about the actual end goal, otherwise it's another https://xyproblem.info/.
|
|
|
|
serhack
Member
Offline
Activity: 107
Merit: 168
Security Researcher and Writer
|
|
October 09, 2022, 07:45:00 PM |
|
What is the best language to write a miner in?
If you're really expert and know what you're doing, for sure C is the most powerful programming language that allows you to think as a "machine". Assembly would be more performant but good luck not loosing your mind For people suggesting any OOP-based language or GC-based language, you're going to waste some helpful CPU burst on checking pointers, and allocations. C is a nightmare for pointers but it can allow you to write very efficient program without too much efforts. Unfortunately you need to master pointers management and you need to carefully think about the instruction cycle (fetch, decode, execute), pipelines and much more to waste CPU burst as few as possible.
|
|
|
|
pooya87
Legendary
Offline
Activity: 3626
Merit: 11027
Crypto Swap Exchange
|
|
October 10, 2022, 04:35:13 AM |
|
What is the best language for hash generation speed? Is it worth learning C++?
If you don't already know the language you will not be able to write the most efficient code needed for mining in that language that you would be learning the basics for! Optimization is a complicated topic that you can start on at an advanced level. Try using the existing code that other experts have already written.
|
|
|
|
HoBzY (OP)
Newbie
Offline
Activity: 24
Merit: 2
|
|
October 10, 2022, 06:49:54 AM Last edit: October 13, 2022, 12:33:46 PM by mprep |
|
What is the best language to write a miner in?
If you're really expert and know what you're doing, for sure C is the most powerful programming language that allows you to think as a "machine". Assembly would be more performant but good luck not loosing your mind For people suggesting any OOP-based language or GC-based language, you're going to waste some helpful CPU burst on checking pointers, and allocations. C is a nightmare for pointers but it can allow you to write very efficient program without too much efforts. Unfortunately you need to master pointers management and you need to carefully think about the instruction cycle (fetch, decode, execute), pipelines and much more to waste CPU burst as few as possible. I think I can understand it because I already know html/css/js/php/mysql web languages and know python/c# and for learning blockchain mining I used python for test.
What is the best language for hash generation speed? Is it worth learning C++?
If you don't already know the language you will not be able to write the most efficient code needed for mining in that language that you would be learning the basics for! Optimization is a complicated topic that you can start on at an advanced level. Try using the existing code that other experts have already written. Can I have a couple of links to them? C is best learned by example. [moderator's note: consecutive posts merged]
|
|
|
|
|
|
serhack
Member
Offline
Activity: 107
Merit: 168
Security Researcher and Writer
|
|
October 10, 2022, 03:01:36 PM |
|
What is the best language to write a miner in?
If you're really expert and know what you're doing, for sure C is the most powerful programming language that allows you to think as a "machine". Assembly would be more performant but good luck not loosing your mind For people suggesting any OOP-based language or GC-based language, you're going to waste some helpful CPU burst on checking pointers, and allocations. C is a nightmare for pointers but it can allow you to write very efficient program without too much efforts. Unfortunately you need to master pointers management and you need to carefully think about the instruction cycle (fetch, decode, execute), pipelines and much more to waste CPU burst as few as possible. I think I can understand it because I already know html/css/js/php/mysql web languages and know python/c# and for learning blockchain mining I used python for test. Yes, you might understand it without too much effort but the problem is optimizing that.
|
|
|
|
n0nce
|
|
October 10, 2022, 07:43:57 PM |
|
I think I can understand it because I already know html/css/js/php/mysql web languages and know python/c# and for learning blockchain mining I used python for test.
Oh dear. Web languages, Python and C# won't help you at all when trying to write highly optimized low-level code. Anyhow, could you answer what your actual goal is in the first place? Is it just a coding exercise? If so, the answer is: 'The best language is the one you're comfortable with and that is fun to write'. If you want to develop something that competes with existing software, maybe just fork what already exists and optimize it further. If you want to use it for Bitcoin mining, don't even bother with programming languages and go for FPGA or ASIC design, which is a whole different beast; you'd be looking at learning and understanding chip design, then implement it in VHDL or Verilog, as tromp suggested.
|
|
|
|
|
Artem Sereda
Member
Offline
Activity: 96
Merit: 10
|
|
November 10, 2022, 12:37:14 PM |
|
The one you're most comfortable writing with. Most of the time the language you use doesn't matter, most systems have APIs that allow you to call other programs in other languages too (like how python's os module lets you run command line tasks).
If you're fairly new to programming there's ups and downs to using langiages that are statically typed (like c based languages and java) and ones that are dynamically typed (like python).
If you find you're very comfortable (/enjoying) programming one specific language, whatever it is, write it in that. If you don't care, you could always try both types.
What is the best language for hash generation speed? Is it worth learning C++? As already mentioned here, it all depends on your skills in this language. Python was recommended here before. I would still prefer this language. It makes it easier to manipulate data. And it's easier to learn.
|
VSYS.host — Anonymous Offshore Dedicated Servers & VPS with DDoS protection:UA/NL/US SHKeeper.io — Self-Hosted & Open-Source Crypto Payment Processor
|
|
|
|