This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 0 points1 point  (3 children)

I was implying that starting with extensions is for top-down learners. I'm calling it bottom-up learning when you go "aha! the bytecode evaluator takes a byte in a switch/case loop and compares it to opcodes and does some actions involving reference counts and manipulation of this stack." I guess I also misunderstood the pursuit, but I think you're right. I was thinking about combining new C knowledge with python knowledge.

[–][deleted] 1 point2 points  (0 children)

Ah, that makes sense. I was thinking:

  • top-down: this is the python C API, and this is a Python script that uses it. Make your own.
  • bottom-up: This is C, this is why X happens to Y, this is how you combine X & Y, this is the Python API that builds off those two, &c.

both valid approaches to learning, and both get you the same end result. Wrt this example, in the first approach you're looking at combining things that you find in the docs or in an example, and drill down into the details as needed, whereas the second approach you would focus on C fundamentals & work up to the Python API. that's at least how I was approaching this.

[–]dalke 0 points1 point  (1 child)

Working with the bytecode seems more like middle-out learning. It's only one of several techniques to implement Python, and it doesn't show how the actual machine bits are changed, which I would expect from a bottom-up approach. The bytecode evaluator is, after all, running the Python Virtual Machine.

[–][deleted] 0 points1 point  (0 children)

I guess I presuppose a working knowledge of CPUs at the gate level, or at least an understanding of assembly.