Ruby Design Principles

P

pat eyler

I like the

DONUTS WILL BE PROVIDED

in a font almost as large and heavy as the title
on the flier,

heh, we take our donuts seriously in Provo. :)
and, yes, they were good donuts (at least my maple bar was).
 
J

Joel VanderWerf

Yukihiro said:
Hi,

In message "Re: Ruby Design Principles"

|Anyone have the link for the slides? (The movie has very
|high compression.)

http://www.rubyist.net/~matz/slides/byu/

Is it really fair to say that the ruby program

print *ARGF

is the same as /bin/cat? When used interactively they are different:

$ cat cat.rb
print *ARGF
$ ruby cat.rb
1
2
3
1
2
3
$ cat
1
1
2
2
3
3
$ ruby -e 'ARGF.each{|line| print line}'
1
1
2
2
3
3

Also, with a lot of input, the memory usage will be very different,
since 'print *ARGF' slurps all input.

But even 'ARGF.each{|line| print line}' is a lot shorter than 50 lines of C!
 
R

Reid Thompson

Joel said:
Is it really fair to say that the ruby program

print *ARGF

is the same as /bin/cat? When used interactively they are different:

$ cat cat.rb
print *ARGF
$ ruby cat.rb
1
2
3
1
2
3
$ cat
1
1
2
2
3
3
$ ruby -e 'ARGF.each{|line| print line}'
1
1
2
2
3
3

Also, with a lot of input, the memory usage will be very different,
since 'print *ARGF' slurps all input.

But even 'ARGF.each{|line| print line}' is a lot shorter than 50 lines
of C!
:) but how many lines of C are hidden behind that 'ARGF.each{|line|
print line}'
 
J

Joel VanderWerf

Reid said:
Joel VanderWerf wrote: ...
:) but how many lines of C are hidden behind that 'ARGF.each{|line|
print line}'

For that matter, how many machine instructions behind those 50 lines of
C, and how many femto-turtles carrying out those instructions, and so on
all the way down?
 
B

Bira

For that matter, how many machine instructions behind those 50 lines of
C, and how many femto-turtles carrying out those instructions, and so on
all the way down?

For performance, write it in femto-turtles :).
 
M

M. Edward (Ed) Borasky

Wilson said:
I'm writing a DSL to manipulate the spacetime foam directly.
Performance above all!
How do you get the dust mites out of the spacetime foam? I can't use it
in a pillow if it has dust mites!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,019
Latest member
RoxannaSta

Latest Threads

Top