Groups | Search | Server Info | Login | Register
Groups > perl.perl5.porters > #99846
| Newsgroups | perl.perl5.porters |
|---|---|
| Message-ID | <6e108c47-aa59-46f9-9315-9d8a01e93af2@khwilliamson.com> (permalink) |
| Date | 2026-02-06 15:36 -0700 |
| Subject | PPC: Document pattern of symbols reserved for Perl in XS code |
| From | public@khwilliamson.com (Karl Williamson) |
XS writers don't know what symbols to avoid creating for their own purposes.
Thousands of undocumented Perl symbols are exposed to XS code. Many C
symbols are as well. However, C furnishes a template giving their
syntax. Basically, anything matching the template is a reserved word
for the C implementation.
I am proposing that we do the same, and the one regen/embed.pl currently
is using is
Any symbol beginning with "PL_"
Any symbol containing perl, Perl, or PERL, usually delimitted on
both sides so as to keep it from being part of a larger word.
POSIX feels free to add new functions that could possibly collide with
ones in existing code. 'atomic_int', for example in Posix 2024. I
think we can do the same.
Many symbols we've created end in an underscore, as an undocumented
attempt to indicate that these are not intended for public use. Tony
Cook has pointed out that other projects that use Perl do the same. I'm
proposing that we thus restrict ourselves further for new symbols to
ending in
m/ _ [[:alnum:]]* pl_ \z /x
And document this.
Back to perl.perl5.porters | Previous | Next — Next in thread | Find similar
PPC: Document pattern of symbols reserved for Perl in XS code public@khwilliamson.com (Karl Williamson) - 2026-02-06 15:36 -0700
Re: PPC: Document pattern of symbols reserved for Perl in XS code leonerd@leonerd.org.uk ("Paul \"LeoNerd\" Evans") - 2026-02-07 15:15 +0000
Re: PPC: Document pattern of symbols reserved for Perl in XS code perl5-porters@perl.org (Aristotle Pagaltzis via perl5-porters) - 2026-02-09 13:37 +0100
Re: PPC: Document pattern of symbols reserved for Perl in XS code public@khwilliamson.com (Karl Williamson) - 2026-02-09 10:03 -0700
Re: PPC: Document pattern of symbols reserved for Perl in XS code leonerd@leonerd.org.uk ("Paul \"LeoNerd\" Evans") - 2026-02-09 17:07 +0000
Re: PPC: Document pattern of symbols reserved for Perl in XS code public@khwilliamson.com (Karl Williamson) - 2026-02-09 11:56 -0700
csiph-web