haskman, 17 days ago to javascript Since the #Moonbit #JavaScript backend post (https://www.moonbitlang.com/blog/js-support) is trending, I thought I'd compare #PureScript backend optimizer (https://github.com/aristanetworks/purescript-backend-optimizer) output to see how it fares. The results were pretty good! With basically this PureScript code - run = fromArray >>> flatMapF (fromArray <<< _.members) >>> filterF _.gender >>> mapF (\x -> min 100 (x.score + 5)) >>> mapF grade >>> filterF (_ == 'A') >>> foldF (\_ x -> x+1) 0 the benchmark results are as follows. PureScript is roughly 6x faster than plain JS, and 6x slower than Moonbit output ( - ┌─────────┬──────────────┬─────────────┬────────────────────┬──────────┬─────────┐ │ (index) │ Task Name │ ops/sec │ Average Time (ns) │ Margin │ Samples │ ├─────────┼──────────────┼─────────────┼────────────────────┼──────────┼─────────┤ │ 0 │ 'Moonbit' │ '34,67,542' │ 288.38869989829305 │ '±0.06%' │ 1733772 │ │ 1 │ 'Plain Js' │ '74,816' │ 13365.983827421464 │ '±0.54%' │ 37409 │ │ 2 │ 'Kotlin Js' │ '1,90,241' │ 5256.474017304151 │ '±0.38%' │ 95121 │ │ 3 │ 'PureScript' │ '4,99,456' │ 2002.1768597161156 │ '±0.70%' │ 249729 │ └─────────┴──────────────┴─────────────┴────────────────────┴──────────┴─────────┘ #FunctionalProgramming #Frontend #Benchmarks
Since the #Moonbit #JavaScript backend post (https://www.moonbitlang.com/blog/js-support) is trending, I thought I'd compare #PureScript backend optimizer (https://github.com/aristanetworks/purescript-backend-optimizer) output to see how it fares. The results were pretty good!
With basically this PureScript code -
run = fromArray >>> flatMapF (fromArray <<< _.members) >>> filterF _.gender >>> mapF (\x -> min 100 (x.score + 5)) >>> mapF grade >>> filterF (_ == 'A') >>> foldF (\_ x -> x+1) 0
the benchmark results are as follows. PureScript is roughly 6x faster than plain JS, and 6x slower than Moonbit output ( -
┌─────────┬──────────────┬─────────────┬────────────────────┬──────────┬─────────┐ │ (index) │ Task Name │ ops/sec │ Average Time (ns) │ Margin │ Samples │ ├─────────┼──────────────┼─────────────┼────────────────────┼──────────┼─────────┤ │ 0 │ 'Moonbit' │ '34,67,542' │ 288.38869989829305 │ '±0.06%' │ 1733772 │ │ 1 │ 'Plain Js' │ '74,816' │ 13365.983827421464 │ '±0.54%' │ 37409 │ │ 2 │ 'Kotlin Js' │ '1,90,241' │ 5256.474017304151 │ '±0.38%' │ 95121 │ │ 3 │ 'PureScript' │ '4,99,456' │ 2002.1768597161156 │ '±0.70%' │ 249729 │ └─────────┴──────────────┴─────────────┴────────────────────┴──────────┴─────────┘
#FunctionalProgramming #Frontend #Benchmarks
halfbit_, 8 months ago to cpp #moonbit seems like another #programminglanguage worth keeping a eye on. I am still hoping for a more sane #cpp successor than #rust, and I’m sad that because rust gets all the hype, great languages like #nim don’t get the love they deserve. https://moonbitlang.com/blog/first-announce/
#moonbit seems like another #programminglanguage worth keeping a eye on. I am still hoping for a more sane #cpp successor than #rust, and I’m sad that because rust gets all the hype, great languages like #nim don’t get the love they deserve. https://moonbitlang.com/blog/first-announce/