patshaughnessy / ruby-under-a-microscope Goto Github PK
View Code? Open in Web Editor NEWCode Samples for Ruby Under A Microscope - Learning Ruby Internals Through Experiment
Code Samples for Ruby Under A Microscope - Learning Ruby Internals Through Experiment
It not only has to track the arguments and return values for it’s own internal instructions
Should be =>
It not only has to track the arguments and return values for its own internal instructions
Thanks
by using something called a “catch table” A catch table
“catch table”. A
look in the org.jruby.compile package
org.jruby.compiler
Specifically, this allows the puts statement to access the str2 variable from the parent scope.
Should be =>
Specifically, this allows the puts statement to access the str variable from the parent scope.
This second stack represents the path through your Ruby program YARV has taken and
it’s current location.
should be =>
This second stack represents the path through your Ruby program YARV has taken and
its current location
Tokenization and parsing are two separate processes that actually happen at the time time
should be Tokenization and parsing are two separate processes that actually happen at the same time
Lexical scope refers to the class or module the you are currently defining methods for.
that
I save it in code_value
Should be =>
I save it in function_value
Here the puts function call refers equally well to the str variable located inside the
block and the str2 variable from the surrounding code.
Should be ->
Here the puts function call refers equally well to the str2 variable located inside the
block and the str variable from the surrounding code.
Just like Ruby itself, YARV has it own control structures
its
But alongside YARV’s internal stack Ruby also keeps track of your Ruby program’s call stack: which methods called which other methods, functions, blocks, lambdas, etc. In fact, YARV is not just a stack machine – it’s a “double stack machine!” It not only has to track the arguments and return values for it’s own internal instructions; it has to do it for your Ruby arguments and return values as well.
Pat Shaughnessy. Ruby Under a Microscope (Kindle Locations 1079-1082).
Should the first sentence read: "alongside YARV's internal stack YARV also keeps track of your Ruby's program's call stack", or am I misreading?
I am not sure whether this is appropriate or not. But here is my thought about this sentence on page 128 -
Whenever the FIXNUM_FLAG is set, Ruby knows this VALUE is really a small integer, an
instance of the Fixnum class, and not a pointer to a value structure.
Could it be considered to be rephrased to below sentence for more clarity ?
Whenever the FIXNUM_FLAG is set, Ruby knows this VALUE is really a small integer, an
instance of the Fixnum class, and not a pointer to its corresponding C structure.
Thanks !
The works the same way
This
On page 129 for this line -
The class method returns the class pointer.
Please correct the last font i.e. 's' to match with the entire 'class' word.
Thanks !
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.