4 ms·
> The detecting of increments has been in Perl for ages so that's not new. But this is detecting that the increment is multiplicative, rather than additive. I
by JadeNB 2y ago
> The detecting of increments has been in Perl for ages so that's not new.
But this is detecting that the increment is multiplicative, rather than additive. It might seem like a natural next step, but, for example, I somewhat suspect (and definitely hope) that Raku wouldn't know that `(1, 1, 2...*)` is a (shifted) list of Fibonacci numbers.
- emmelaich 2y agoAh, I missed that. Nevertheless it's been in Perl6 for a while! You're safe WRT Fibonacci. > Unable to deduce arithmetic or geometric sequence from: 1,1,2
- emmelaich 2y agoBUT WAIT! $ raku -e 'say (1, 1, *+* ... *)[0..10]' (1 1 2 3 5 8 13 21 34 55 89)
- Spivak 2y agoI… love it? It's so elegant it's infuriating.
- emmelaich 2y agoIt also seems slowish, but seems the problem is the startup cost. So probably pretty smart? The following shows fairly stable times. > for i in $(seq 20); do time raku -e "say (1, 1, + ... *)[0..$i]"; done
- mst 2y agoraku kinda puts a bunch of parts of itself together during startup, not entirely unlike Julia. The sheer dynamism of the thing makes pre-baking that non-trivial, also not entirely unlike Julia. I seem to recall chatting with the devs on IRC a few years and there seeming to be more than one viable way to potentially fix it, but they all seemed to me to share the property of needing a lot of effort during which nothing would work at all before you got something to show for it - and a decent chance of what you got to show after all that time was "welp, here's why which one can't work" - which is a really heavy lift in terms of somebody finding motivation to try it in the first place. So tl;dr "yes, I dislike the startup cost, no, I don't expect it to change soon and I don't think it's a black mark against the team that it probably won't."