BN.com Gift Guide

Ruby Under a Microscope: An Illustrated Guide to Ruby Internals

Overview

Ruby is a powerful programming language with a focus on simplicity, but beneath its elegant syntax it performs countless unseen tasks.

Ruby Under a Microscope gives you a hands-on look at Ruby's core, using extensive diagrams and thorough explanations to show you how Ruby is implemented (no C skills required). Author Pat Shaughnessy takes a scientific approach, laying out a series of experiments with Ruby code to take you behind the scenes of how programming languages work. ...

See more details below
Paperback
$29.04
BN.com price
(Save 27%)$39.95 List Price

Pick Up In Store

Reserve and pick up in 60 minutes at your local store

Other sellers (Paperback)
  • All (14) from $22.98   
  • New (13) from $22.98   
  • Used (1) from $29.03   
Ruby Under a Microscope: An Illustrated Guide to Ruby Internals

Available on NOOK devices and apps  
  • NOOK Devices
  • Samsung Galaxy Tab 4 NOOK 7.0
  • Samsung Galaxy Tab 4 NOOK 10.1
  • NOOK HD Tablet
  • NOOK HD+ Tablet
  • NOOK eReaders
  • NOOK Color
  • NOOK Tablet
  • Tablet/Phone
  • NOOK for Windows 8 Tablet
  • NOOK for iOS
  • NOOK for Android
  • NOOK Kids for iPad
  • PC/Mac
  • NOOK for Windows 8
  • NOOK for PC
  • NOOK for Mac
  • NOOK for Web

Want a NOOK? Explore Now

NOOK Book (eBook)
$17.99
BN.com price
(Save 43%)$31.95 List Price

Overview

Ruby is a powerful programming language with a focus on simplicity, but beneath its elegant syntax it performs countless unseen tasks.

Ruby Under a Microscope gives you a hands-on look at Ruby's core, using extensive diagrams and thorough explanations to show you how Ruby is implemented (no C skills required). Author Pat Shaughnessy takes a scientific approach, laying out a series of experiments with Ruby code to take you behind the scenes of how programming languages work. You'll even find information on JRuby and Rubinius (two alternative implementations of Ruby), as well as in-depth explorations of Ruby's garbage collection algorithm.

Ruby Under a Microscope will teach you:

  • How a few computer science concepts underpin Ruby's complex implementation
  • How Ruby executes your code using a virtual machine
  • How classes and modules are the same inside Ruby
  • How Ruby employs algorithms originally developed for Lisp
  • How Ruby uses grammar rules to parse and understand your code
  • How your Ruby code is translated into a different language by a compiler
No programming language needs to be a black box. Whether you're already intrigued by language implementation or just want to dig deeper into Ruby, you'll find Ruby Under a Microscope a fascinating way to become a better programmer.

Covers Ruby 2.x, 1.9 and 1.8

Read More Show Less

Product Details

  • ISBN-13: 9781593275273
  • Publisher: No Starch Press San Francisco, CA
  • Publication date: 11/14/2013
  • Edition number: 1
  • Pages: 360
  • Sales rank: 765,757
  • Product dimensions: 6.90 (w) x 9.20 (h) x 1.20 (d)

Meet the Author

Well known for his coding expertise and passion for the Ruby programming language, Pat Shaughnessy blogs and writes tutorials at https://patshaughnessy.net/. He also develops Ruby applications at management consulting firm McKinsey & Co. Shaughnessy is a regular presenter on the Ruby conference circuit, and his articles and presentations have been featured in the Ruby Weekly newsletter, the Ruby5 podcast, and The Ruby Show.

Read More Show Less

Table of Contents

;
Advance Praise for Ruby under a Microscope;
About the Author;
Foreword;
Acknowledgments;
Introduction;
Who This Book Is For;
Using Ruby to Test Itself;
Which Implementation of Ruby?;
Overview;
Chapter 1: Tokenization and Parsing;
1.1 Tokens: The Words That Make Up the Ruby Language;
1.2 Experiment 1-1: Using Ripper to Tokenize Different Ruby Scripts;
1.3 Parsing: How Ruby Understands Your Code;
1.4 Experiment 1-2: Using Ripper to Parse Different Ruby Scripts;
1.5 Summary;
Chapter 2: Compilation;
2.1 No Compiler for Ruby 1.8;
2.2 Ruby 1.9 and 2.0 Introduce a Compiler;
2.3 How Ruby Compiles a Simple Script;
2.4 Compiling a Call to a Block;
2.5 Experiment 2-1: Displaying YARV Instructions;
2.6 The Local Table;
2.7 Experiment 2-2: Displaying the Local Table;
2.8 Summary;
Chapter 3: How Ruby Executes Your Code;
3.1 YARV’s Internal Stack and Your Ruby Stack;
3.2 Experiment 3-1: Benchmarking Ruby 2.0 and Ruby 1.9 vs. Ruby 1.8;
3.3 Local and Dynamic Access of Ruby Variables;
3.4 Experiment 3-2: Exploring Special Variables;
3.5 Summary;
Chapter 4: Control Structures and Method Dispatch;
4.1 How Ruby Executes an if Statement;
4.2 Jumping from One Scope to Another;
4.3 Experiment 4-1: Testing How Ruby Implements for Loops Internally;
4.4 The send Instruction: Ruby’s Most Complex Control Structure;
4.5 Calling Normal Ruby Methods;
4.6 Calling Built-In Ruby Methods;
4.7 Experiment 4-2: Exploring How Ruby Implements Keyword Arguments;
4.8 Summary;
Chapter 5: Objects and Classes;
5.1 Inside a Ruby Object;
5.2 Experiment 5-1: How Long Does It Take to Save a New Instance Variable?;
5.3 What’s Inside the RClass Structure?;
5.4 Experiment 5-2: Where Does Ruby Save Class Methods?;
5.5 Summary;
Chapter 6: Method Lookup and Constant Lookup;
6.1 How Ruby Implements Modules;
6.2 Ruby’s Method Lookup Algorithm;
6.3 Experiment 6-1: Modifying a Module After Including It;
6.4 Constant Lookup;
6.5 Lexical Scope in Ruby;
6.6 Experiment 6-2: Which Constant Will Ruby Find First?;
6.7 Summary;
Chapter 7: The Hash Table: The Workhorse of Ruby Internals;
7.1 Hash Tables in Ruby;
7.2 Experiment 7-1: Retrieving a Value from Hashes of Varying Sizes;
7.3 How Hash Tables Expand to Accommodate More Values;
7.4 Experiment 7-2: Inserting One New Element into Hashes of Varying Sizes;
7.5 How Ruby Implements Hash Functions;
7.6 Experiment 7-3: Using Objects as Keys in a Hash;
7.7 Summary;
Chapter 8: How Ruby Borrowed a Decades-Old Idea from Lisp;
8.1 Blocks: Closures in Ruby;
8.2 Experiment 8-1: Which Is Faster: A while Loop or Passing a Block to each?;
8.3 Lambdas and Procs: Treating a Function as a First-Class Citizen;
8.4 Experiment 8-2: Changing Local Variables After Calling lambda;
8.5 Summary;
Chapter 9: Metaprogramming;
9.1 Alternative Ways to Define Methods;
9.2 Experiment 9-1: Who Am I? How self Changes with Lexical Scope;
9.3 Metaprogramming and Closures: eval, instance_eval, and binding;
9.4 Experiment 9-2: Using a Closure to Define a Method;
9.5 Summary;
Chapter 10: JRuby: Ruby on the JVM;
10.1 Running Programs with MRI and JRuby;
10.2 Experiment 10-1: Monitoring JRuby’s Just-in-Time Compiler;
10.3 Strings in JRuby and MRI;
10.4 Experiment 10-2: Measuring Copy-on-Write Performance;
10.5 Summary;
Chapter 11: Rubinius: Ruby Implemented with Ruby;
11.1 The Rubinius Kernel and Virtual Machine;
11.2 Experiment 11-1: Comparing Backtraces in MRI and Rubinius;
11.3 Arrays in Rubinius and MRI;
11.4 Experiment 11-2: Exploring the Rubinius Implementation of Array#shift;
11.5 Summary;
Chapter 12: Garbage Collection in MRI, JRuby, and Rubinius;
12.1 Garbage Collectors Solve Three Problems;
12.2 Garbage Collection in MRI: Mark and Sweep;
12.3 Experiment 12-1: Seeing MRI Garbage Collection in Action;
12.4 Garbage Collection in JRuby and Rubinius;
12.5 Copying Garbage Collection;
12.6 Generational Garbage Collection;
12.7 Concurrent Garbage Collection;
12.8 Experiment 12-2: Using Verbose GC Mode in JRuby;
12.9 Further Reading;
12.10 Summary;

Read More Show Less

Customer Reviews

Be the first to write a review
( 0 )
Rating Distribution

5 Star

(0)

4 Star

(0)

3 Star

(0)

2 Star

(0)

1 Star

(0)

Your Rating:

Your Name: Create a Pen Name or

Barnes & Noble.com Review Rules

Our reader reviews allow you to share your comments on titles you liked, or didn't, with others. By submitting an online review, you are representing to Barnes & Noble.com that all information contained in your review is original and accurate in all respects, and that the submission of such content by you and the posting of such content by Barnes & Noble.com does not and will not violate the rights of any third party. Please follow the rules below to help ensure that your review can be posted.

Reviews by Our Customers Under the Age of 13

We highly value and respect everyone's opinion concerning the titles we offer. However, we cannot allow persons under the age of 13 to have accounts at BN.com or to post customer reviews. Please see our Terms of Use for more details.

What to exclude from your review:

Please do not write about reviews, commentary, or information posted on the product page. If you see any errors in the information on the product page, please send us an email.

Reviews should not contain any of the following:

  • - HTML tags, profanity, obscenities, vulgarities, or comments that defame anyone
  • - Time-sensitive information such as tour dates, signings, lectures, etc.
  • - Single-word reviews. Other people will read your review to discover why you liked or didn't like the title. Be descriptive.
  • - Comments focusing on the author or that may ruin the ending for others
  • - Phone numbers, addresses, URLs
  • - Pricing and availability information or alternative ordering information
  • - Advertisements or commercial solicitation

Reminder:

  • - By submitting a review, you grant to Barnes & Noble.com and its sublicensees the royalty-free, perpetual, irrevocable right and license to use the review in accordance with the Barnes & Noble.com Terms of Use.
  • - Barnes & Noble.com reserves the right not to post any review -- particularly those that do not follow the terms and conditions of these Rules. Barnes & Noble.com also reserves the right to remove any review at any time without notice.
  • - See Terms of Use for other conditions and disclaimers.
Search for Products You'd Like to Recommend

Recommend other products that relate to your review. Just search for them below and share!

Create a Pen Name

Your Pen Name is your unique identity on BN.com. It will appear on the reviews you write and other website activities. Your Pen Name cannot be edited, changed or deleted once submitted.

 
Your Pen Name can be any combination of alphanumeric characters (plus - and _), and must be at least two characters long.

Continue Anonymously

    If you find inappropriate content, please report it to Barnes & Noble
    Why is this product inappropriate?
    Comments (optional)