This is a program that calculates primes concurrently using Go.
I’ve had several of these prime number generating programs since 2014 or so. All of the others were written in Python aside from an earlier version of this program (that I would classify as different) written in Go.
Go, I have seen, offers many advantages in this field including its concurrent abilities and high efficiency garbage collection. Throughout the development of this program I have learned much about Go.
I must stress, that there are other programs that do very similar things to this one including Mprime and Prime95, which are both part of the GIMPS project (same link). GIMPS is an effort to discover Mersenne primes on a large scale internationally.
This project is different, being that the goal is to create a large collection of prime numbers, ranging from 2 until the very largest.
GIMPS is nice. Their software is nice. But there is one particularly disturbing clause in their terms relating to cash prizes - specifically the Electronic Frontier Foundation prizes:
GIMPS has undertaken an organized and systematic attempt to earn the $150,000 (USD) Electronic Frontier Foundation (“EFF”) Cooperative Computing Award such that each Participant assigns all interest in this award entirely to GIMPS. Note that this Award may at current participation rates require an estimated 12-15 years of calculations before a qualifying discovery is made. No money will be awarded unless and until a GIMPS Participant’s computer discovers a 100,000,000 digit prime, it is independently verified, EFF validates GIMPS’ claim according to their rules, and pays GIMPS the award.
https://www.mersenne.org/legal/#awards
This program will include none of such restrictions, but I will contemplate the specifics later.
GIMPS is also non-free, being licensed by their own license. The code is open-source, however. This program is a free-software alternative (without any restrictions seen in https://www.mersenne.org/legal/).
I have three key goals here:
- To make a server variant for running nodes on the network
- To make this distributed across said network
- To have a wide range of algorithms available to choose from for prime assertion by any node
- Clone the repository
git clone https://github.com/MaxTheMonster/PrimeNumberGenerator.git
- Change directory
cd PrimeNumberGenerator
- Build it
make
- Move the executable to your bin (as superuser)
make install
Now the program can be called from the command line
PrimeNumberGenerator
Refer to the help command for more.
PrimeNumberGenerator help
This program is released under the GNU General Public License version 3. Refer to the file named LICENSE for details.