DreamBerd icon indicating copy to clipboard operation
DreamBerd copied to clipboard

Improve performance with `vroom`

Open FoxNerdSaysMoo opened this issue 1 year ago • 4 comments

Currently, DreamBerd compilation is rather slow, so I propose the vroom keyword.

New in 2023!

The vroom keyword, spelled with any amount of 'o's greater than one (/vroo+m/), will force the compiler to optimize and accelerate the execution of that line using state-of-the-art optimization techniques. Adding extra 'o's or exclamation marks will make the code run even faster.

   fncto is_prime (num) => {
var var return = true!  // Proposed syntax from #5 
var const i = 2!
when (i === num ** .5 + 1) {
   break!!! // Not sure if this exists, might be a nice new feature
}
if (num % i === 0) {
   print("${num} is not prime!")!
   return = false!
   break!!!
}
i++!
return!!!!!
   }

If you try running this on a large number, it will take a long time. However, using the new vroooom keyword, we may do:

vroooooom print(is_prime(53929045907359705397379235975937397590359075))!!!

Which only takes 0.1s to run!

FoxNerdSaysMoo avatar Mar 10 '23 16:03 FoxNerdSaysMoo

This sounds fantastic. Performance sounds like such a great thing to fix with DreamBerd.

Magnogen avatar Mar 11 '23 21:03 Magnogen

This has been referenced by many other issues. It seems to be popular!

I think I need to get this in somehow

TodePond avatar Jun 10 '23 22:06 TodePond

@TodePond every issue starting with "Suggestion:" is from me, and just stating possible side effects with this statement, nothing to worry about.

stohrendorf avatar Jun 10 '23 22:06 stohrendorf

@FoxNerdSaysMoo this is from a while back, but do you wanna submit a PR for this? I have a couple edits in mind, but it'll let you get on the contributor list

TodePond avatar Jun 14 '23 07:06 TodePond