Re: [stack] Introducing the Om language
Jason Erb <[email protected]> Sat, 5 Jan 2013 11:39:14 -0800 (PST)
| Newsgroups | gmane.comp.lang.concatenative |
|---|---|
| Message-ID | <[email protected]> |
--u1k0J4D79rs6kfQe1ugIlPtc8rq-UYvO6OGhRl5
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
William,
Thanks for the in-depth questions. =A0Discussions like this are extremely h=
elpful in figuring out what I need to explain better in the documentation.
> It took me a long time to figure out your syntax... The graph makes
the least elementary part of the language (the escape codes) look like
the primary, and hides everything else. Do those escape codes do
anything?
I'll try to explain this better. =A0I think that by "escape codes" you are =
referring to the characters in an operator, which may be escaped.
An operator is any UTF-8 string. =A0However, some characters need to be esc=
aped with a backquote - these include space, tab, and new line (because the=
se are separator characters), curly braces (because these enclose operands)=
, and backquotes (because this is the escape character). =A0Any other chara=
cter can be escaped with a backquote, but this is a no-op (e.g. "`o`p`e`r`a=
`t`o`r" resolves to "operator"). Some examples of valid operators:
operator
>
>
>`o`p`e`r`a`t`o`r
>
>
>an` operator
>
>
>an` operator` with` `{braces`}
>an` operator` with` a`
>new` line
A separator is any string comprised of the space, tab and/or new line chara=
cters.
An operand is any program (made of operators, operands, and separators), en=
closed in curly braces.
Please let me know if that is more clear, and I'll update the documentation=
accordingly.
> Aside from that: I see that a valid program will begin with a dequoted
symbol, and everything else will be quoted. That means that
concatenating two valid programs does NOT produce a syntactically
valid program, and thus the language is not concatenative. But I'm
still confused by the syntax, so maybe I'm wrong.
A valid program can start with a separator, operator, or operand. =A0Any tw=
o programs can be concatenated to form another valid program. =A0Again, sor=
ry if this is confusing.
> What is a "function"? I mean that question linguistically -- you
haven't mentioned the term before. Is a "function" denoted by an
"operator"? You also haven't explained "input"; I assume that the
"input" is what you call the "operand". That's definitely arguably
"the rest of the program", since a "program" has only three elements
and the other two are very simple; but it's definitely at that point a
VERY hard-line applicative language.
An operation is a function that takes a program as a parameter and returns =
a program. =A0Operations don't exist in the "language domain"; they are par=
t of the evaluation implementation rather than the syntax.
Every program evaluates to an operation. =A0Every program is a concatenatio=
n of sub-programs, which each evaluate to operations. =A0Evaluation of an o=
peration can be though of in two equivalent ways:
- An "application": the program to the right of the operation is passed to =
the operation as an argument.
- A "composition": the operation composed with the operation defined by the=
program to the right of the operation.
As such, I consider Om to be a concatenative language.
The most atomic programs are ones comprised of a single operator, operand, =
or separator (not inside another operand):
- Operators evaluate to natively-implemented operations. =A0Operators that =
don't map to an implemented operation evaluate to an operation that returns=
the program comprised of the operator and all that follows it. =A0For exam=
ple: "copy" evaluates to an operation that takes a program (the program to =
its right) and returns a program with the first operand replaced with 2 of =
itself. =A0The operator "tanksley" doesn't have an operation implemented fo=
r it, so it evaluates to an operation that returns a program comprised of t=
he operator "tanksley", followed by the program that was to its right.
- Operands evaluate to operations that return a program with the operand at=
the front, and everything to the right of the operand following. =A0"{oper=
and} ..." evaluates to "{operand} ...".
- Separators evaluate to operations that return the program with "normalize=
d" whitespace at the front.
Each natively-implemented operation (i.e. an operator definition) is only p=
ermitted to manipulate operands at the top of the argument program. =A0Sepa=
rators are ignored by the operation, and an operator indicates the end of t=
he operands that the operation can use. =A0For example, "copy swap" results=
in
copy
swap
but "copy {A} swap" results in
{A}{A}
swap
If you have any questions about the above, please ask. =A0If there are any =
changes I could make to the documentation to make this easier to understand=
, please let me know.
Thanks,
Jason
[Non-text portions of this message have been removed]
--u1k0J4D79rs6kfQe1ugIlPtc8rq-UYvO6OGhRl5
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/htm=
l4/strict.dtd">
<html>
<head>
</head>
<body style=3D"background-color: #fff;">
<span style=3D"display:none"> </span>
<!--~-|**|PrettyHtmlStartT|**|-~-->
<div id=3D"ygrp-mlmsg" style=3D"position:relative;">
<div id=3D"ygrp-msg" style=3D"z-index: 1;">
<!--~-|**|PrettyHtmlEndT|**|-~-->
<div id=3D"ygrp-text" >
=20=20=20=20=20=20
=20=20=20=20=20=20
<p>William,<br>
<br>
Thanks for the in-depth questions. =A0Discussions like this are extremely h=
elpful in figuring out what I need to explain better in the documentation.<=
br>
<br>
> It took me a long time to figure out your syntax... The graph makes<br=
>
the least elementary part of the language (the escape codes) look like<br>
the primary, and hides everything else. Do those escape codes do<br>
anything?<br>
<br>
I'll try to explain this better. =A0I think that by "escape codes&=
quot; you are referring to the characters in an operator, which may be esca=
ped.<br>
<br>
An operator is any UTF-8 string. =A0However, some characters need to be esc=
aped with a backquote - these include space, tab, and new line (because the=
se are separator characters), curly braces (because these enclose operands)=
, and backquotes (because this is the escape character). =A0Any other chara=
cter can be escaped with a backquote, but this is a no-op (e.g. "`o`p`=
e`r`a`t`o`r" resolves to "operator"). Some examples of valid=
operators:<br>
operator<br>
><br>
><br>
>`o`p`e`r`a`t`o`r<br>
><br>
><br>
>an` operator<br>
><br>
><br>
>an` operator` with` `{braces`}<br>
>an` operator` with` a`<br>
>new` line<br>
<br>
A separator is any string comprised of the space, tab and/or new line chara=
cters.<br>
<br>
An operand is any program (made of operators, operands, and separators), en=
closed in curly braces.<br>
<br>
Please let me know if that is more clear, and I'll update the documenta=
tion accordingly.<br>
<br>
> Aside from that: I see that a valid program will begin with a dequoted=
<br>
symbol, and everything else will be quoted. That means that<br>
concatenating two valid programs does NOT produce a syntactically<br>
valid program, and thus the language is not concatenative. But I'm<br>
still confused by the syntax, so maybe I'm wrong.<br>
<br>
A valid program can start with a separator, operator, or operand. =A0Any tw=
o programs can be concatenated to form another valid program. =A0Again, sor=
ry if this is confusing.<br>
<br>
> What is a "function"? I mean that question linguistically --=
you<br>
haven't mentioned the term before. Is a "function" denoted by=
an<br>
"operator"? You also haven't explained "input"; I a=
ssume that the<br>
"input" is what you call the "operand". That's defi=
nitely arguably<br>
"the rest of the program", since a "program" has only t=
hree elements<br>
and the other two are very simple; but it's definitely at that point a<=
br>
VERY hard-line applicative language.<br>
<br>
An operation is a function that takes a program as a parameter and returns =
a program. =A0Operations don't exist in the "language domain"=
; they are part of the evaluation implementation rather than the syntax.<br=
>
<br>
Every program evaluates to an operation. =A0Every program is a concatenatio=
n of sub-programs, which each evaluate to operations. =A0Evaluation of an o=
peration can be though of in two equivalent ways:<br>
- An "application": the program to the right of the operation is =
passed to the operation as an argument.<br>
- A "composition": the operation composed with the operation defi=
ned by the program to the right of the operation.<br>
<br>
As such, I consider Om to be a concatenative language.<br>
<br>
The most atomic programs are ones comprised of a single operator, operand, =
or separator (not inside another operand):<br>
<br>
- Operators evaluate to natively-implemented operations. =A0Operators that =
don't map to an implemented operation evaluate to an operation that ret=
urns the program comprised of the operator and all that follows it. =A0For =
example: "copy" evaluates to an operation that takes a program (t=
he program to its right) and returns a program with the first operand repla=
ced with 2 of itself. =A0The operator "tanksley" doesn't have=
an operation implemented for it, so it evaluates to an operation that retu=
rns a program comprised of the operator "tanksley", followed by t=
he program that was to its right.<br>
<br>
- Operands evaluate to operations that return a program with the operand at=
the front, and everything to the right of the operand following. =A0"=
{operand} ..." evaluates to "{operand} ...".<br>
<br>
- Separators evaluate to operations that return the program with "norm=
alized" whitespace at the front.<br>
<br>
Each natively-implemented operation (i.e. an operator definition) is only p=
ermitted to manipulate operands at the top of the argument program. =A0Sepa=
rators are ignored by the operation, and an operator indicates the end of t=
he operands that the operation can use. =A0For example, "copy swap&quo=
t; results in<br>
<br>
copy<br>
swap<br>
but "copy {A} swap" results in<br>
<br>
{A}{A}<br>
swap<br>
<br>
If you have any questions about the above, please ask. =A0If there are any =
changes I could make to the documentation to make this easier to understand=
, please let me know.<br>
<br>
Thanks,<br>
Jason<br>
<br>
[Non-text portions of this message have been removed]<br>
<br>
</p>
</div>
=20=20=20=20=20
<!--~-|**|PrettyHtmlStart|**|-~-->
<div style=3D"color: #fff; height: 0;">__._,_.___</div>
=20=20=20=20=20=20=20=20
=20=20
=20=20
<table cellspacing=3D4px style=3D"margin-top: 20px; margin-bottom: 10px=
;">
<tbody>
<tr>
<td style=3D"font-size: 12px; font-family: arial; font-weight: bo=
ld; padding: 7px 5px 5px; color: #FFF; background-color: #F2F2F2; border: 1=
px solid #EAEAEA " >
<a style=3D"text-decoration: none; color: #2D50FD=
" href=3D"http://groups.yahoo.com/group/concatenative/post;_ylc=3DX3oDMTJwa=
Wl0aTFzBF9TAzk3MzU5NzE0BGdycElkAzE4MzkyNzQEZ3Jwc3BJZAMxNzA1MDA2NzY0BG1zZ0lk=
AzQ5MzcEc2VjA2Z0cgRzbGsDcnBseQRzdGltZQMxMzU3NDE0NzU3?act=3Dreply&messageNum=
=3D4937">Reply via web post</a>
</td>
<td style=3D"font-size: 12px; font-family: arial; padding: 7px 5p=
x 5px; color: #FFF; background-color: #F2F2F2; border: 1px solid #EAEAEA; "=
>
<a href=3D"mailto:[email protected]?subject=3DRe%3A%20%5Bst=
ack%5D%20Introducing%20the%20Om%20language" style=3D"text-decoration: none;=
color: #2D50FD;">
Reply to sender </a>=20
</td>
<td style=3D"font-size: 12px; font-family: arial; padding: 7px 5p=
x 5px; color: #FFF; background-color: #F2F2F2; border: 1px solid #EAEAEA; "=
>
<a href=3D"mailto:[email protected]?subject=3DRe%3A=
%20%5Bstack%5D%20Introducing%20the%20Om%20language" style=3D"text-decoratio=
n: none; color: #2D50FD">
Reply to group </a>=20
</td>
<td style=3D"font-size: 12px; font-family: arial; padding: 7px 5p=
x 5px; color: #FFF; background-color: #F2F2F2; border: 1px solid #EAEAEA; "=
>
<a href=3D"http://groups.yahoo.com/group/concatenative/post;_yl=
c=3DX3oDMTJlNmswdWhxBF9TAzk3MzU5NzE0BGdycElkAzE4MzkyNzQEZ3Jwc3BJZAMxNzA1MDA=
2NzY0BHNlYwNmdHIEc2xrA250cGMEc3RpbWUDMTM1NzQxNDc1Nw--" style=3D"text-decora=
tion: none; color: #2D50FD">Start a New Topic</a>
</td>
<td style=3D"font-size: 12px; font-family: arial; padding: 7px 5p=
x 5px; color: #2D50FD; background-color: #F2F2F2; border: 1px solid #EAEAEA=
; " >
<a href=3D"http://groups.yahoo.com/group/concat=
enative/message/4933;_ylc=3DX3oDMTM0cGJwMnZhBF9TAzk3MzU5NzE0BGdycElkAzE4Mzk=
yNzQEZ3Jwc3BJZAMxNzA1MDA2NzY0BG1zZ0lkAzQ5MzcEc2VjA2Z0cgRzbGsDdnRwYwRzdGltZQ=
MxMzU3NDE0NzU3BHRwY0lkAzQ5MzM-" style=3D"text-decoration: none; color: #2D5=
0FD;">Messages in this topic</a>
(5)
</td>
</tr>
</tbody>
</table>
=20=20=20=20=20=20=20=20
<!------- Start Nav Bar ------>
<!-- |**|begin egp html banner|**| -->
<div id=3D"ygrp-vital" style=3D"background-color: #f2f2f2; font-family: Ver=
dana; font-size: 10px; margin-bottom: 10px; padding: 10px;">
<span id=3D"vithd" style=3D"font-weight: bold; color: #333; text-tran=
sform: uppercase; ">Recent Activity:</span>
<ul style=3D"list-style-type: none; margin: 0; padding: 0; display: inl=
ine;">
</ul>
=20=20=20=20
<div style=3D"clear: both; padding-top: 2px; color: #1e66ae;">
<a href=3D"http://groups.yahoo.com/group/concatenative;_ylc=3DX3oDMTJlb=
zhiZDRlBF9TAzk3MzU5NzE0BGdycElkAzE4MzkyNzQEZ3Jwc3BJZAMxNzA1MDA2NzY0BHNlYwN2=
dGwEc2xrA3ZnaHAEc3RpbWUDMTM1NzQxNDc1Nw--" style=3D"text-decoration: none;">=
Visit Your Group</a>
</div>
</div>
=20=20
<div id=3D"ft" style=3D"font-family: Arial; font-size: 11px; margin-top: 5p=
x; padding: 0 2px 0 0; clear: both;">
<a href=3D"http://groups.yahoo.com/;_ylc=3DX3oDMTJkNmtpY2NxBF9TAzk3MzU5Nz=
E0BGdycElkAzE4MzkyNzQEZ3Jwc3BJZAMxNzA1MDA2NzY0BHNlYwNmdHIEc2xrA2dmcARzdGltZ=
QMxMzU3NDE0NzU3" style=3D"float: left;"><img src=3D"http://l.yimg.com/a/i/u=
s/yg/logo/us.gif" height=3D"15" width=3D"137" alt=3D"Yahoo! Groups" style=
=3D"border: 0;"/></a>
<div style=3D"color: #747575; float: right;">Switch to: <a href=3D"mailto=
:[email protected]?subject=3DChange Delivery Format=
: Traditional" style=3D"text-decoration: none;">Text-Only</a>, <a href=3D"m=
ailto:[email protected]?subject=3DEmail Delivery: Digest=
" class=3D"margin-rt" style=3D"text-decoration: none;">Daily Digest</a> &bu=
ll; <a href=3D"mailto:[email protected]?subject=3DU=
nsubscribe" style=3D"text-decoration: none;">Unsubscribe</a> • <a href=
=3D"http://docs.yahoo.com/info/terms/" style=3D"text-decoration: none;">Ter=
ms of Use</a> • <a href=3D"mailto:[email protected]=
?subject=3DFeedback on the redesigned individual mail v1" style=3D"text-dec=
oration: none;">Send us Feedback </a></div>
</div>
<!-- |**|end egp html banner|**| -->
</div> <!-- ygrp-msg -->
<!-- Sponsor -->
<!-- |**|begin egp html banner|**| -->
<div id=3D"ygrp-sponsor" style=3D"width:160px; float:right; clear:none; m=
argin:0 0 25px 0; background: #fff;">
<!-- Start Recommendations -->
<div id=3D"ygrp-reco">
</div>
<!-- End Recommendations -->
</div> <!-- |**|end egp html banner|**| -->
<div style=3D"clear:both; color: #FFF; font-size:1px;">.</div>
</div>
<img src=3D"http://geo.yahoo.com/serv?s=3D97359714/grpId=3D1839274/grpspI=
d=3D1705006764/msgId=3D4937/stime=3D1357414757/nc1=3D3848640/nc2=3D4507179/=
nc3=3D5522131" width=3D"1" height=3D"1"> <br>
<div style=3D"color: #fff; height: 0;">__,_._,___</div>
<!--~-|**|PrettyHtmlEnd|**|-~-->
</body>
<!--~-|**|PrettyHtmlStart|**|-~-->
<head>
<style type=3D"text/css">
<!--
#ygrp-mkp {
border: 1px solid #d8d8d8;
font-family: Arial;
margin: 10px 0;
padding: 0 10px;
}
#ygrp-mkp hr {
border: 1px solid #d8d8d8;
}
#ygrp-mkp #hd {
color: #628c2a;
font-size: 85%;
font-weight: 700;
line-height: 122%;
margin: 10px 0;
}
#ygrp-mkp #ads {
margin-bottom: 10px;
}
#ygrp-mkp .ad {
padding: 0 0;
}
#ygrp-mkp .ad p {
margin: 0;
}
#ygrp-mkp .ad a {
color: #0000ff;
text-decoration: none;
}
#ygrp-sponsor #ygrp-lc {
font-family: Arial;
}
#ygrp-sponsor #ygrp-lc #hd {
margin: 10px 0px;
font-weight: 700;
font-size: 78%;
line-height: 122%;
}
#ygrp-sponsor #ygrp-lc .ad {
margin-bottom: 10px;
padding: 0 0;
}
#actions {
font-family: Verdana;
font-size: 11px;
padding: 10px 0;
}
#activity {
background-color: #e0ecee;
float: left;
font-family: Verdana;
font-size: 10px;
padding: 10px;
}
#activity span {
font-weight: 700;
}
#activity span:first-child {
text-transform: uppercase;
}
#activity span a {
color: #5085b6;
text-decoration: none;
}
#activity span span {
color: #ff7900;
}
#activity span .underline {
text-decoration: underline;
}
.attach {
clear: both;
display: table;
font-family: Arial;
font-size: 12px;
padding: 10px 0;
width: 400px;
}
.attach div a {
text-decoration: none;
}
.attach img {
border: none;
padding-right: 5px;
}
.attach label {
display: block;
margin-bottom: 5px;
}
.attach label a {
text-decoration: none;
}
=20=20
blockquote {
margin: 0 0 0 4px;
}
.bold {
font-family: Arial;
font-size: 13px;
font-weight: 700;
}
.bold a {
text-decoration: none;
}
dd.last p a {
font-family: Verdana;
font-weight: 700;
}
dd.last p span {
margin-right: 10px;
font-family: Verdana;
font-weight: 700;
}
dd.last p span.yshortcuts {
margin-right: 0;
}
div.attach-table div div a {
text-decoration: none;
}
div.attach-table {
width: 400px;
}
div.file-title a, div.file-title a:active, div.file-title a:hover, div.fi=
le-title a:visited {
text-decoration: none;
}
div.photo-title a, div.photo-title a:active, div.photo-title a:hover, div=
.photo-title a:visited {
text-decoration: none;
}
div#ygrp-mlmsg #ygrp-msg p a span.yshortcuts {
font-family: Verdana;
font-size: 10px;
font-weight: normal;
}
.green {
color: #628c2a;
}
.MsoNormal {
margin: 0 0 0 0;
}
o {
font-size: 0;
}
#photos div {
float: left;
width: 72px;
}
#photos div div {
border: 1px solid #666666;
height: 62px;
overflow: hidden;
width: 62px;
}
#photos div label {
color: #666666;
font-size: 10px;
overflow: hidden;
text-align: center;
white-space: nowrap;
width: 64px;
}
#reco-category {
font-size: 77%;
}
#reco-desc {
font-size: 77%;
}
.replbq {
margin: 4px;
}
#ygrp-actbar div a:first-child {
/* border-right: 0px solid #000;*/
margin-right: 2px;
padding-right: 5px;
}
#ygrp-mlmsg {
font-size: 13px;
font-family: Arial, helvetica,clean, sans-serif;
*font-size: small;
*font: x-small;
}
#ygrp-mlmsg table {
font-size: inherit;
font: 100%;
}
#ygrp-mlmsg select, input, textarea {
font: 99% Arial, Helvetica, clean, sans-serif;
}
#ygrp-mlmsg pre, code {
font:115% monospace;
*font-size:100%;
}
#ygrp-mlmsg * {
line-height: 1.22em;
}
#ygrp-mlmsg #logo {
padding-bottom: 10px;
}
#ygrp-msg p a {
font-family: Verdana;
}
#ygrp-msg p#attach-count span {
color: #1E66AE;
font-weight: 700;
}
#ygrp-reco #reco-head {
color: #ff7900;
font-weight: 700;
}
#ygrp-reco {
margin-bottom: 20px;
padding: 0px;
}
#ygrp-sponsor #ov li a {
font-size: 130%;
text-decoration: none;
}
#ygrp-sponsor #ov li {
font-size: 77%;
list-style-type: square;
padding: 6px 0;
}=20
#ygrp-sponsor #ov ul {
margin: 0;
padding: 0 0 0 8px;
}
#ygrp-text {
font-family: Georgia;
}
#ygrp-text p {
margin: 0 0 1em 0;
}
#ygrp-text tt {
font-size: 120%;
}
#ygrp-vital ul li:last-child {
border-right: none !important;=20
}=20
-->
</style>
</head>
<!--~-|**|PrettyHtmlEnd|**|-~-->
</html>
<!-- end group email -->
--u1k0J4D79rs6kfQe1ugIlPtc8rq-UYvO6OGhRl5--