Re: Tips or strategies to understanding how CPython works under the hood

2018-01-11 Thread Gregory Ewing
Robert O'Shea wrote: I wrote a little bytecode interpreter in C (maybe should have upgrade to C++ but not yet) Don't feel bad about that -- IMO, C is perfectly fine for tnis kind of thing, and "upgrading" to C++ would gain you nothing while introducing extra headaches. -- Greg --

Re: Tips or strategies to understanding how CPython works under the hood

2018-01-11 Thread Chris Angelico
On Fri, Jan 12, 2018 at 9:52 AM, Skip Montanaro wrote: >> So besides just grabbing a chunk of CPython source code and digesting it, I >> was wondering if those of you have read and understood the source code, do >> you have any tips or good starting points? > > Not

Re: Tips or strategies to understanding how CPython works under the hood

2018-01-11 Thread Skip Montanaro
> So besides just grabbing a chunk of CPython source code and digesting it, I > was wondering if those of you have read and understood the source code, do > you have any tips or good starting points? Not mentioned yet, but maybe worth considering, might be to dip into the way back machine and

Re: Tips or strategies to understanding how CPython works under the hood

2018-01-11 Thread Robert O'Shea
Thanks all for the links and suggestions, they are greatly appreciated. I might be programming for a long time (relative to my age) but I haven't touched much on compilers or interpreters. Inspired a but by Python's interpreter I wrote a little bytecode interpreter in C (maybe should have upgrade

Re: Tips or strategies to understanding how CPython works under the hood (Posting On Python-List Prohibited)

2018-01-10 Thread bartc
On 10/01/2018 23:31, Lawrence D’Oliveiro wrote: On Thursday, January 11, 2018 at 1:08:25 AM UTC+13, bartc wrote: But I'm not convinced that register-based is necessarily faster. Not if your code is dominated by memory accesses, as a dynamic language is likely to be. But ask the people who

Re: Tips or strategies to understanding how CPython works under the hood

2018-01-10 Thread bartc
On 09/01/2018 20:12, Alain Ketterlin wrote: ElChino writes: Chris Angelico wrote: CPython is a stack-based interpreter, which means it loads values onto an (invisible) internal stack, processes values at the top of the stack, and removes them when it's done. Is this

Re: Tips or strategies to understanding how CPython works under the hood

2018-01-10 Thread Robin Becker
http://aosabook.org/en/500L/a-python-interpreter-written-in-python.html -- Robin Becker -- https://mail.python.org/mailman/listinfo/python-list

Re: Tips or strategies to understanding how CPython works under the hood

2018-01-09 Thread breamoreboy
On Tuesday, January 9, 2018 at 3:22:30 PM UTC, Robert O'Shea wrote: > Hey all, > > Been subscribed to this thread for a while but haven't contributed much. > One of my ultimate goals this year is to get under the hood of CPython and > get a decent understanding of mechanics Guido and the rest of

Re: Tips or strategies to understanding how CPython works under the hood

2018-01-09 Thread David Stanek
On 09-Jan 15:21, Robert O'Shea wrote: > > Been subscribed to this thread for a while but haven't contributed much. +1. I'm a lurker too. > So besides just grabbing a chunk of CPython source code and digesting it, I > was wondering if those of you have read and understood the source code, do >

Re: Tips or strategies to understanding how CPython works under the hood

2018-01-09 Thread Alain Ketterlin
ElChino writes: > Chris Angelico wrote: > >> CPython is a stack-based interpreter, which means it loads values onto >> an (invisible) internal stack, processes values at the top of the >> stack, and removes them when it's done. > > Is this similar to how Lua operates too? No.

Re: Tips or strategies to understanding how CPython works under the hood

2018-01-09 Thread Chris Angelico
On Wed, Jan 10, 2018 at 6:20 AM, ElChino wrote: > Chris Angelico wrote: > >> CPython is a stack-based interpreter, which means it loads values onto >> an (invisible) internal stack, processes values at the top of the >> stack, and removes them when it's done. > > > Is this similar

Re: Tips or strategies to understanding how CPython works under the hood

2018-01-09 Thread ElChino
Chris Angelico wrote: CPython is a stack-based interpreter, which means it loads values onto an (invisible) internal stack, processes values at the top of the stack, and removes them when it's done. Is this similar to how Lua operates too? --

Re: Tips or strategies to understanding how CPython works under the hood

2018-01-09 Thread Paul Moore
On 9 January 2018 at 16:18, Chris Angelico wrote: > On Wed, Jan 10, 2018 at 2:21 AM, Robert O'Shea > wrote: >> Hey all, >> >> Been subscribed to this thread for a while but haven't contributed much. >> One of my ultimate goals this year is to get

Re: Tips or strategies to understanding how CPython works under the hood

2018-01-09 Thread Chris Angelico
On Wed, Jan 10, 2018 at 2:21 AM, Robert O'Shea wrote: > Hey all, > > Been subscribed to this thread for a while but haven't contributed much. > One of my ultimate goals this year is to get under the hood of CPython and > get a decent understanding of mechanics Guido and

Tips or strategies to understanding how CPython works under the hood

2018-01-09 Thread Robert O'Shea
Hey all, Been subscribed to this thread for a while but haven't contributed much. One of my ultimate goals this year is to get under the hood of CPython and get a decent understanding of mechanics Guido and the rest of you wonderful people have designed and implemented. I've been programming in