Rubyのしくみ:Ruby Under a Microscope



Similar documents
たのしいプログラミング Pythonではじめよう!

P.1~18

I


困ったときのQ&A

困ったときのQ&A

学習内容と日常生活との関連性の研究-まえがき・概要・目次

Color MultiWriter 9900C/9800C ユーザーズマニュアル

Copyright SATO International All rights reserved. This software is based in part on the work of the Independen

* * * ** ** ** * ** * ** * ** * ** * ** ** * * ** * ** *** **** * ** * * * ** * * ** *** **** * * * * * * * * * * ** * * ** * ** ix

目次情報

ITR Market View:ECサイト構築/決済代行/CMS/SMS送信市場2018目次

『保守の比較政治学』

Step2 入門

untitled

パソコン機能ガイド

パソコン機能ガイド

I

untitled

ユーザーズガイド



ii


vi アハ ート2 アハ ート3 アハ ート4 アハ ート5 アハ ート6 アハ ート7 アハ ート8 アハ ート9 アハ ート10 アハ ート11 アハ ート12 アハ ート13 アハ ート14 アハ ート15 アハ ート16 アハ ート17 アハ ート18 アハ ート19 アハ ート20 アハ

Microsoft Word - 51プログラム名簿目次070913w.doc

MultiPASS B-20 MultiPASS Suite 3.10使用説明書

ChartPattern13

結婚生活を強める

01_SWGuide_V8.50.fm

困ったときのQ&A

Javaと.NET

はしがき・目次・事例目次・凡例.indd

2004年度日本経団連規制改革要望

情熱プログラマー ソフトウェア開発者の幸せな生き方

PHP4徹底攻略 改訂版

(i)


レーザビームプリンタ Satera ユーザーズガイド

™…

C ontents VI VII

SPP24_Program_WOC(J)-15

活用ガイド (ハードウェア編)

『戦時経済体制の構想と展開』


untitled


ITR Market View:アイデンティティ/アクセス管理市場2018目次

01_31窶愴胆1窶窶ー窶慊イfiツ。01-16

ハピタス のコピー.pages

Copyright 2008 All Rights Reserved 2

相続支払い対策ポイント

150423HC相続資産圧縮対策のポイント

初等協会5

アンデル:01(序〜3章).indd

ITR Market View:RPA/OCR/BPM市場2018目次

橡6.プログラム.doc

MultiPASS Suite 3.20 使用説明書

OFISTAR H7000ファクス編(2版 )

i


004139 医用画像‐27‐3/★追悼文‐27‐3‐0 松本様

finalゲーム調査報告書_目次_本編.PDF

Microsoft Word - resourceful Erica-japanese.doc

II


ITR Market View:情報漏洩対策市場2017目次

SR-53V[接続編]

VB-C50i/VB-C50iR 使用説明書


02_巻頭特集.indd

リファレンス

やよいの顧客管理

弥生給与/やよいの給与計算

弥生 シリーズ

弥生会計 プロフェッショナル/スタンダード/やよいの青色申告

弥生会計/やよいの青色申告

弥生会計 ネットワーク/プロフェッショナル2ユーザー

初心者にもできるアメブロカスタマイズ新2016.pages

FFD.fm

01_.g.r..

- 2 Copyright (C) All Rights Reserved.

エクセルカバー入稿用.indd

untitled

Ajax-ch00

2010_summer_spring_all.indd

2015春夏KIJE日本語.indd

III


2013秋冬日本語.indd

Copyright All Rights Reserved. -2 -!

2014春夏日本語.indd

72 はじめに 論文(査読論文)永禄三年の車争い図屏風The Screen Painting Confrontation of Carriages Produced in the Third Year of Eiroku(1560) Yoshiyuki TAKAMATSU

困ったときのQ&A

IPA:セキュアなインターネットサーバー構築に関する調査


Microsoft Word - 最終版 バックせどりismマニュアル .docx

2014秋冬日本語.indd

Copyright 2006 KDDI Corporation. All Rights Reserved page1

操作ガイド(本体操作編)

Transcription:

Ruby Ruby Under a Microscope Pat Shaughnessy 20150109 b5891c1 (m-sl b-n bc-n)

Title of English-language original: Ruby Under a Microscope ISBN 978-1-59327-527-3, published by No Starch Press, Inc. Copyright 2014 by Pat Shaughnessy. Japanese-language edition copyright 2014 by Ohmsha, Ltd. All rights reserved. No part of this book may be reproduced or transmitted in any form or by any means, electronic or mechanical, including photocopying, recording or by any information storage retrieval system, without permission from No Starch Press, Inc. E-mail kaihatu@ohmsha.co.jp FAX 03-3293-2825

Ruby Ruby Under a Microscope Pat Pat Rubyist Peter Cooper (@peterc), Editor of Ruby Inside and Ruby Weekly Ruby Xavier Noria (@fxn), Ruby Hero, Ruby on Rails Core Team Member Pat Shaughnessy Ruby Santiago Pastorino (@spastorino), WyeWorks Co-Founder, Ruby on Rails Core Team Member Ruby Ruby 3 Vlad Ivanovic (@vladiim), Digital Strategist at Holler Sydney Ruby David Deryl Downey (@daviddwdowney), Founder of CyberSpace Technologies Group

vi xv xvii xix xxi................................... xxi Ruby............................. xxii Ruby........................... xxii.................................. xxiii 1 3 Ruby...................... 4 parser_yylex........................... 7 1-1 Ripper Ruby. 9 Ruby............ 12 LALR.............. 14 Ruby................. 21 Bison....................... 23 1-2 Ripper Ruby. 25..................................... 31 2 33 Ruby 1.8........................ 34 Ruby 1.9................... 35 Ruby............ 36....................... 41 Ruby AST.............. 45 2-1 YARV...................... 48

vii.............................. 49.................... 52.................... 54 2-2.................. 56..................................... 58 3 Ruby 61 YARV Ruby............. 62 Ruby...... 63....................... 66 YARV.................... 68 3-1 Ruby 2.0/Ruby 1.9 Ruby 1.8...... 71 Ruby............... 74........................ 74............. 77........................... 78 C EP................... 81 3-2....................... 83....................... 87..................................... 89 4 91 Ruby if.................... 92.............. 95............................. 96.................... 98 4-1 Ruby... 99 send Ruby.................. 101............... 101 11...................... 102........................... 104................... 105......................... 106 attr_reader attr_writer................. 107 attr_reader attr_writer. 108 4-2 Ruby..... 109..................................... 113

viii 5 115 Ruby.......................... 116 klass ivptr......................... 117 2............... 118........................ 119 Ruby........... 120....... 121 RBasic RObject........... 122 Ruby........................... 123 5-1................................ 124 RClass......................... 127.................................. 130 vs................ 132....................... 134.................................. 137 RClass......................... 138 RClass..................... 140 5-2 Ruby.......... 141..................................... 144 6 147 Ruby................. 148...................... 148.............. 150 Ruby..................... 151........................... 152.................. 154 Ruby....................... 156................... 156................... 157 Ruby............. 158 2........ 158....... 160 Module#prepend......................... 162 Ruby Module#prepend.......... 166 6-1.......... 167

ix........... 168. 169.......................... 170 Ruby..... 171................................... 173................. 173 Ruby..... 175 Ruby..................... 176........... 177.. 179 Ruby.................... 181 6-2 Ruby.......... 182 Ruby................ 183..................................... 184 7 Ruby 187 Ruby...................... 188.................. 188................. 191 7-1.... 192...... 194............................ 195........................ 196 Ruby 196 7-2 1.. 197 57 67......... 200 Ruby................ 202 7-3......... 205 Ruby 2.0.................. 210..................................... 211 8 Lisp 213 Ruby.................... 214 Ruby........... 215 1975.................... 218 rb_block_t rb_control_frame_t.............. 221 8-1 while each.. 222

x Proc............... 226 vs....................... 227 Ruby......... 228 Ruby..................... 230 Ruby.................. 233 Proc.......................... 235 8-2....... 238 1............. 241..................................... 243 9 245....................... 246....................... 246 248.. 250.............. 251. 253 Refinements....................... 254 Refinements....................... 256 9-1 self 257 self................... 258 self....................... 259 self..................... 260 self................... 261 eval instance_eval binding..... 263....................... 263 binding eval................... 266 instance_eval........................ 268 Ruby 1........ 269 instance_eval self............. 271 instance_eval.............................. 272 Ruby. 273 9-2.......... 275 define_method........................ 275............... 276..................................... 278

xi 10 JRuby JVM Ruby 281 MRI JRuby................... 282 JRuby........ 284 JRuby.................. 285 Ruby Java............ 288 10-1 JRuby JIT.............. 290.............................. 291 -J-XX:+PrintCompilation............. 292 JIT JRuby.............. 293 JRuby MRI....................... 295 JRuby MRI.......... 295........................ 297 10-2............ 300............. 300.............................. 302................... 302............. 304..................................... 305 11 Rubinius Ruby Ruby 309 Rubinius....................... 310......................... 312 Ruby Ruby............... 313 Rubinius.................... 313 Ruby C++.................... 315 Ruby C++....... 317 11-1 MRI Rubinius........... 317 Rubinius..................... 318 Rubinius MRI........................... 321 MRI.......................... 321 RArray......................... 323 Rubinius........................ 324 11-2 Rubinius Array#shift........... 325 Array#shift.......................... 326 Array#shift........................ 327..................................... 330

xii 12 MRI JRuby Rubinius GC 333 3.............. 334 MRI.......... 334............................. 334 MRI.................. 335................................. 336 MRI........ 337................................ 338............................. 339 RVALUE........................... 339.................... 340 12-1 MRI........ 340 MRI.................. 342 MRI GC........................ 343 GC............ 344 JRuby Rubinius GC....................... 348 GC.................................. 348....................... 349......................... 350 Eden.............................. 352 GC.................................. 352............................ 353........ 353....................... 353........... 354............................. 355 GC.................................... 357....... 357............................ 359 JVM 3 GC....................... 360 12-2 JRuby Verbose GC.............. 362 GC....................... 363................................... 365..................................... 365 A Ruby 369 YARV Yet Another RubyVM........................ 369 YARV.............................. 370

xiii YARV........................... 371 Ruby..................... 372 373 375 382

xv *1 SF 1880 5 21 5 Ruby Ruby Ruby Ruby Ruby CRuby JRuby Rubinius Ruby *2 Ruby 1.7 YARV Ruby Ruby 2014 10 *1 1971 *2 Ruby 2002

xvii tenderlove Ruby Ruby on Rails Pat Pat Ruby Under a Microscope *3 Ruby Ruby Ruby Pat Ruby Ruby Ruby Ruby Ruby Ruby Aaron Patterson <3 <3 <3 <3 *3

xix Satty Bhens Alex Rothenberg Daniel Higginbotham Xavier Noria 6-1 Santiago Pastorino Jill Caporrimo Prajakta Thakur Yvannova Montalvo Divya Ganesh Yanwing Wong SWAT Peter Cooper Peter No Starch Press Ruby Under a Microscope Ruby 1 Julianne Jigour Riley Hoffman Alison Law Charles Nutter JVM Aaron Patterson Bill Pollock 1 1

xxi Ruby Ruby Ruby ruby Enter Ruby Ruby Lisp Smalltalk Ruby Ruby Ruby Ruby Ruby Ruby Ruby Ruby Ruby Ruby Ruby Ruby Ruby Ruby C C C Ruby Ruby

xxii note C Ruby C Ruby C C Ruby Ruby Ruby C Ruby C Ruby Ruby Ruby Ruby Ruby Ruby Ruby Ruby 1993 Matz Ruby Matz Ruby MRI MRI Matz Ruby RubyMotion MacRuby IronRuby Topaz JRuby C Rubinius Ruby Matz mruby Ruby mruby Ruby

xxiii Ruby JRuby Rubinius 10 11 12 Ruby MRI 1 Ruby 2 Ruby 3 Ruby 4 Ruby Ruby if...else while...end 5 Ruby Ruby 6 Ruby Ruby 7 Ruby Ruby MRI 8 Ruby Lisp 9 Ruby Ruby 10 Java Ruby JRuby JRuby Ruby Java JVM

xxiv 11 Ruby Rubinius Rubinius Ruby Ruby 12 GC Rubinius JRuby MRI GC Ruby Ruby 1600 Ruby Ruby

Ruby

3 1 Ruby 1 2 3 Rails Sinatra Ruby Ruby 3 ruby Ruby 1-1 Ruby YARV AST 1-1 Ruby Ruby Ruby Ruby Ruby Ruby Yet Another Ruby Virtual Machine YARV Ruby

4 1 3 Ruby 2 Ruby note 1993 Ruby Matz s Ruby Interpreter MRI Ruby Ruby MRI Ruby Enterprise Edition MagLev MacRuby RubyMotion mruby 10 11 12 Ruby 2 JRuby Rubinius Ruby Ruby simple.rb 1-1 Ruby simple.rb 10.times do n puts n end 1-2 simple.rb 1-1 $ ruby simple.rb 0 1 2 3 --snip-- ruby simple.rb ENTER Ruby simple.rb Ruby simple.rb Ruby 1-2

Ruby 5 1 0. t i m e s d o n 1-2 simple.rb Ruby 1-3 Ruby 1 0. t i m e s d o n 1-3 Ruby Ruby C C Ruby Ruby 1 1-4 0 1 0. t i m e s d o n 1-4 Ruby 1-5 1 0. t i m e s d o n 1-5 Ruby Ruby 1-6 Ruby t

6 1 1 0. t i m e s d o n 1-6 Ruby Ruby Ruby 1-7 1 0. t i m e s d o n 1-7 Ruby Ruby tinteger tinteger. t i m e s d o n 10 1-8 Ruby 2 tinteger Ruby 1 2 1-9 tinteger 10. t i m e s d o n 1-9 Ruby 1-10 Ruby times