Share your repls and programming experiences

← Back to all posts
π in Dart
AmazingMech2418 (891)

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

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:
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).

Next up is Lua and then F#. (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!

Jakman (450)

Also another suggestion for a language (after lua). Crystal language. Like Ruby but fast.

AmazingMech2418 (891)

@Jakman Should I do that before or after F#?

Jakman (450)

@AmazingMech2418 it is all up to you. I would prefer after lua because of previous promises for a lua script.

AmazingMech2418 (891)

@Jakman I already finished Lua and am trying to do F#, but I'm getting a Stack Overflow error...

Jakman (450)

@AmazingMech2418 check those variables for their names then...

AmazingMech2418 (891)

@Jakman I actually just got it to work! It turns out that F# actually supports loops unlike Haskell!

AmazingMech2418 (891)

@Jakman F# is actually a lot like R!

Jakman (450)

@AmazingMech2418 it is now that i think of it.

rediar (340)

The saga continues!