Share your repls and programming experiences

← Back to all posts
π in C++
AmazingMech2418 (1045)

I think I'm pretty much doing pi approximations in every language now, so, here it is in C++!

I wasn't initially planning on doing C++, but then realized I could use it it learn more about C++ libraries and namespaces.

The issue with NASM has been fixed, but I still need to figure out float addition, subtraction, multiplication, and division before the NASM approximation will be ready.

Here are the other approximations so far:
TypeScript -
CoffeeScript -
Elisp -
Clojure -
Scheme -
Erlang -
Elixir -
Julia -
Nim -
Crystal -
F# -
Lua -
Dart -
R -
Haskell -
Raku -
Rust -
Go -
Swift -
C# -
Bash -
Kotlin -
Ruby -
Java -
QBasic -
Fortran -
Forth -
Python and Node.js (Node is linked in post) -
C -

Credit to NoelBryan, TheForArkLD , Warhawk947 , and LizFoster (the @ is removed so they don't get annoying pings every time I post) for inspiring these approximations. Most of these use the Nilakantha Series, although I also use the arctangent method (multiplying the radian arctangent of 1 by 4 to get pi and getting the arctangent with an infinite series) in three of them (Python, Node, and C).

Also, credit to @Warhawk947 for suggesting C++, although I wasn't planning on doing it at the time.

I don't know currently which one is next. If you have any suggestions, please let me know! I would prefer to save esolangs for last. Some examples for ideas for the next ones are like Quil, OCaml, Tcl, etc.

By the way, I'm starting to run out of languages, so please suggest any you would like to see me do. There are now no (or at least very few) official languages left other than esolangs, but there are some other languages (like OCaml, Quil, etc.) that can be found using the method in my tutorial at Though, I am saving esolangs for last (or close to last). After I finish the approximations using the Nilakantha Series, I will go through all of the languages again and do another algorithm (I'm thinking either trapezoidal sums or Monte Carlo). I will also then make a tutorial on transpiling programming languages.

AmazingMech2418 (1045)

@Warhawk947 Thank you! (what is the "lulz" part exactly though?)

Warhawk947 (520)

@AmazingMech2418 tbh i don't really know lmao, i think it's different version of lol?

AmazingMech2418 (1045)

@Warhawk947 Okay. LOL! Any non-esolang suggestions for the next one though?

Warhawk947 (520)

@AmazingMech2418 smalltalk, but i don't think replit supports it

AmazingMech2418 (1045)

@Warhawk947 If doesn't support it (I don't think it does), anything from the list in my comment in this post?

AmazingMech2418 (1045)

List of all other languages on that I have not done that I plan to at least eventually do:

BrainF - Esolang
Emoticon - Esolang
Bloop - Esolang
Unlambda - Esolang
Quil - Quantum Instruction Language
Reason - New syntax of OCaml
NASM - Assembly; still working on it

List of languages that I will not do:

BASIC - Already did QBasic and there is not a large enough difference to make me decide to do BASIC as well.
Roy - There is not enough documentation online to do Roy. (I can find pretty much nothing)
Static - Static does nothing... It is just a makefile and it does nothing when you run it.
Flow - JS type checker which seems to not actually work
Deno - Alternative to Node, but runs exactly as TypeScript repls do
WASM - WebAssembly; Doesn't seem to work on and isn't even meant to be programmed in, just compiled into.