this is a repo to find the prime numbers by a same algorithm in various programming languages (the purpose in doing this is test the speed of them and learn about other languages).
if the value type is the in the command arguments, you have to pass the range in the command arguments in the terminal but if the valu type is the in the source code, you must to change the range in the source code
here is the commands to run for each language, if you want to check the run time you can use the time
command before your main command (in linux). like time python app.py
the result in my machine : Spped Result
requirements : Python Interpreter
Command : python main.py 1000000
requirements : nodejs
Command : node main.js 1000000
the TypeScript must compile to JavaScript, then run it like JS
requirements :
Compile to JavaScript : TypeScript Compiler
Run with : node.js
Compile : tsc main.ts
Run (Like JS) : node main.js 1000000
requirements : gcc (that is exists in linux distros by default)
Compile : gcc -o main main.c -lm
Run : ./main 1000000
requirements : g++ (that is exists in linux distros by default)
Compile : g++ main.cpp -o main
Run : ./main 1000000
requirements : NET Core 7 runtime
Compile : dotnet build
Run : dotnet run
requirements : Rust Compiler
Compile : rustc main.rs
Run : ./main 1000000
requirements : Go Compiler
Compile : go build main.go
Run : ./main 1000000
or run without build : go run main.go 1000000
requirements : Lua Interpreter
Run : lua main.lua 1000000
in the dart language the range variable was define in the source code
requirements : Dart sdk
Run : dart main.dart
- Java
- C#
- Bash
- PHP
- Go
- Ruby
- Julia