Author

Topic: 1 BTC bounty for a pure C implementation of zcash miner (Read 1246 times)

hero member
Activity: 800
Merit: 1000
any news on this?
legendary
Activity: 1176
Merit: 1134
It is an interesting point, but the performance improvements he desires can be accomplished with encapsulation by employing polymorphic types (storing a header of type H that the Person type can't operate on because it only knows it is an H but the container collection can) but of course this binds the instances (e.g. of Person) to the type of H they were constructed with so they can't be added to other types of containers that require another type for H. But his C solution also makes this conflation.


The biggest issue of using C++ for system software is the undefined behavior for error handling, especially during interrupt time and all the system calls it makes on its own, which directly affects memory caching at the very least and who knows what else.

Which may not matter for the Equihash, but I got your point that you don't bother with C++ generally because of that general issue. And there are other tradeoffs.

Btw, I also am loathe to upgrade my C++ skills to master the STL. I last coded in C++ in approximately 2002.
When I look at C code, I can feel what the algorithms are doing, so it is a night and day difference. Being fluent vs having to look words up in a dictionary. I get headaches looking at C++ code, probably as I cant fathom the nearly infinite system states the code represents.

With C++ the possible system states are orders of magnitude greater and there is no control by the programmer. So if there is some strange bug, it can be buried deep inside of some automatic garbage collection process, causing a cache miss that triggers a swap to HDD, which then makes the interrupt handler fall out of realtime and things get out of sync.

With C, at least I know I am the cause for any bug.

sr. member
Activity: 336
Merit: 265
It is an interesting point, but the performance improvements he desires can be accomplished with encapsulation by employing polymorphic types (storing a header of type H that the Person type can't operate on because it only knows it is an H but the container collection can) but of course this binds the instances (e.g. of Person) to the type of H they were constructed with so they can't be added to other types of containers that require another type for H. But his C solution also makes this conflation.


The biggest issue of using C++ for system software is the undefined behavior for error handling, especially during interrupt time and all the system calls it makes on its own, which directly affects memory caching at the very least and who knows what else.

Which may not matter for the Equihash, but I got your point that you don't bother with C++ generally because of that general issue. And there are other tradeoffs.

Btw, I also am loathe to upgrade my C++ skills to master the STL. I last coded in C++ in approximately 2002.
legendary
Activity: 1176
Merit: 1134
It is an interesting point, but the performance improvements he desires can be accomplished with encapsulation by employing polymorphic types (storing a header of type H that the Person type can't operate on because it only knows it is an H but the container collection can) but of course this binds the instances (e.g. of Person) to the type of H they were constructed with so they can't be added to other types of containers that require another type for H. But his C solution also makes this conflation.

The biggest issue of using C++ for system software is the undefined behavior for error handling, especially during interrupt time and all the system calls it makes on its own, which directly affects memory caching at the very least and who knows what else.

legendary
Activity: 1176
Merit: 1134
Software is already way ahead of hardware..
Trains are faster than horses, but I dont see the relevance
legendary
Activity: 1176
Merit: 1134
http://250bpm.com/blog:8 give some reasons.

It is an interesting point, but the performance improvements he desires can be accomplished with encapsulation by employing polymorphic types (storing a header of type H that the Person type can't operate on because it only knows it is an H but the container collection can) but of course this binds the instances (e.g. of Person) to the type of H they were constructed with so they can't be added to other types of containers that require another type for H. But his C solution also makes this conflation.

The reason to prefer C over C++ is that C has a smaller surface area of base concepts whereas C++ has everything and the kitchen sink in its 1500 page manual.

When it comes to performance, a skilled C programmer can beat an average C++ programmer who utilizes the STL. So jl777 wants to understand the algorithms well enough so that he can create a C implementation. This seems to be a worthwhile activity as it will make the Zcash PoW algorithm accessible to C programmers who hate C++ of which there are probably many.

I would bet that if you can write down the algorithms in a simple pseudo code which he can easily translate to C, then I bet he'd probably pay you the bounty.
code clarity is the most important, but it needs to use the optimized method and also be able to actually create valid solution sets

basically a drop in replacement for the existing zcash miner
sr. member
Activity: 336
Merit: 265
http://250bpm.com/blog:8 give some reasons.

It is an interesting point, but the performance improvements he desires can be accomplished with encapsulation by employing polymorphic types (storing a header of type H that the Person type can't operate on because it only knows it is an H but the container collection can) but of course this binds the instances (e.g. of Person) to the type of H they were constructed with so they can't be added to other types of containers that require another type for H. But his C solution also makes this conflation.

The reason to prefer C over C++ is that C has a smaller surface area of base concepts whereas C++ has everything and the kitchen sink in its 1500 page manual.

When it comes to performance, a skilled C programmer can beat an average C++ programmer who utilizes the STL. So jl777 wants to understand the algorithms well enough so that he can create a C implementation. This seems to be a worthwhile activity as it will make the Zcash PoW algorithm accessible to C programmers who hate C++ of which there are probably many.

I would bet that if you can write down the algorithms in a simple pseudo code which he can easily translate to C, then I bet he'd probably pay you the bounty.
legendary
Activity: 2548
Merit: 1054
CPU Web Mining 🕸️ on webmining.io
Software is already way ahead of hardware..
legendary
Activity: 1176
Merit: 1134
but why?
http://250bpm.com/blog:4 and http://250bpm.com/blog:8 give some reasons.

For doing GUI or anything not time critical, hey, you can use Java or Javascript or whatever language you want, but if performance is the primary goal (without CPU dependency), then C is clearly the answer. If CPU dependency is ok, then assembler

Last I checked, mining fell into the "performance is everything" category

please no C++ is gods gift to programming stuff and I know c++ can compile C code and has all sorts of wonderful classes for everything. I just never liked classes.

If anybody seriously believes that an optimized C miner wont be faster than a C++ one, then let us make some wager

James

member
Activity: 75
Merit: 10
legendary
Activity: 1176
Merit: 1134
The current zcash miner is in C++, but I want a pure C version. There is already C versions of blake, but not of the main birthday problem as zcash uses

James
Jump to: