aku-aku: v.. To move a tall, flat bottomed object (such as a bookshelf) by swiveling it alternatively on its corners in a "walking" fashion. [After the book by Thor Heyerdahl theorising the statues of Easter Island were moved in this fashion.] source: LangMaker.com. Aku Aku also has another meaning to the islanders: a spiritual guide.
« hunted by a freak | Main Page | giant steps »
Penrose's Guide to the Universe
Posted by dav at 2005 March 2 10:52 AM
File under: Books

A just noticed Roger Penrose's new book The Road to Reality: A Complete Guide to the Laws of the Universe is out and weighing in at over 1100 pages. I'm half tempted to order it, but I already brought the equally long book Stephen Wolfram's A New Kind of Science down to Brazil in hopes I could finally make my way through that tome.

I haven't cracked that one open since I got here, but thanks to three days of flat ocean I finally was compelled to sit down and work on one of the hacking projects on my agenda: learning Ruby and Ruby on Rails. I'm impressed with this language, but especially the Rails framework. It's just ridiculously simple to set up a basic database-backed web application. In just one line of code and changing a couple of params in a config file you can create a web frontend to a database table. The rails tutorial was well written.

The language has a few things that are weird to a long-in-the-tooth Java coder like me. Here's the notes I jotted into Notational Velocity as I was running through the Ruby tutorial:

  • redo: start at top of loop with same values
  • iterators ( str.each_char{ |ch| printf "<%c>", ch}
  • retry: start back at beginning of iteration
  • for var in var2 is equivalent to vars.each{|var| ....}
  • yield: moves control to a block of code passed to the iterator function
  • methods defined in the "top level" of code are private methods to Object (mother of all objects)
  • an object of a Class may have new methods added or altered dynamically, thus specific to that object (called singleton method)
  • Module (like a class but no instances or subclasses)
  • mixin: mixes in the methods of a module in a class,imitating multiple inheritance. Sort of like "implements" in java
  • proc {} object and proc.call, can be passed as arguments
  • begin/rescue/ensure/end (like try/catch/finally) and raise (like throw)
  • inspect and to_s (like java toString())
  • attr_reader :v, attr_writer :v, and attr_accessor :v (shortcuts for accessor method creation)
  • initialize is the constructor

I'm especially looking forward to wrapping my mind around passing code blocks as arguments. This isn't new to the world of programming languages but it is something I've never played with before and seems to open up a lot of possibilities.


Post a new comment:

Thanks for signing in, . Now you can comment. (sign out)

(If you haven't left a comment here before, you may need to be approved by the site owner before your comment will appear. Until then, it won't appear on the entry. Thanks for waiting.)

Remember me?