Cool, but I couldn't resist rakufying your "deflate" subroutine:
sub deflate($power is copy, $rate, $years) {
$power *= 1 + $rate for ^$years;
$power * 100
}
sub MAIN(:$rate = 0.0225, :$years = 10)
{
print qq:to/EOF/;
After $years years of deflation at a rate of {$rate * 100}% per year,
purchasing power is &deflate(1,$rate,$years)% of what it was initially.
EOF
}
Which I think reads quite a bit better :-)lizmat++
The innumerable dark-seeming corners of the language is part of what makes Raku so very, distinctly “Perl”. Little traits and single character sigils that change everything. I find the black magic of Perl моѕt all∪ring ∮.
Wow! Nice to see Perl 6 in use these days!
Well, that's be Raku nowadays! #rakulang https://raku.org :-)
Same, very surprising. I was tracking the project for a while with great interest but they lost a lot of things that made Perl actually good at its niche. I'm amazed they made Perl look worse.
Just for fun, I thought I’d do the math on deflationary economics:
Without inflation, your personal wealth would grow by the average inflation rate target plus GDP growth, compounding each year.Assuming an average inflation rate target of 2% per year (per the Fed) and an average GDP growth rate of 0.25% per year, your real purchasing power would grow by about 25% per decade.
Under this scenario, you could mimic a universal basic income of $1000 per month upon saving a total of $480,307.
Bonus: your monthly “UBI” could never be shut off by your government.