Where is PL_stack_base defined???

J

J Krugman

I'm going blind reading the Perl source! It's chaos!!!

Where is PL_stack_base defined???

I know about perlguts, but it is of no help with questions like
this. Is there any other guide to the Perl source code?

Thanks!

jill
 
T

Tassilo v. Parseval

Also sprach J Krugman:
I'm going blind reading the Perl source! It's chaos!!!

There are rumours that perl has initially really just been an
experiment to prove that a program can be written only by using the
preprocessor. It eventually failed and that's the reason why you'll
occasionally find a few lines of C code sprinkled in between the
preprocessor directives.
Where is PL_stack_base defined???

Most of that stuff is defined in intrpvar.h and thrdvar.h. These two
headers list all the fields of 'struct interpreter'. A few hundred
macros eventually transform PL_stack_base into Tstack_base which is then
inserted into 'struct interpreter' via thrdvar.h (see perl.h). The
actual definition is done with

PERLVAR(Tstack_base, SV **);

which translates into

SV ** Tstack_base;

That means that PL_stack_base is just a pointer to a pointer of scalars
which makes sense for a stack.
I know about perlguts, but it is of no help with questions like
this. Is there any other guide to the Perl source code?

Maybe

<http://gisle.aas.no/perl/illguts/>

can help a bit.

Other than that, there is no real guide to the source that I know of.
Everyone has acquired his own set of secret source reading and
understanding skills. They are not secret by malice but because they are
hard to formalize and be put into words.

My trick is to skip those parts I don't understand and conclude that I
probably don't need to understand them. This works well 90% of the time.
To resolve the remaining 10%, a few consoles, grep and patience usually
help.

Tassilo
 
A

Anno Siegel

Tassilo v. Parseval said:
Also sprach J Krugman:
I'm going blind reading the Perl source! It's chaos!!!

There are rumours that perl has initially really just been an
experiment to prove that a program can be written only by using the
preprocessor. It eventually failed and that's the reason why you'll
occasionally find a few lines of C code sprinkled in between the
preprocessor directives.
Where is PL_stack_base defined???
[...]
I know about perlguts, but it is of no help with questions like
this. Is there any other guide to the Perl source code?

Maybe

<http://gisle.aas.no/perl/illguts/>

can help a bit.

Other than that, there is no real guide to the source that I know of.

As someone who only occasionally ventures into XS programming, I
find _Extending and Embedding Perl_ by Tim Jenness and Simon Cozens
useful. It doesn't appear to contain anything that isn't available
elsewhere, but it has it in one place.

Anno
 
T

Tassilo v. Parseval

Also sprach Anno Siegel:
Tassilo v. Parseval said:
Also sprach J Krugman:
Where is PL_stack_base defined???
[...]
I know about perlguts, but it is of no help with questions like
this. Is there any other guide to the Perl source code?

Maybe

<http://gisle.aas.no/perl/illguts/>

can help a bit.

Other than that, there is no real guide to the source that I know of.

As someone who only occasionally ventures into XS programming, I
find _Extending and Embedding Perl_ by Tim Jenness and Simon Cozens
useful. It doesn't appear to contain anything that isn't available
elsewhere, but it has it in one place.

I don't have this book but I generally heard good things about it.

I suppose that learning XS first might be a good way to approach the
perl source anyway. Just trying to understand the innards by reading the
source is a very tall order. It's also more fun.

Tassilo
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,148
Messages
2,570,838
Members
47,385
Latest member
Joneswilliam01

Latest Threads

Top