DanielKeep / tlborm

The Little Book of Rust Macros
880 stars 96 forks source link

Updated default value of recursion_limit #16

Closed tobia closed 6 years ago

tobia commented 7 years ago

Ref. https://github.com/rust-lang/rust/blob/master/src/libsyntax/ext/expand.rs#L912

bluss commented 6 years ago

Now it's 1024? https://github.com/rust-lang/rust/blob/2be4cc040211a85b17f21e813ff62351ae4de642/src/libsyntax/ext/expand.rs#L1083

tobia commented 6 years ago

It would seem so. I don't have a Rust environment anymore, so I cannot test it.

But if it has really been updated to 1024, then it's not a low limit anymore and the entire sentence should be rewritten.

What I mean is that many languages have a stack limit between 1,000 and 10,000 calls, depending on runtime parameters and on the specific recursive calls being made (stack frame size.) This would make recursion in the Rust macro system a fully generic programming technique, like it is in Scheme and other languages.