DreamBerd
DreamBerd copied to clipboard
Improve performance with `vroom`
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!
This sounds fantastic. Performance sounds like such a great thing to fix with DreamBerd.
This has been referenced by many other issues. It seems to be popular!
I think I need to get this in somehow
@TodePond every issue starting with "Suggestion:" is from me, and just stating possible side effects with this statement, nothing to worry about.
@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