# Introducing the Om language

## Jason Erb — 2013-01-03 06:22:22

    Dear Concatenativists,

    I've developed a unique concatenative language that I would like to share:

    http://om-language.org

    The goal was to find "God's programming language": the simplest language possible (mostly so that I could actually implement it) without sacrificing power (as contrasted with languages like Iota and Jot, which are fundamentally simple but don't have basics like named functions).  This led to concatenative languages, but Om has taken a few left turns where other concatenative languages have gone right:

    - An Om program has only three syntactic elements: operator, operand, and separator.

    - Om uses prefix syntax rather than postfix.

    - The only data type exposed by the language is a program.

    - Each function takes as input the rest of the program that it is in.

    There is more information on the design, and rationale, in the documentation at http://sparist.github.com/Om .  The language is in an early development stage, and the documentation is not as full as I would like yet -- there is much more to write, and I hope to find time to do so in the near future.

    Any feedback is welcome.  I expect that most of the readers of this list have far more experience in language design than I do.  If anyone would like to get involved in further development, or knows of anyone that would like to fund such an endeavour (long shot), please get in touch.

    If any administrators of http://concatenative.org are here, I would be honoured if you could add Om to the list of concatenative languages.

    Best regards,

    Jason Erb

    http://sparist.com

    [Non-text portions of this message have been removed]

## Ruurd — 2013-01-05 10:06:33

    Hi,

    It is nice to see some activity here. An impressive web site you have there. Makes me feel like an amateur. Now, about concatenative.org. I have managed to create a page for Om. After all, it is a wiki, so everybody can add or change or delete a page. But I have not been able to edit the contents page. I also do not get an error message, so I don't know why that is. Now, about the language Om. In get lost in the example of minutes. Can you show a trace of the individual steps during evaluation ?

    Rw

     --- In concatenative@yahoogroups.com, Jason Erb  wrote:

    >

    > Dear Concatenativists,

    >

    > I've developed a unique concatenative language that I would like to share:

    >

    > http://om-language.org

    >

    > The goal was to find "God's programming language": the simplest language possible (mostly so that I could actually implement it) without sacrificing power (as contrasted with languages like Iota and Jot, which are fundamentally simple but don't have basics like named functions).  This led to concatenative languages, but Om has taken a few left turns where other concatenative languages have gone right:

    > - An Om program has only three syntactic elements: operator, operand, and separator.

    > - Om uses prefix syntax rather than postfix.

    > - The only data type exposed by the language is a program.

    > - Each function takes as input the rest of the program that it is in.

    >

    > There is more information on the design, and rationale, in the documentation at http://sparist.github.com/Om .  The language is in an early development stage, and the documentation is not as full as I would like yet -- there is much more to write, and I hope to find time to do so in the near future.

    >

    >

    > Any feedback is welcome.  I expect that most of the readers of this list have far more experience in language design than I do.  If anyone would like to get involved in further development, or knows of anyone that would like to fund such an endeavour (long shot), please get in touch.

    >

    > If any administrators of http://concatenative.org are here, I would be honoured if you could add Om to the list of concatenative languages.

    >

    > Best regards,

    > Jason Erb

    > http://sparist.com

    >

    > [Non-text portions of this message have been removed]

    >

## William Tanksley, Jr — 2013-01-05 17:05:45

    Jason Erb <the.sparist@...> wrote:

     > Dear Concatenativists,

    > I've developed a unique concatenative language that I would like to share:

    > http://om-language.org

     It looks cool and fun, and I'd like to see examples for something more

    than swap and copy.

    Until I see more, I'll say that it looks like a language in Backus' FP

    / FL tradition (APL, Rebol, J, K), although true to your goals it

    looks like you've done some nice simplification. It might be

    concatenative, I don't know.

     > This led to concatenative languages, but Om has taken a few left turns where other concatenative languages have gone right:

     That seems like an appropriate way to describe it :-).

     > - An Om program has only three syntactic elements: operator, operand, and separator.

     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?

    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.

     > - Om uses prefix syntax rather than postfix.

     An elegant left-turn.

     > - The only data type exposed by the language is a program.

     Ah, I do that in my useless language. But like Jot and Iota and unlike

    Om, my language is useless.

     > - Each function takes as input the rest of the program that it is in.

     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.

    Yes, I confirm that I'm confused to the point of being useless.

     > Jason Erb

     -Wm

## Jason Erb — 2013-01-05 18:46:17

    Thanks for the good words and the addition at concatenative.org.  I hadn't realized that editing was open for all -- I've created an account and filled in the description a bit.  (I finally figured out editing in the sidebar: you have to click the Contents heading.)

    About the website: I can't take a lot of credit here -- most of it is generated by Doxygen from markup in the C++ code.  I highly recommend Doxygen for this.

    About the "minutes" example: you're right.  That is very confusing for someone who doesn't already know the language (i.e. everyone except me).  I've updated the website to show how that one is evaluated, step by step.  Let me know if it still isn't very well explained.

    Cheers,

    Jason

    ________________________________

     From: Ruurd <r.wiersma26@...>

    To: concatenative@yahoogroups.com

    Sent: Saturday, January 5, 2013 5:06 AM

    Subject: [stack] Re: Introducing the Om language

    Hi,

    It is nice to see some activity here. An impressive web site you have there. Makes me feel like an amateur. Now, about concatenative.org. I have managed to create a page for Om. After all, it is a wiki, so everybody can add or change or delete a page. But I have not been able to edit the contents page. I also do not get an error message, so I don't know why that is. Now, about the language Om. In get lost in the example of minutes. Can you show a trace of the individual steps during evaluation ?

    Rw

    [Non-text portions of this message have been removed]

## Jason Erb — 2013-01-05 19:39:14

    William,

    Thanks for the in-depth questions.  Discussions like this are extremely helpful 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.  I 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.  However, some characters need to be escaped with a backquote - these include space, tab, and new line (because these are separator characters), curly braces (because these enclose operands), and backquotes (because this is the escape character).  Any other character 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 characters.

    An operand is any program (made of operators, operands, and separators), enclosed 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.  Any two programs can be concatenated to form another valid program.  Again, sorry 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.  Operations don't exist in the "language domain"; they are part of the evaluation implementation rather than the syntax.

    Every program evaluates to an operation.  Every program is a concatenation of sub-programs, which each evaluate to operations.  Evaluation of an operation 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.  Operators 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.  For example: "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.  The operator "tanksley" doesn't have an operation implemented for it, so it evaluates to an operation that returns a program comprised of the 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.  "{operand} ..." evaluates to "{operand} ...".

    - Separators evaluate to operations that return the program with "normalized" whitespace at the front.

    Each natively-implemented operation (i.e. an operator definition) is only permitted to manipulate operands at the top of the argument program.  Separators are ignored by the operation, and an operator indicates the end of the operands that the operation can use.  For 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.  If 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]

## Jason Erb — 2013-01-05 19:40:50

    Fixing formatting issues in the last message...

    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

    [Non-text portions of this message have been removed]

## Jason Erb — 2013-01-06 20:32:18

    I've filled out the Om documentation to hopefully clarify how the whole thing works and explain it from a concatenative standpoint.

    http://sparist.github.com/Om/

    Please let me know if you still have any questions about how the language works, or any suggestions. Thanks for all the feedback.

    Jason

    [Non-text portions of this message have been removed]