Remix.run Logo
kenjin4096 2 hours ago

I think Anton is replying to me in that LWN article IIRC. I personally didn't know C only had tail calls that late and learnt something new there!

On the other hand, I am pretty new to the compiler space myself, and I count early 2000s as a pretty long time ago, though again it is not that far back considering how long other language implementations had tail calls like in ML or variants since 1980-90s.

pjmlp an hour ago | parent [-]

It still doesn't, this is a compiler specific language extension.

You won't find anything on ISO/IEC 9899:2024 about tail calls, like it happens on Scheme.

https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3220.pdf

Section 3.5 of R7RS.

https://standards.scheme.org/official/r7rs.pdf

wahern 34 minutes ago | parent [-]

A formal technical specification (TS) extension is already being drafted: https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3582.pdf That's a step up from the usual proposals. I'm not sure what criteria is used to decide whether to first create a TS vs just incorporating a change into the working draft of the next standard.[1] _Defer also seems to be taking the TS route.[2]

1. https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3886.pdf

2. https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3928.pdf

leoc 11 minutes ago | parent | next [-]

There's some discussion of how C29 defer ended up in a TS at https://thephd.dev/c2y-the-defer-technical-specification-its... .

pjmlp 24 minutes ago | parent | prev [-]

Well, even if that lands on the official standard, that means C29 as probable release year for C2y, plus adoption of the exact form across compilers to be able to rely on it being available.

Someone 10 minutes ago | parent [-]

Plus the fact that an implementation that recognizes the new syntax and produces an error whenever it encounters it will be conforming.

On such an implementation, the feature is available but useless.