Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Ruby > the perens in lisp dilects is there for a reson... macros.

Reply
Thread Tools

the perens in lisp dilects is there for a reson... macros.

 
 
M. Edward (Ed) Borasky
Guest
Posts: n/a
 
      08-06-2006
Charles Hoffman wrote:
> On Sun, 2006-08-06 at 13:34 +0900, Rick DeNatale wrote:
>
>> On 8/5/06, Daniel Martin <> wrote:
>>
>>> writes:
>>>
>>>
>>>> <smug lisp weenie giving standard lisp macro rant omitted>
>>>>

>
> Oh, and if anyone's keeping score, the parens in Lisp/Scheme are there
> to structure the code and data. Where other languages are full of {},
> [], ;, and all sort of other punctuation marks, in Lisp you only
> have/need parentheses to serve all the same purposes. It doesn't have
> anything to do with macros per se.
>
> --ch--
>

There's a bit more to it than that. Ironically, Lisp originated as an
implementation of "parenthesis-free (Polish) prefix" notation in
symbolic logic. That is, rather than write "A + (B * C)" one writes "+ A
* B C". The parentheses came about for a number of reasons:

1. Unlike my example, Lisp functions even in Lisp 1 did not have a fixed
arity,
2. As someone already pointed out, S expressions used them,
3. It's more natural when you have multi-character atoms,

etc. So in Lisp you end up with "(PLUS A (TIMES A B))".

The reverse Polish form "B C * A +" is what the early compilers
generated, and is now known as Forth.

Incidentally, the original Lisp spec had list elements separated by
commas, for example "(ALPHA,(BETA,GAMMA))". There was a bug/feature in
the first implementation that allowed spaces, and the rest is history.

 
Reply With Quote
 
 
 
 
M. Edward (Ed) Borasky
Guest
Posts: n/a
 
      08-06-2006
wrote:
> I think Ruby is slightly older than Java, isn't it?

Maybe ... Java is 1.5 and Ruby is 1.8.5, so by that measure, yes. I
suppose I need to look up the history of Ruby. But I remember jumping on
Java in the 1.1 days many years ago as a language I thought was *vastly*
superior to Perl 4, and taking flames for saying so. The Perlists had
their revenge though; I wrote one program in Java and that was it.

> You may have me beat. My first was BASIC on a PDP-8, followed by
> BASIC and assembler on a PDP-10. I think at least the '10 had
> integrated circuits

I once had a boss who claimed to have worked on an IBM 1620. I think he
was trying to impress us as being a "real programmer just like us." The
lab where I worked on a 1620 got rid of it in 1964 ... I'm guessing he
was in junior high school then.

> As for language geekdom: I feel like I used to be more than I am now,
> but it's more because Ruby stuff is keeping me so busy than because
> Ruby satisfies all my language interest. In fact I've never wanted
> Ruby to take on Lisp macros, Python whitespace, Java-style typing,
> C-style comments, and all the rest of it. Maybe there should be one
> or more kitchen-sink languages out there, but they should be written
> from scratch for that purpose.

A long time ago some computer scientist defined two types of languages
-- "core" languages and "shell" languages. Lisp, Scheme and Forth are
great examples of core languages ... just a few simple core concepts
from which you can build mighty software. And the classic shell
languages are PL/I and Ada ... just about anything you'd ever want to do
is built into the language.

The languages most of us use these days are in between. The core is
bigger than the core of Lisp or Forth -- it includes strings, various
floating point numbers and math functions, arrays and usually hashes,
and usually objects, classes of objects and methods. What Ruby has that
many of them lack, however, is more or less explicit use of classical
computer science concepts, usch as lambda and continuations.

 
Reply With Quote
 
 
 
 
Charles Hoffman
Guest
Posts: n/a
 
      08-06-2006
On Mon, 2006-08-07 at 00:49 +0900, M. Edward (Ed) Borasky wrote:
> Whatever you opinions about any programming language are, Ruby is
> implemented in C at the moment, so C at least has *that* going for it!


Java's VM is written in C too, is it not?

MTASC, a rather good open-source ActionScript compiler, is written in
OCaml... as is haXe, I think.

C is kind of an obvious choice for interpreters/compilers because of the
availability of Lex and Yacc (and/or flex and Bison), I suppose.

Hmmm... I had rather thought that functional-style languages were more
common for writing language interpreters/compilers in. Aren't Lisp guys
always on about using Lisp to write another language more specific to
the problem domain, and working from there?

In the Programming Languages course I took at UNI we developed an
interpreter for a simple language in Scheme... the professor I took that
course with just e-mailed me a Joy interpreter he wrote, also in Scheme,
that I had expressed interest in. In another course I took with another
prof, we used a Mumps compiler he had written in C++; actually it
translated Mumps to C++ and compiled that with gcc.

I think gForth is written in C, but there are faster Forth environments
out there; I wonder what they used. I'm pretty sure a lot of Forth
environments are started in assembler.

Anyway I'm rambling, just because this is a fun topic.

I'd learned that it was common to develop a minimal subset of a new
language in another language, then use that small version of the
language to write the rest. The Lisp environments I've used certainly
appear to have been implemented in this way, and Forth is explicitly so.
There definitely seem to be some very low-level functions in Ruby that
seem to be mainly used by more advanced Rubyists, usually for
metaprogramming-like things. Stuff like instance_eval. Am I on-track
in having the impression that Ruby is designed that way? Just curious.

--ch--


 
Reply With Quote
 
dblack@wobblini.net
Guest
Posts: n/a
 
      08-06-2006
Hi --

On Mon, 7 Aug 2006, M. Edward (Ed) Borasky wrote:

> wrote:
>> I think Ruby is slightly older than Java, isn't it?

> Maybe ... Java is 1.5 and Ruby is 1.8.5, so by that measure, yes.


No, I meant older as in... older Ruby's birthday is traditionally
February 1994 (I can't remember the exact day), and I seem to remember
that that predates Java, but I'm not sure.


David

--
http://www.rubypowerandlight.com => Ruby/Rails training & consultancy
----> SEE SPECIAL DEAL FOR RUBY/RAILS USERS GROUPS! <-----
http://dablog.rubypal.com => D[avid ]A[. ]B[lack's][ Web]log
http://www.manning.com/black => book, Ruby for Rails
http://www.rubycentral.org => Ruby Central, Inc.

 
Reply With Quote
 
M. Edward (Ed) Borasky
Guest
Posts: n/a
 
      08-06-2006
wrote:
> Hi --
>
> On Mon, 7 Aug 2006, M. Edward (Ed) Borasky wrote:
>
>> wrote:
>>> I think Ruby is slightly older than Java, isn't it?

>> Maybe ... Java is 1.5 and Ruby is 1.8.5, so by that measure, yes.

>
> No, I meant older as in... older Ruby's birthday is traditionally
> February 1994 (I can't remember the exact day), and I seem to remember
> that that predates Java, but I'm not sure.

Where can one find "a brief history of Ruby?" I'm too lazy to ask
Google, especially when Matz is on the list.

For that matter, how did *Google* get its name, and does it have
anything to do with Barney Google?

 
Reply With Quote
 
Ola Bini
Guest
Posts: n/a
 
      08-06-2006
M. Edward (Ed) Borasky wrote:
> wrote:
> For that matter, how did *Google* get its name, and does it have
> anything to do with Barney Google?


Google comes from the name of the number 10^100 which is called a
googol. Ackording to wikipedia Google originally was a misspelling of this.


--
Ola Bini (http://ola-bini.blogspot.com)
JvYAML, RbYAML, JRuby and Jatha contributor
System Developer, Karolinska Institutet (http://www.ki.se)
OLogix Consulting (http://www.ologix.com)

"Yields falsehood when quined" yields falsehood when quined.



 
Reply With Quote
 
dblack@wobblini.net
Guest
Posts: n/a
 
      08-06-2006
Hi --

On Mon, 7 Aug 2006, M. Edward (Ed) Borasky wrote:

> wrote:
>> Hi --
>>
>> On Mon, 7 Aug 2006, M. Edward (Ed) Borasky wrote:
>>
>>> wrote:
>>>> I think Ruby is slightly older than Java, isn't it?
>>> Maybe ... Java is 1.5 and Ruby is 1.8.5, so by that measure, yes.

>>
>> No, I meant older as in... older Ruby's birthday is traditionally
>> February 1994 (I can't remember the exact day), and I seem to remember
>> that that predates Java, but I'm not sure.

> Where can one find "a brief history of Ruby?" I'm too lazy to ask Google,
> especially when Matz is on the list.


Whoops, I was wrong; it was 1993. See
http://blade.nagaokaut.ac.jp/cgi-bin.../ruby-talk/382


David

--
http://www.rubypowerandlight.com => Ruby/Rails training & consultancy
----> SEE SPECIAL DEAL FOR RUBY/RAILS USERS GROUPS! <-----
http://dablog.rubypal.com => D[avid ]A[. ]B[lack's][ Web]log
http://www.manning.com/black => book, Ruby for Rails
http://www.rubycentral.org => Ruby Central, Inc.

 
Reply With Quote
 
Ola Bini
Guest
Posts: n/a
 
      08-06-2006
Kristof Bastiaensen wrote:
> On Mon, 07 Aug 2006 01:51:08 +0900, M. Edward (Ed) Borasky wrote:
>
> Lisp is definitely not a core language. The standard is about 1100 pages,
> so it contains most of of the stuff you would expect, string handling,
>


You seem to confuse the language Common Lisp with the mathematical
concept Lisp. Lisp is seven operators and a one-page denotional semantic
definition. That's about as small and core as it gets.

--
Ola Bini (http://ola-bini.blogspot.com)
JvYAML, RbYAML, JRuby and Jatha contributor
System Developer, Karolinska Institutet (http://www.ki.se)
OLogix Consulting (http://www.ologix.com)

"Yields falsehood when quined" yields falsehood when quined.



 
Reply With Quote
 
Kristof Bastiaensen
Guest
Posts: n/a
 
      08-06-2006
On Mon, 07 Aug 2006 01:51:08 +0900, M. Edward (Ed) Borasky wrote:

> <snipped>
> A long time ago some computer scientist defined two types of languages
> -- "core" languages and "shell" languages. Lisp, Scheme and Forth are
> great examples of core languages ... just a few simple core concepts
> from which you can build mighty software. And the classic shell
> languages are PL/I and Ada ... just about anything you'd ever want to do
> is built into the language.


Lisp is definitely not a core language. The standard is about 1100 pages,
so it contains most of of the stuff you would expect, string handling,
arrays, hashes, math functions, etc... Scheme is probably more what you
would call a core language. There are documents (SRFI's) that describe
common implementations for libraries, but scheme implementations don't
have to use them to be called scheme.

Kristof
 
Reply With Quote
 
M. Edward (Ed) Borasky
Guest
Posts: n/a
 
      08-06-2006
wrote:
>
> Whoops, I was wrong; it was 1993. See
> http://blade.nagaokaut.ac.jp/cgi-bin.../ruby-talk/382

Thanks!! In February of 1993, I was just starting on the project that
has consumed most of my "paid programming" time since then. It started
out as Korn shell augmented with "gawk" for the more complicated pieces,
then got migrated to Perl 4 as soon as I discovered Perl 4. It picked up
the R component about 2000, but it's still mostly Perl 4. The Java 1.1
program was done in 1997.

So, going back to another thread, it looks like the "core language" of
Ruby is the object model and the Perl features. Is there by any chance a
place where I could get the Ruby 1.0 source? That might be *very*
interesting.

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Nice historical Musical - VERY RELAXING - about LISP history -fundamental ideas of LISP nanothermite911fbibustards C++ 0 06-16-2010 09:47 PM
pat-match.lisp or extend-match.lisp in Python? ekzept Python 0 08-10-2007 06:08 PM
the perens in lisp dilects is there for a reson... macros. atbusbook@aol.com Python 1 08-05-2006 04:30 PM
the perens in lisp dilects is there for a reson... macros. atbusbook@aol.com Perl Misc 0 08-05-2006 06:42 AM
Bruce Perens: The Emerging Economic Paradigm of Open Source Have A Nice Cup of Tea NZ Computing 0 04-12-2006 07:06 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57