In-reply-to » It is such a nice feeling that Mu is such a capable little language šŸ˜… And I decided to write code code in Mu by hand 🤚 haha 🤣 and start solving Project Euler problems, like Problem 8 which works out to be a nice elegant solution in Mu:

And just like that Problem 10 is done and correct whoohoo 🄳 It was easy because in Problem 7 I’d already written an iterator to produce infinite primes. So the solution for finding the sum of primes under 2,000,000 is basically (shortened):

  primes := iter.take_while(iter.filter(prime_candidates(), is_prime), fn(p) { p < n })
  print(iter.sum(primes))

And of course the answer is: 142913828922 which took ~21.ss for the Go Vm to compuete.

⤋ Read More