Files
flenser/js4g/fib.js4
ADAM David Alan Martin a3dc7e980e Significant speed improvements.
By not cloning code for recursion directly into the processing
buffer and by not copying as many strings and by not doing
string->int conversions all the time, it's significantly faster.

Specifically, it's about 5.5x slower than Python.
2025-09-16 17:21:29 -04:00

48 lines
310 B
Plaintext

fib
{
@dup
@not
@if
@drop 1
@else
@dup
@i_dec
@not
@if
@drop 1
@else
@i_dec
@dup
@i_dec
@fib
@swap
@fib
@i_add
@endif
@endif
}
do_fibs
{
@dup
@if
@dup
@i_dec
@do_fibs
@fib
@print
@else
0
@endif
}
junk
{
12 @dup @print @fib @print
}
39 @do_fibs