<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: A prefix notation programming language</title>
	<atom:link href="http://probablyprogramming.com/2008/11/16/a-prefix-notation-programming-language/feed/" rel="self" type="application/rss+xml" />
	<link>http://probablyprogramming.com/2008/11/16/a-prefix-notation-programming-language/</link>
	<description>It&#039;s what I&#039;m doing, and what posts on this blog are about.</description>
	<lastBuildDate>Thu, 04 Mar 2010 13:05:27 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: pib</title>
		<link>http://probablyprogramming.com/2008/11/16/a-prefix-notation-programming-language/comment-page-1/#comment-3705</link>
		<dc:creator>pib</dc:creator>
		<pubDate>Wed, 19 Nov 2008 01:36:07 +0000</pubDate>
		<guid isPermaLink="false">http://probablyprogramming.com/?p=148#comment-3705</guid>
		<description>&lt;p&gt;Konrad: Yeah, I guess I wasn&#039;t clear enough. I&#039;m not suggesting using keywords instead of braces, I was just emphasizing that it was a compile-time function implementing them rather than hard-coded syntax. Notice how later I went on to show how parentheses would be implemented...&lt;/p&gt;

&lt;p&gt;There will be braces in the language, for sure, but they will be more flexible than in your usual programming language.&lt;/p&gt;

&lt;p&gt;Python-type block syntax would also be possible. You&#039;d just have to pull out the portion of the reader that skips whitespace and make it turn the whitespace into a symbol if it comes after a newline or something, then keep track of the current indentation.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Konrad: Yeah, I guess I wasn&#8217;t clear enough. I&#8217;m not suggesting using keywords instead of braces, I was just emphasizing that it was a compile-time function implementing them rather than hard-coded syntax. Notice how later I went on to show how parentheses would be implemented&#8230;</p>

<p>There will be braces in the language, for sure, but they will be more flexible than in your usual programming language.</p>

<p>Python-type block syntax would also be possible. You&#8217;d just have to pull out the portion of the reader that skips whitespace and make it turn the whitespace into a symbol if it comes after a newline or something, then keep track of the current indentation.</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Konrad</title>
		<link>http://probablyprogramming.com/2008/11/16/a-prefix-notation-programming-language/comment-page-1/#comment-3702</link>
		<dc:creator>Konrad</dc:creator>
		<pubDate>Wed, 19 Nov 2008 00:42:03 +0000</pubDate>
		<guid isPermaLink="false">http://probablyprogramming.com/?p=148#comment-3702</guid>
		<description>&lt;p&gt;hmm... keywords instead of braces. I think I&#039;d lean towards pythonic whitespace delimited block syntax. or just stick with the parentheses. adding explicit end keywords seems like 1 step forward and three steps back (at least to me anyway).&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>hmm&#8230; keywords instead of braces. I think I&#8217;d lean towards pythonic whitespace delimited block syntax. or just stick with the parentheses. adding explicit end keywords seems like 1 step forward and three steps back (at least to me anyway).</p>]]></content:encoded>
	</item>
	<item>
		<title>By: pib</title>
		<link>http://probablyprogramming.com/2008/11/16/a-prefix-notation-programming-language/comment-page-1/#comment-3661</link>
		<dc:creator>pib</dc:creator>
		<pubDate>Tue, 18 Nov 2008 00:27:36 +0000</pubDate>
		<guid isPermaLink="false">http://probablyprogramming.com/?p=148#comment-3661</guid>
		<description>&lt;p&gt;Konrad: The commas and colons are only there for the JSON example, since I was showing how you could support different formats.&lt;/p&gt;

&lt;p&gt;For the actual list and dictionary literals I was planning on leaving the commas and colons out.&lt;/p&gt;

&lt;p&gt;As for conditionals and loops, I was thinking something along the lines of how Ruby does blocks.&lt;/p&gt;

&lt;p&gt;As for if .. else if, that&#039;s easy. You just make if always have an else clause, and then for the else clause you just put another if. That&#039;s actually how else if works in languages like C. Perhaps define elseif to be an alias for if so it reads nicely.&lt;/p&gt;

&lt;p&gt;[code lang=&quot;lisp&quot;]
if something do
    do-some
    things here
  end
elseif some other thing do
    do some
    more stuff
  end nil
[/code]&lt;/p&gt;

&lt;p&gt;that nil at the end there is the else condition for the second if.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Konrad: The commas and colons are only there for the JSON example, since I was showing how you could support different formats.</p>

<p>For the actual list and dictionary literals I was planning on leaving the commas and colons out.</p>

<p>As for conditionals and loops, I was thinking something along the lines of how Ruby does blocks.</p>

<p>As for if .. else if, that&#8217;s easy. You just make if always have an else clause, and then for the else clause you just put another if. That&#8217;s actually how else if works in languages like C. Perhaps define elseif to be an alias for if so it reads nicely.</p>

<p>[code lang="lisp"]
if something do
    do-some
    things here
  end
elseif some other thing do
    do some
    more stuff
  end nil
[/code]</p>

<p>that nil at the end there is the else condition for the second if.</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Konrad`</title>
		<link>http://probablyprogramming.com/2008/11/16/a-prefix-notation-programming-language/comment-page-1/#comment-3659</link>
		<dc:creator>Konrad`</dc:creator>
		<pubDate>Tue, 18 Nov 2008 00:20:27 +0000</pubDate>
		<guid isPermaLink="false">http://probablyprogramming.com/?p=148#comment-3659</guid>
		<description>&lt;p&gt;Hi,&lt;/p&gt;

&lt;p&gt;I don&#039;t see why the commas nad colons should be necessary inside {} and []
leaving it at whitespace separation seems adequate. OK allowing colons for key value pairs might imporove readability a little.&lt;/p&gt;

&lt;p&gt;Also How would you handle conditionals and loops. I&#039;ve had a play with it but couldn&#039;t really come up with an intuitive way to express an if else if else structure. especially if each condition might have more then one statement inside it.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Hi,</p>

<p>I don&#8217;t see why the commas nad colons should be necessary inside {} and []
leaving it at whitespace separation seems adequate. OK allowing colons for key value pairs might imporove readability a little.</p>

<p>Also How would you handle conditionals and loops. I&#8217;ve had a play with it but couldn&#8217;t really come up with an intuitive way to express an if else if else structure. especially if each condition might have more then one statement inside it.</p>]]></content:encoded>
	</item>
	<item>
		<title>By: pib</title>
		<link>http://probablyprogramming.com/2008/11/16/a-prefix-notation-programming-language/comment-page-1/#comment-3651</link>
		<dc:creator>pib</dc:creator>
		<pubDate>Mon, 17 Nov 2008 21:31:55 +0000</pubDate>
		<guid isPermaLink="false">http://probablyprogramming.com/?p=148#comment-3651</guid>
		<description>&lt;p&gt;I actually looked at Rebol quite a while ago. At first it seemed like just what I was thinking, but then it occurred to me more and more that it was too much in the wrong direction for what I wanted to do.&lt;/p&gt;

&lt;p&gt;Rather than try to explain why I don&#039;t like Rebol, just read this and assume that I pretty much agree with his arguments against even wanting to learn the whole language: http://arcanesentiment.blogspot.com/2008/08/why-i-havent-looked-at-rebol-much.html&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>I actually looked at Rebol quite a while ago. At first it seemed like just what I was thinking, but then it occurred to me more and more that it was too much in the wrong direction for what I wanted to do.</p>

<p>Rather than try to explain why I don&#8217;t like Rebol, just read this and assume that I pretty much agree with his arguments against even wanting to learn the whole language: <a href="http://arcanesentiment.blogspot.com/2008/08/why-i-havent-looked-at-rebol-much.html" rel="nofollow">http://arcanesentiment.blogspot.com/2008/08/why-i-havent-looked-at-rebol-much.html</a></p>]]></content:encoded>
	</item>
	<item>
		<title>By: Sébastien</title>
		<link>http://probablyprogramming.com/2008/11/16/a-prefix-notation-programming-language/comment-page-1/#comment-3642</link>
		<dc:creator>Sébastien</dc:creator>
		<pubDate>Mon, 17 Nov 2008 18:10:59 +0000</pubDate>
		<guid isPermaLink="false">http://probablyprogramming.com/?p=148#comment-3642</guid>
		<description>&lt;p&gt;If you&#039;re looking for an infrastructure to implement your language, you can have a look at LambdaFactory (git clone http://www.ivy.fr/lambdafactory/lambdafactory.git) it&#039;s not publicly announced/released but it&#039;s been in production use for 2 years.&lt;/p&gt;

&lt;p&gt;LF allows you to generate a program using a very simple API following the factory design pattern, this program can then be translated in Python, ActionScript and JavaScript. You basically just need your parser to invoke the factory to create the program (instead of creating an AST).&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>If you&#8217;re looking for an infrastructure to implement your language, you can have a look at LambdaFactory (git clone <a href="http://www.ivy.fr/lambdafactory/lambdafactory.git)" rel="nofollow">http://www.ivy.fr/lambdafactory/lambdafactory.git)</a> it&#8217;s not publicly announced/released but it&#8217;s been in production use for 2 years.</p>

<p>LF allows you to generate a program using a very simple API following the factory design pattern, this program can then be translated in Python, ActionScript and JavaScript. You basically just need your parser to invoke the factory to create the program (instead of creating an AST).</p>]]></content:encoded>
	</item>
	<item>
		<title>By: pib</title>
		<link>http://probablyprogramming.com/2008/11/16/a-prefix-notation-programming-language/comment-page-1/#comment-3636</link>
		<dc:creator>pib</dc:creator>
		<pubDate>Mon, 17 Nov 2008 15:59:29 +0000</pubDate>
		<guid isPermaLink="false">http://probablyprogramming.com/?p=148#comment-3636</guid>
		<description>&lt;p&gt;Fabien: There&#039;s not anything &lt;strong&gt;wrong&lt;/strong&gt; with outfix notation, and I&#039;m not necessarily advocating pure fixed-arity prefix notation.&lt;/p&gt;

&lt;p&gt;My original idea was to make an esoteric language which was purely prefix notation, but in researching how to implement that, it occurred to me that something actually powerful and/or useful could be created with the simple parser and compile-time function system that I&#039;d come up with.&lt;/p&gt;

&lt;p&gt;The prefix notation simplifies the parser to the point where it&#039;s really easy to extend and add new syntax, including compile-time functions which have a variable arity. The difference is that it&#039;s up to the compile-time function to decide what arguments it takes, if any. The built-in compiler code doesn&#039;t have to know anything about arity or pulling arguments. Each function can do that on its own as well as temporarily modify the syntax for its own purposes.&lt;/p&gt;

&lt;p&gt;I&#039;m already planning on list and dictionary/object literal &quot;syntax&quot; being a standard part of the language, or at least the standard library of the language, so it won&#039;t be as unreadable as some may be imagining here.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Fabien: There&#8217;s not anything <strong>wrong</strong> with outfix notation, and I&#8217;m not necessarily advocating pure fixed-arity prefix notation.</p>

<p>My original idea was to make an esoteric language which was purely prefix notation, but in researching how to implement that, it occurred to me that something actually powerful and/or useful could be created with the simple parser and compile-time function system that I&#8217;d come up with.</p>

<p>The prefix notation simplifies the parser to the point where it&#8217;s really easy to extend and add new syntax, including compile-time functions which have a variable arity. The difference is that it&#8217;s up to the compile-time function to decide what arguments it takes, if any. The built-in compiler code doesn&#8217;t have to know anything about arity or pulling arguments. Each function can do that on its own as well as temporarily modify the syntax for its own purposes.</p>

<p>I&#8217;m already planning on list and dictionary/object literal &#8220;syntax&#8221; being a standard part of the language, or at least the standard library of the language, so it won&#8217;t be as unreadable as some may be imagining here.</p>]]></content:encoded>
	</item>
	<item>
		<title>By: bob jones</title>
		<link>http://probablyprogramming.com/2008/11/16/a-prefix-notation-programming-language/comment-page-1/#comment-3628</link>
		<dc:creator>bob jones</dc:creator>
		<pubDate>Mon, 17 Nov 2008 13:22:14 +0000</pubDate>
		<guid isPermaLink="false">http://probablyprogramming.com/?p=148#comment-3628</guid>
		<description>&lt;p&gt;So... You&#039;re reinventing Forth? only... backwards. A queue-based language?&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>So&#8230; You&#8217;re reinventing Forth? only&#8230; backwards. A queue-based language?</p>]]></content:encoded>
	</item>
	<item>
		<title>By: sampo</title>
		<link>http://probablyprogramming.com/2008/11/16/a-prefix-notation-programming-language/comment-page-1/#comment-3627</link>
		<dc:creator>sampo</dc:creator>
		<pubDate>Mon, 17 Nov 2008 13:18:16 +0000</pubDate>
		<guid isPermaLink="false">http://probablyprogramming.com/?p=148#comment-3627</guid>
		<description>&lt;p&gt;Well, I don&#039;t know if this is helpful but I&#039;ll tell what kind of language I have been thinking about:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Lispy &amp; Smalltalkish&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;metaprogramming&lt;/li&gt;
&lt;li&gt;reflection&lt;/li&gt;
&lt;li&gt;&quot;live&quot; environment&lt;/li&gt;
&lt;li&gt;everything is still an object (at least can be treated as one)&lt;/li&gt;
&lt;/ul&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;MLish&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;optional static typing&lt;/li&gt;
&lt;li&gt;type inference&lt;/li&gt;
&lt;li&gt;first class functions&lt;/li&gt;
&lt;li&gt;pattern matching&lt;/li&gt;
&lt;/ul&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Other important points: 
 - parallelizable
 - good and easy to use FFI (for example C-interface)
 - good performance (very good at least with certain tricks)&lt;/p&gt;

&lt;p&gt;The syntactic approach you described sounds really good.. :-)&lt;/p&gt;

&lt;p&gt;How about implementing it in OCaml on LLVM (http://llvm.org/docs/tutorial/OCamlLangImpl1.html) I&#039;d be very interested in contributing ;-))&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Well, I don&#8217;t know if this is helpful but I&#8217;ll tell what kind of language I have been thinking about:</p>

<ol>
<li><p>Lispy &amp; Smalltalkish</p>

<ul>
<li>metaprogramming</li>
<li>reflection</li>
<li>&#8220;live&#8221; environment</li>
<li>everything is still an object (at least can be treated as one)</li>
</ul></li>
<li><p>MLish</p>

<ul>
<li>optional static typing</li>
<li>type inference</li>
<li>first class functions</li>
<li>pattern matching</li>
</ul></li>
</ol>

<p>Other important points: 
 &#8211; parallelizable
 &#8211; good and easy to use FFI (for example C-interface)
 &#8211; good performance (very good at least with certain tricks)</p>

<p>The syntactic approach you described sounds really good.. <img src='http://probablyprogramming.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>

<p>How about implementing it in OCaml on LLVM (<a href="http://llvm.org/docs/tutorial/OCamlLangImpl1.html" rel="nofollow">http://llvm.org/docs/tutorial/OCamlLangImpl1.html</a>) I&#8217;d be very interested in contributing <img src='http://probablyprogramming.com/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> )</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Mark Lee Smith</title>
		<link>http://probablyprogramming.com/2008/11/16/a-prefix-notation-programming-language/comment-page-1/#comment-3625</link>
		<dc:creator>Mark Lee Smith</dc:creator>
		<pubDate>Mon, 17 Nov 2008 12:27:45 +0000</pubDate>
		<guid isPermaLink="false">http://probablyprogramming.com/?p=148#comment-3625</guid>
		<description>&lt;p&gt;Check out the Rebol programming language. It&#039;s intrinsically similar to the language you defined here, but without the forth-like compile-time functions. Perhaps importantly to you, it uses this &quot;pure&quot; prefix notation.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Check out the Rebol programming language. It&#8217;s intrinsically similar to the language you defined here, but without the forth-like compile-time functions. Perhaps importantly to you, it uses this &#8220;pure&#8221; prefix notation.</p>]]></content:encoded>
	</item>
</channel>
</rss>
