6 ms·
Ruby hacking guide
- theboywho 13y agois there something like this for Scala ?
- nahumfarchi 13y agoOr for python?
- djacobs 13y agoIt would be great to host an up-to-date PDF with this, too. (Any interest in publishing this when it's at 1.0?)
- markburns 13y agoSounds like a good idea. After a considerable length of inactivity we've had some great translation contributions from github use ocha-. Taking it pretty much to the finish line. I'll do some proofreading too, as I know he's not a native English speaker. I guess epub formats etc would make sense too.
- djacobs 13y agoI'm happy to contribute, too -- let me know if you're interested in any help with editing or creating/maintaining a PDF.
- markburns 13y agoAbsolutely :) https://github.com/ruby-hacking-guide/ruby-hacking-guide.github.com/pulls/new https://github.com/ruby-hacking-guide/ruby-hacking-guide.git... I'm taking the approach of trusting first, so if your first PR isn't insane, then no reason not to add you to the team.
- why-el 13y agoThis is so awesome. I have been waiting for this to finish translating for some time now. When I read the first two chapters almost a year ago, I was pleased by how much detail the author goes into to explain the inner workings of Ruby. I recommend it to everyone.
- Legion 13y agoAnyone interested in this kind of content should see Pat Shaughnessy's Ruby Under a Microscope book: http://patshaughnessy.net/ruby-under-a-microscope http://patshaughnessy.net/ruby-under-a-microscope It's the closest thing we have to a new Ruby Hacking Guide. It's a somewhat gentler, more approachable treatment of the subject matter, but no less awesome. Shaughnessy also has a number of blog posts on his site that dive into the same kind of details covered in his book (and RHG).
- VeejayRampay 13y agoPat is awesome and a great pedagogue. I second this, his articles, books and guides are absolute must-reads for the Ruby enthusiast.
- petercooper 13y agoIt's only a very light, high level overview (so not one for experienced MRI hackers) but I recorded a 30 minute screencast with Pat a few months ago touring the MRI codebase: http://www.rubyinside.com/ruby-mri-code-walk-tour-6020.html http://www.rubyinside.com/ruby-mri-code-walk-tour-6020.html
- cjh_ 13y agoThis is extremely cool, I am becoming more interesting in the idea of trying to write a small toy language and articles like this excite and inform, great work.
- cremno 13y agoA better translation of chapter 11: http://whitequark.org/blog/2013/04/01/ruby-hacking-guide-ch-11-finite-state-lexer/ http://whitequark.org/blog/2013/04/01/ruby-hacking-guide-ch-...
- stephenitis 13y agoThanks for taking the time and effort to create this Steve! I'm always looking for more beginner and non-beginner resources to direct my friends too!
- steveklabnik 13y agoI did not create this, I just saw the link float by Twitter.
- denysonique 13y agoDoesn't mention how @@ is evil. @@ are not your usual class variables. @@ should be avoided in most programs.
- VeejayRampay 13y agoYep, as Martin Fowler nicely points out in http://martinfowler.com/bliki/ClassInstanceVariable.html http://martinfowler.com/bliki/ClassInstanceVariable.html "A class variable is shared across all instances of a class, which includes all subclasses". Can be surprising when using inheritance.
- meowface 13y agoWell, that behavior is not surprising or anything. Many other languages have some kind of concept of a class instance variable (such as Python).
- valisystem 13y agoYou're right saying that it's the proper behavior for such a semantic. But the problem is, @@ notation can make you forget you're not manipulating something that might be shared and re-assigning an ancestor class variable accidentally, messing up its behavior. And while it's common to check for method overrides, class variable overrides is not something that is checked very frequently. It is the kind of bug that can be very long to figure out, since when you make this mistake, it's very likely because you forgot to think about this behavior.
- jwilliams 13y agoThis guide is specifically about the internals of and "hacking" the Ruby MRI -- it's not about hacking Ruby in general. Unless there is something specific about the MRI implementation and class variables?
- revskill 13y agoThere is a quote: "Rails is like Bible. Unless you are a Saint, you do not need to understand it and you probably will never understand; all you need to do is to believe in it." Ruby changed my life, it changed my mindset.
- jamesbritt 13y agoJust how big are the differences between Ruby 1.7.3 (the topic of this hacking guide) and the current version? Has anything fundamental changed in how Ruby manages objects or does garbage collection?
- deleted 13y ago[deleted]
- InAnEmergency 13y agoI suspect it has changed considerably, especially with the change from full interpreter to VM in Ruby 1.9. Garbage collection has changed from regular mark-and-sweep to lazy sweep to using bitmap marking.