Share your repls and programming experiences

← Back to all posts
π in F#
AmazingMech2418 (1046)

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

The interesting thing about F# is that, while a functional language, it is actually quite like R which is not functional.

I still have the same issue with NASM and am working on that one side-by-side with the other languages. If you can help fix the issue, please let me know at

Here are the other approximations so far:
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 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 @Jakman for suggesting F#!

Next up is Crystal and then L ( @theangryepicbanana 's language). (I'm still working on NASM, but can't really tell when I'll be able to get that one done.) If you have any suggestions for after those, please let me know!

AmazingMech2418 (1046)

@DynamicSquid Maybe soon. (I'm starting to run out of non-Lisp languages, but guess I can do like Nim, Julia, etc. still...)

AmazingMech2418 (1046)

@DynamicSquid Yeah. Lisp seems kind of weird and would probably be best to save for later (of course still before the esolangs though).

Warhawk947 (522)

Tip: If the run command is a bit slow, just skip the build and do mono main.exe

AmazingMech2418 (1046)

@Warhawk947 Yeah. I thought about doing that, but it's not too slow the way it is right now...