Ask a Question related to Ruby, Design and Development.
-
Albert Chou #1
weird(?) thought about programming languages
This is a multi-part message in MIME format.
------_=_NextPart_001_01C3982A.667BB4DC
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
This thought isn't necessarily about Ruby specifically, though the
occasional wish expressed here that Ruby have Lisp-like macros added to
it resonates with it.
I've been reading Paul Graham's _On Lisp_ to finally learn what all this
talk of Lisp macros is about, and I've read enough (I'm into chapter 15
so far) to understand a lot of it, generally speaking. I spent some
time trying to understand how it might be possible to use macros to give
Lisp (or Scheme) a syntax that's easier for me to read (for instance, I
find most of the function names I've encountered in Common Lisp to be
pretty incomprehensible). I even came across a USENET posting from
about 1991 from a guy who had done that with Scheme, but I couldn't find
any more references or a way to contact him. Further searches of the
Web turned up another discussion about making Scheme need fewer
parentheses that finally taught me what I think is a core lesson about
language syntax: it's difficult, if not impossible, to change the
punctuation of a programming language using its own mechanisms. By
punctuation I mean how tokens are delimited/defined.
The discussion about making a less-parenthesized version of Scheme
concluded that you'd have to write a special-purpose reader (basically
parser, IIRC) to accomplish the task. Thus you can write as highly
abstracted and domain-specific a language as you like on top of
Lisp/Scheme, as long as you adhere to the way these parent languages
uses parentheses, whitespace, and alphanumeric characters to define
language tokens. Adding words (and even language constructs, in a
language that has macros) to a language's vocabulary is easy, but
redefining how to define words is impossible without stepping outside
the language. Of course, you could write a parser for your extended
language in the language you're extending, but my point is there's no
way to make a parser for the original language work with the extended
language if you violate the parent language's punctuation rules.
Whew, just wanted to say that somewhere that someone would understand
it. Comments welcome, but not necessary.
Al
--=20
Albert Davidson Chou, QA Manager
TeaLeaf Technology, Inc.
(415) 932-5031
[email]AChou@TeaLeaf.com[/email] | [url]http://www.TeaLeaf.com/[/url]
------_=_NextPart_001_01C3982A.667BB4DC
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; =
charset=3Diso-8859-1">
<META NAME=3D"Generator" CONTENT=3D"MS Exchange Server version =
6.0.4418.33">
<TITLE>weird(?) thought about programming languages</TITLE>
</HEAD>
<BODY>
<!-- Converted from text/plain format -->
<P><FONT SIZE=3D2>This thought isn't necessarily about Ruby =
specifically, though the occasional wish expressed here that Ruby have =
Lisp-like macros added to it resonates with it.</FONT></P>
<P><FONT SIZE=3D2>I've been reading Paul Graham's _On Lisp_ to finally =
learn what all this talk of Lisp macros is about, and I've read enough =
(I'm into chapter 15 so far) to understand a lot of it, generally =
speaking. I spent some time trying to understand how it might be =
possible to use macros to give Lisp (or Scheme) a syntax that's easier =
for me to read (for instance, I find most of the function names I've =
encountered in Common Lisp to be pretty incomprehensible). I even =
came across a USENET posting from about 1991 from a guy who had done =
that with Scheme, but I couldn't find any more references or a way to =
contact him. Further searches of the Web turned up another =
discussion about making Scheme need fewer parentheses that finally =
taught me what I think is a core lesson about language syntax: =
it's difficult, if not impossible, to change the punctuation of a =
programming language using its own mechanisms. By punctuation I =
mean how tokens are delimited/defined.</FONT></P>
<P><FONT SIZE=3D2>The discussion about making a less-parenthesized =
version of Scheme concluded that you'd have to write a special-purpose =
reader (basically parser, IIRC) to accomplish the task. Thus you =
can write as highly abstracted and domain-specific a language as you =
like on top of Lisp/Scheme, as long as you adhere to the way these =
parent languages uses parentheses, whitespace, and alphanumeric =
characters to define language tokens. Adding words (and even =
language constructs, in a language that has macros) to a language's =
vocabulary is easy, but redefining how to define words is impossible =
without stepping outside the language. Of course, you could write =
a parser for your extended language in the language you're extending, =
but my point is there's no way to make a parser for the original =
language work with the extended language if you violate the parent =
language's punctuation rules.</FONT></P>
<P><FONT SIZE=3D2>Whew, just wanted to say that somewhere that someone =
would understand it. Comments welcome, but not necessary.</FONT>
</P>
<BR>
<P><FONT SIZE=3D2>Al</FONT>
<BR><FONT SIZE=3D2>-- </FONT>
<BR><FONT SIZE=3D2>Albert Davidson Chou, QA Manager</FONT>
<BR><FONT SIZE=3D2>TeaLeaf Technology, Inc.</FONT>
<BR><FONT SIZE=3D2>(415) 932-5031</FONT>
<BR><FONT SIZE=3D2>AChou@TeaLeaf.com | <A =
HREF=3D"http://www.TeaLeaf.com/">http://www.TeaLeaf.com/</A></FONT>
</P>
</BODY>
</HTML>
------_=_NextPart_001_01C3982A.667BB4DC--
Albert Chou Guest
-
Thought problem solved - not so sure...
Would anyone go look at: http://www.ourhealthclubandspa.com/index.new.html and write back and tell me if the middle column (with the ornament) is... -
freelance web programming, web site design,c programming, java programming, VERY Low Cost web design and more
Find expert freelance programmers and designers at the prices you want to pay. Post your projects and programmers will place bids, you choose the... -
Company thought DB2 will be better than Oracle.
Company thought DB2 will be better than Oracle. The bottom line is when you do select, the system crash. I think it may take 4-5 years for DB2 to... -
matz: Which programming languages are you capable of?
It's just, I'm rather interested in different kinds of p-languages and concepts. And somehow I wnat to know which of them have influenced you in... -
This problem might be harder than I thought...
Once news group could not figure this out. I must be overlooking something but I am sure there is somebody that can answer this question. Check... -
James Britt #2
Re: weird(?) thought about programming languages
Albert Chou wrote:
I tried reading that, but after about three or four chapters I decided I> This thought isn't necessarily about Ruby specifically, though the
> occasional wish expressed here that Ruby have Lisp-like macros added to
> it resonates with it.
>
> I've been reading Paul Graham's _On Lisp_ to finally learn what all this
> talk of Lisp macros is about, and I've read enough (I'm into chapter 15
> so far) to understand a lot of it, generally speaking.
didn't know enough Lisp to follow along. :)
But I was motivated by the same reason, to better understand macros.
I spent some>There was some similar discussion here about implementing a syntax in> time trying to understand how it might be possible to use macros to give
> Lisp (or Scheme) a syntax that's easier for me to read (for instance, I
> find most of the function names I've encountered in Common Lisp to be
> pretty incomprehensible). I even came across a USENET posting from
> about 1991 from a guy who had done that with Scheme, but I couldn't find
> any more references or a way to contact him. Further searches of the
> Web turned up another discussion about making Scheme need fewer
> parentheses that finally taught me what I think is a core lesson about
> language syntax: it's difficult, if not impossible, to change the
> punctuation of a programming language using its own mechanisms. By
> punctuation I mean how tokens are delimited/defined.
Ruby that would allow one to manipulate XML using near-literal XPath
syntax (along the lines of ECMAScript and E4X).
I believe Phil Thomson has done some work creating a meta-language in>
> The discussion about making a less-parenthesized version of Scheme
> concluded that you'd have to write a special-purpose reader (basically
> parser, IIRC) to accomplish the task. Thus you can write as highly
> abstracted and domain-specific a language as you like on top of
> Lisp/Scheme, as long as you adhere to the way these parent languages
> uses parentheses, whitespace, and alphanumeric characters to define
> language tokens. Adding words (and even language constructs, in a
> language that has macros) to a language's vocabulary is easy, but
> redefining how to define words is impossible without stepping outside
> the language. Of course, you could write a parser for your extended
> language in the language you're extending, but my point is there's no
> way to make a parser for the original language work with the extended
> language if you violate the parent language's punctuation rules.
Ruby to allow QA/testers to write and run scripts that are, techincally,
Ruby, but do not require any profound understanding of Ruby's nuts and
bolts. (And Ruby itself is a meta-language on top of C.)
That sort of thing, as well as Graham's On Lisp macro stuff, is along
the lines of "build a language, not an application."[0]
James
[0] [url]http://www.pragmaticprogrammer.com/ppllc/papers/1998_03.html[/url]
James Britt Guest
-
Phil Tomson #3
Re: weird(?) thought about programming languages
In article <3F95D220.7070906@seemyemail.com>,
James Britt <jamesUNDERBARb@seemyemail.com> wrote:It was a hardware description language (RHDL). Basically I just took>Albert Chou wrote:
>
>I believe Phil Thomson has done some work creating a meta-language in
>Ruby to allow QA/testers to write and run scripts that are, techincally,
>Ruby, but do not require any profound understanding of Ruby's nuts and
>bolts. (And Ruby itself is a meta-language on top of C.)
advantage of how easy it is to pass code blocks around in Ruby and used
that feature to create a domain-specific language without having to write
a special parser.
Phil
Phil Tomson Guest
-
Chris Pine #4
Re: weird(?) thought about programming languages
If a language included its own parser as an object in the language, then you
could do it... in a way, I think.
As far as I know, no language goes that far, yet.
Chris
Chris Pine Guest
-
Phil Tomson #5
Re: weird(?) thought about programming languages
In article <048601c398ae$0ffd5d20$6501a8c0@blender>,
Chris Pine <cpine@hellotree.com> wrote:It would be tremendously cool if Ruby included access to it's own parser>If a language included its own parser as an object in the language, then you
>could do it... in a way, I think.
>
>As far as I know, no language goes that far, yet.
>
as an object/module.
Phil
Phil Tomson Guest
-
Albert Chou #6
Re: weird(?) thought about programming languages
This is a multi-part message in MIME format.
------_=_NextPart_001_01C398BD.8FD9B9BC
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
I remember someone touting REBOL's built-in parsing capability. I have
no idea whether it's powerful enough to parse REBOL code itself.
Neat thought!
Al
-----Original Message-----
From: Chris Pine [mailto:cpine@hellotree.com]
Sent: Wednesday, October 22, 2003 8:05 AM
To: ruby-talk ML
Subject: Re: weird(?) thought about programming languages
If a language included its own parser as an object in the language, then
you
could do it... in a way, I think.
As far as I know, no language goes that far, yet.
Chris
------_=_NextPart_001_01C398BD.8FD9B9BC
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; =
charset=3Diso-8859-1">
<META NAME=3D"Generator" CONTENT=3D"MS Exchange Server version =
6.0.4418.33">
<TITLE>RE: weird(?) thought about programming languages</TITLE>
</HEAD>
<BODY>
<!-- Converted from text/plain format -->
<P><FONT SIZE=3D2>I remember someone touting REBOL's built-in parsing =
capability. I have no idea whether it's powerful enough to parse =
REBOL code itself.</FONT></P>
<P><FONT SIZE=3D2>Neat thought!</FONT>
</P>
<BR>
<P><FONT SIZE=3D2>Al</FONT>
</P>
<BR>
<P><FONT SIZE=3D2>-----Original Message-----</FONT>
<BR><FONT SIZE=3D2>From: Chris Pine [<A =
HREF=3D"mailto:cpine@hellotree.com">mailto:cpine@h ellotree.com</A>]</FONT=<BR><FONT SIZE=3D2>Sent: Wednesday, October 22, 2003 8:05 AM</FONT>>
<BR><FONT SIZE=3D2>To: ruby-talk ML</FONT>
<BR><FONT SIZE=3D2>Subject: Re: weird(?) thought about programming =
languages</FONT>
</P>
<P><FONT SIZE=3D2>If a language included its own parser as an object in =
the language, then you</FONT>
<BR><FONT SIZE=3D2>could do it... in a way, I think.</FONT>
</P>
<P><FONT SIZE=3D2>As far as I know, no language goes that far, =
yet.</FONT>
</P>
<P><FONT SIZE=3D2>Chris</FONT>
</P>
</BODY>
</HTML>
------_=_NextPart_001_01C398BD.8FD9B9BC--
Albert Chou Guest
-
Albert Chou #7
Re: weird(?) thought about programming languages
This is a multi-part message in MIME format.
------_=_NextPart_001_01C398BE.E80A146E
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
I remembered that test language that defined a lot of new
keywords-as-symbols for testing, though not its author. I'd love to do
that here, but I don't (yet?) have approval to use Ruby as the base
language for the test harness (I do have it in there as a tool for
as-needed use, though, and have written a few tools for the harness with
it). I skipped most of the native-XML thread here, so sorry for the
duplication.
Al
-----Original Message-----
From: James Britt [mailto:jamesUNDERBARb@seemyemail.com]
Sent: Tuesday, October 21, 2003 5:40 PM
To: ruby-talk ML
Subject: Re: weird(?) thought about programming languages
Albert Chou wrote:
to> This thought isn't necessarily about Ruby specifically, though the
> occasional wish expressed here that Ruby have Lisp-like macros addedthis> it resonates with it.
>=20
> I've been reading Paul Graham's _On Lisp_ to finally learn what all15> talk of Lisp macros is about, and I've read enough (I'm into chapterI tried reading that, but after about three or four chapters I decided I> so far) to understand a lot of it, generally speaking. =20
didn't know enough Lisp to follow along. :)
But I was motivated by the same reason, to better understand macros.
I spent some>give> time trying to understand how it might be possible to use macros toI> Lisp (or Scheme) a syntax that's easier for me to read (for instance,find> find most of the function names I've encountered in Common Lisp to be
> pretty incomprehensible). I even came across a USENET posting from
> about 1991 from a guy who had done that with Scheme, but I couldn'tThere was some similar discussion here about implementing a syntax in=20> any more references or a way to contact him. Further searches of the
> Web turned up another discussion about making Scheme need fewer
> parentheses that finally taught me what I think is a core lesson about
> language syntax: it's difficult, if not impossible, to change the
> punctuation of a programming language using its own mechanisms. By
> punctuation I mean how tokens are delimited/defined.
Ruby that would allow one to manipulate XML using near-literal XPath=20
syntax (along the lines of ECMAScript and E4X).
I believe Phil Thomson has done some work creating a meta-language in=20>=20
> The discussion about making a less-parenthesized version of Scheme
> concluded that you'd have to write a special-purpose reader (basically
> parser, IIRC) to accomplish the task. Thus you can write as highly
> abstracted and domain-specific a language as you like on top of
> Lisp/Scheme, as long as you adhere to the way these parent languages
> uses parentheses, whitespace, and alphanumeric characters to define
> language tokens. Adding words (and even language constructs, in a
> language that has macros) to a language's vocabulary is easy, but
> redefining how to define words is impossible without stepping outside
> the language. Of course, you could write a parser for your extended
> language in the language you're extending, but my point is there's no
> way to make a parser for the original language work with the extended
> language if you violate the parent language's punctuation rules.
Ruby to allow QA/testers to write and run scripts that are, techincally,
Ruby, but do not require any profound understanding of Ruby's nuts and=20
bolts. (And Ruby itself is a meta-language on top of C.)
That sort of thing, as well as Graham's On Lisp macro stuff, is along=20
the lines of "build a language, not an application."[0]
James
[0] [url]http://www.pragmaticprogrammer.com/ppllc/papers/1998_03.html[/url]
------_=_NextPart_001_01C398BE.E80A146E
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; =
charset=3Diso-8859-1">
<META NAME=3D"Generator" CONTENT=3D"MS Exchange Server version =
6.0.4418.33">
<TITLE>RE: weird(?) thought about programming languages</TITLE>
</HEAD>
<BODY>
<!-- Converted from text/plain format -->
<P><FONT SIZE=3D2>I remembered that test language that defined a lot of =
new keywords-as-symbols for testing, though not its author. I'd =
love to do that here, but I don't (yet?) have approval to use Ruby as =
the base language for the test harness (I do have it in there as a tool =
for as-needed use, though, and have written a few tools for the harness =
with it). I skipped most of the native-XML thread here, so sorry =
for the duplication.</FONT></P>
<P><FONT SIZE=3D2>Al</FONT>
</P>
<BR>
<P><FONT SIZE=3D2>-----Original Message-----</FONT>
<BR><FONT SIZE=3D2>From: James Britt [<A =
HREF=3D"mailto:jamesUNDERBARb@seemyemail.com">mail to:jamesUNDERBARb@seemy=
email.com</A>]</FONT>
<BR><FONT SIZE=3D2>Sent: Tuesday, October 21, 2003 5:40 PM</FONT>
<BR><FONT SIZE=3D2>To: ruby-talk ML</FONT>
<BR><FONT SIZE=3D2>Subject: Re: weird(?) thought about programming =
languages</FONT>
</P>
<P><FONT SIZE=3D2>Albert Chou wrote:</FONT>
</P>
<P><FONT SIZE=3D2>> This thought isn't necessarily about Ruby =
specifically, though the</FONT>
<BR><FONT SIZE=3D2>> occasional wish expressed here that Ruby have =
Lisp-like macros added to</FONT>
<BR><FONT SIZE=3D2>> it resonates with it.</FONT>
<BR><FONT SIZE=3D2>> </FONT>
<BR><FONT SIZE=3D2>> I've been reading Paul Graham's _On Lisp_ to =
finally learn what all this</FONT>
<BR><FONT SIZE=3D2>> talk of Lisp macros is about, and I've read =
enough (I'm into chapter 15</FONT>
<BR><FONT SIZE=3D2>> so far) to understand a lot of it, generally =
speaking. </FONT>
</P>
<P><FONT SIZE=3D2>I tried reading that, but after about three or four =
chapters I decided I </FONT>
<BR><FONT SIZE=3D2>didn't know enough Lisp to follow along. :)</FONT>
</P>
<P><FONT SIZE=3D2>But I was motivated by the same reason, to better =
understand macros.</FONT>
</P>
<P><FONT SIZE=3D2> ></FONT>
<BR><FONT SIZE=3D2>I spent some</FONT>
<BR><FONT SIZE=3D2>> time trying to understand how it might be =
possible to use macros to give</FONT>
<BR><FONT SIZE=3D2>> Lisp (or Scheme) a syntax that's easier for me =
to read (for instance, I</FONT>
<BR><FONT SIZE=3D2>> find most of the function names I've encountered =
in Common Lisp to be</FONT>
<BR><FONT SIZE=3D2>> pretty incomprehensible). I even came =
across a USENET posting from</FONT>
<BR><FONT SIZE=3D2>> about 1991 from a guy who had done that with =
Scheme, but I couldn't find</FONT>
<BR><FONT SIZE=3D2>> any more references or a way to contact =
him. Further searches of the</FONT>
<BR><FONT SIZE=3D2>> Web turned up another discussion about making =
Scheme need fewer</FONT>
<BR><FONT SIZE=3D2>> parentheses that finally taught me what I think =
is a core lesson about</FONT>
<BR><FONT SIZE=3D2>> language syntax: it's difficult, if not =
impossible, to change the</FONT>
<BR><FONT SIZE=3D2>> punctuation of a programming language using its =
own mechanisms. By</FONT>
<BR><FONT SIZE=3D2>> punctuation I mean how tokens are =
delimited/defined.</FONT>
</P>
<P><FONT SIZE=3D2>There was some similar discussion here about =
implementing a syntax in </FONT>
<BR><FONT SIZE=3D2>Ruby that would allow one to manipulate XML using =
near-literal XPath </FONT>
<BR><FONT SIZE=3D2>syntax (along the lines of ECMAScript and =
E4X).</FONT>
</P>
<P><FONT SIZE=3D2>> </FONT>
<BR><FONT SIZE=3D2>> The discussion about making a less-parenthesized =
version of Scheme</FONT>
<BR><FONT SIZE=3D2>> concluded that you'd have to write a =
special-purpose reader (basically</FONT>
<BR><FONT SIZE=3D2>> parser, IIRC) to accomplish the task. Thus =
you can write as highly</FONT>
<BR><FONT SIZE=3D2>> abstracted and domain-specific a language as you =
like on top of</FONT>
<BR><FONT SIZE=3D2>> Lisp/Scheme, as long as you adhere to the way =
these parent languages</FONT>
<BR><FONT SIZE=3D2>> uses parentheses, whitespace, and alphanumeric =
characters to define</FONT>
<BR><FONT SIZE=3D2>> language tokens. Adding words (and even =
language constructs, in a</FONT>
<BR><FONT SIZE=3D2>> language that has macros) to a language's =
vocabulary is easy, but</FONT>
<BR><FONT SIZE=3D2>> redefining how to define words is impossible =
without stepping outside</FONT>
<BR><FONT SIZE=3D2>> the language. Of course, you could write a =
parser for your extended</FONT>
<BR><FONT SIZE=3D2>> language in the language you're extending, but =
my point is there's no</FONT>
<BR><FONT SIZE=3D2>> way to make a parser for the original language =
work with the extended</FONT>
<BR><FONT SIZE=3D2>> language if you violate the parent language's =
punctuation rules.</FONT>
</P>
<P><FONT SIZE=3D2>I believe Phil Thomson has done some work creating a =
meta-language in </FONT>
<BR><FONT SIZE=3D2>Ruby to allow QA/testers to write and run scripts =
that are, techincally, </FONT>
<BR><FONT SIZE=3D2>Ruby, but do not require any profound understanding =
of Ruby's nuts and </FONT>
<BR><FONT SIZE=3D2>bolts. (And Ruby itself is a meta-language on top of =
C.)</FONT>
</P>
<P><FONT SIZE=3D2>That sort of thing, as well as Graham's On Lisp macro =
stuff, is along </FONT>
<BR><FONT SIZE=3D2>the lines of "build a language, not an =
application."[0]</FONT>
</P>
<P><FONT SIZE=3D2>James</FONT>
</P>
<P><FONT SIZE=3D2>[0] <A =
HREF=3D"http://www.pragmaticprogrammer.com/ppllc/papers/1998_03.html">htt=
p://www.pragmaticprogrammer.com/ppllc/papers/1998_03.html</A></FONT>
</P>
</BODY>
</HTML>
------_=_NextPart_001_01C398BE.E80A146E--
Albert Chou Guest
-
Aaron Son #8
Re: weird(?) thought about programming languages
On 2003-10-22, Chris Pine <cpine@hellotree.com> wrote:
Smalltalk has late-bound mutable classes, and the class responsible for> If a language included its own parser as an object in the language, then you
> could do it... in a way, I think.
>
> As far as I know, no language goes that far, yet.
parsing is written in Smalltalk.
--Aaron
Aaron Son Guest
-
Col #9
Re: weird(?) thought about programming languages
> I remember someone touting REBOL's built-in parsing capability. I have
It's been done:> no idea whether it's powerful enough to parse REBOL code itself.
>
> Neat thought!
[url]http://www.rebol.org/cgi-bin/cgiwrap/rebol/view-script.r?script=parse-code.r[/url]
Col
Col Guest



Reply With Quote

