Project Euler in RapydScript

36 views
Skip to first unread message

Alexander Tsepkov

unread,
Jun 12, 2015, 4:54:09 PM6/12/15
to RapydScript
Hey guys, a few weekends ago I figured I'd try to tackle some Project Euler (https://projecteuler.net/) challenges in RapydScript for fun to test performance, clarity and brevity. Here are the solutions for those wanting to take a look:


As a result of this exercise, I added a few minor fixes to the language for issues I didn't notice before and a few minor optimizations and utility functions. I also noticed the following:

- JavaScript seems to be a rather unpopular language among Project Euler users, there were some quirks I ran into with JavaScript and use of floating point numbers that Python wasn't subject to and other Project Euler users didn't experience (this was only the case with very large numbers)
- On average, RapydScript tends to run faster than Python solutions of other members (but this can also easily be attributed to my hardware)
- One exception where Python seems to routinely win is use of sets, JavaScript's hash is much slower than a set object in Python
- It's somewhat easier to get unpredictable errors when doing these challenges in RapydScript than Python or Ruby because JavaScript implicitly converts numbers/strings and runs into precision issues for large numbers (perhaps that's why JavaScript isn't popular for these)
Reply all
Reply to author
Forward
0 new messages