<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xml:base="http://lambda-the-ultimate.org">
<channel>
 <title>Lambda the Ultimate - LtU Forum, Site Discussion</title>
 <link>http://lambda-the-ultimate.org/taxonomy/term/1 2/0</link>
 <description>Main Discussion Forum</description>
 <language>en</language>
<item>
 <title>Frequent Server Error 502</title>
 <link>http://lambda-the-ultimate.org/node/5706</link>
 <description>&lt;p &gt;It might be because I&#039;m posting from strange timezone (UTC+12hr, my evening is before dawn in UK/small hours in USA), but often when I try posting I get Server Error and even fail to get SQL connection. If I wait and retry, often I&#039;ve ended up posting twice.&lt;/p&gt;
&lt;p &gt;Is there I time I should avoid posting?&lt;/p&gt;</description>
 <category domain="http://lambda-the-ultimate.org/taxonomy/term/2">Site Discussion</category>
 <pubDate>Wed, 08 Apr 2026 22:52:02 +0000</pubDate>
</item>
<item>
 <title>Lambda the Ultimate Object</title>
 <link>http://lambda-the-ultimate.org/node/5700</link>
 <description>&lt;p &gt;I am writing a book &quot;Lambda the Ultimate Object&quot;. It&#039;s quite advanced at the moment, and already covers all the usual topics of OOP, though I&#039;m still working on CLOS features that most other languages are lacking (I did method combinations, now working on multiple dispatch, then dynamic vs static dispatch, then the meta-object protocol). Feedback welcome.&lt;/p&gt;
&lt;p &gt;&lt;a href=&quot;http://fare.tunes.org/files/cs/poof/ltuo.html&quot;&gt;http://fare.tunes.org/files/cs/poof/ltuo.html&lt;/a&gt;&lt;/p&gt;</description>
 <category domain="http://lambda-the-ultimate.org/taxonomy/term/1">LtU Forum</category>
 <pubDate>Fri, 06 Mar 2026 05:10:32 +0000</pubDate>
</item>
<item>
 <title>Lambda the Ultimate Object</title>
 <link>http://lambda-the-ultimate.org/node/5695</link>
 <description>&lt;p &gt;I am writing a book &quot;Lambda the Ultimate Object&quot;. It&#039;s quite advanced at the moment, and already covers all the usual topics of OOP, though I&#039;m still working on CLOS features that most other languages are lacking (I did method combinations, now working on multiple dispatch, then dynamic vs static dispatch, then the meta-object protocol). Feedback welcome.&lt;/p&gt;
&lt;p &gt;&lt;a href=&quot;http://fare.tunes.org/files/cs/poof/ltuo.html&quot;&gt;http://fare.tunes.org/files/cs/poof/ltuo.html&lt;/a&gt;&lt;/p&gt;</description>
 <category domain="http://lambda-the-ultimate.org/taxonomy/term/1">LtU Forum</category>
 <pubDate>Fri, 06 Mar 2026 05:10:31 +0000</pubDate>
</item>
<item>
 <title>Lambda the Ultimate Object</title>
 <link>http://lambda-the-ultimate.org/node/5696</link>
 <description>&lt;p &gt;I am writing a book &quot;Lambda the Ultimate Object&quot;. It&#039;s quite advanced at the moment, and already covers all the usual topics of OOP, though I&#039;m still working on CLOS features that most other languages are lacking (I did method combinations, now working on multiple dispatch, then dynamic vs static dispatch, then the meta-object protocol). Feedback welcome.&lt;/p&gt;
&lt;p &gt;&lt;a href=&quot;http://fare.tunes.org/files/cs/poof/ltuo.html&quot;&gt;http://fare.tunes.org/files/cs/poof/ltuo.html&lt;/a&gt;&lt;/p&gt;</description>
 <category domain="http://lambda-the-ultimate.org/taxonomy/term/1">LtU Forum</category>
 <pubDate>Fri, 06 Mar 2026 05:10:31 +0000</pubDate>
</item>
<item>
 <title>Lambda the Ultimate Object</title>
 <link>http://lambda-the-ultimate.org/node/5697</link>
 <description>&lt;p &gt;I am writing a book &quot;Lambda the Ultimate Object&quot;. It&#039;s quite advanced at the moment, and already covers all the usual topics of OOP, though I&#039;m still working on CLOS features that most other languages are lacking (I did method combinations, now working on multiple dispatch, then dynamic vs static dispatch, then the meta-object protocol). Feedback welcome.&lt;/p&gt;
&lt;p &gt;&lt;a href=&quot;http://fare.tunes.org/files/cs/poof/ltuo.html&quot;&gt;http://fare.tunes.org/files/cs/poof/ltuo.html&lt;/a&gt;&lt;/p&gt;</description>
 <category domain="http://lambda-the-ultimate.org/taxonomy/term/1">LtU Forum</category>
 <pubDate>Fri, 06 Mar 2026 05:10:31 +0000</pubDate>
</item>
<item>
 <title>Lambda the Ultimate Object</title>
 <link>http://lambda-the-ultimate.org/node/5698</link>
 <description>&lt;p &gt;I am writing a book &quot;Lambda the Ultimate Object&quot;. It&#039;s quite advanced at the moment, and already covers all the usual topics of OOP, though I&#039;m still working on CLOS features that most other languages are lacking (I did method combinations, now working on multiple dispatch, then dynamic vs static dispatch, then the meta-object protocol). Feedback welcome.&lt;/p&gt;
&lt;p &gt;&lt;a href=&quot;http://fare.tunes.org/files/cs/poof/ltuo.html&quot;&gt;http://fare.tunes.org/files/cs/poof/ltuo.html&lt;/a&gt;&lt;/p&gt;</description>
 <category domain="http://lambda-the-ultimate.org/taxonomy/term/1">LtU Forum</category>
 <pubDate>Fri, 06 Mar 2026 05:10:31 +0000</pubDate>
</item>
<item>
 <title>Lambda the Ultimate Object</title>
 <link>http://lambda-the-ultimate.org/node/5699</link>
 <description>&lt;p &gt;I am writing a book &quot;Lambda the Ultimate Object&quot;. It&#039;s quite advanced at the moment, and already covers all the usual topics of OOP, though I&#039;m still working on CLOS features that most other languages are lacking (I did method combinations, now working on multiple dispatch, then dynamic vs static dispatch, then the meta-object protocol). Feedback welcome.&lt;/p&gt;
&lt;p &gt;&lt;a href=&quot;http://fare.tunes.org/files/cs/poof/ltuo.html&quot;&gt;http://fare.tunes.org/files/cs/poof/ltuo.html&lt;/a&gt;&lt;/p&gt;</description>
 <category domain="http://lambda-the-ultimate.org/taxonomy/term/1">LtU Forum</category>
 <pubDate>Fri, 06 Mar 2026 05:10:31 +0000</pubDate>
</item>
<item>
 <title>Lambda the Ultimate Object</title>
 <link>http://lambda-the-ultimate.org/node/5694</link>
 <description>&lt;p &gt;I am writing a book &quot;Lambda the Ultimate Object&quot;. It&#039;s quite advanced at the moment, and already covers all the usual topics of OOP, though I&#039;m still working on CLOS features that most other languages are lacking (I did method combinations, now working on multiple dispatch, then dynamic vs static dispatch, then the meta-object protocol). Feedback welcome.&lt;/p&gt;
&lt;p &gt;&lt;a href=&quot;http://fare.tunes.org/files/cs/poof/ltuo.html&quot;&gt;http://fare.tunes.org/files/cs/poof/ltuo.html&lt;/a&gt;&lt;/p&gt;</description>
 <category domain="http://lambda-the-ultimate.org/taxonomy/term/1">LtU Forum</category>
 <pubDate>Fri, 06 Mar 2026 05:10:30 +0000</pubDate>
</item>
<item>
 <title>Lambda the Ultimate Object</title>
 <link>http://lambda-the-ultimate.org/node/5691</link>
 <description>&lt;p &gt;I am writing a book &quot;Lambda the Ultimate Object&quot;. It&#039;s quite advanced at the moment, and already covers all the usual topics of OOP, though I&#039;m still working on CLOS features that most other languages are lacking (I did method combinations, now working on multiple dispatch, then dynamic vs static dispatch, then the meta-object protocol). Feedback welcome.&lt;/p&gt;
&lt;p &gt;&lt;a href=&quot;http://fare.tunes.org/files/cs/poof/ltuo.html&quot;&gt;http://fare.tunes.org/files/cs/poof/ltuo.html&lt;/a&gt;&lt;/p&gt;</description>
 <category domain="http://lambda-the-ultimate.org/taxonomy/term/1">LtU Forum</category>
 <pubDate>Fri, 06 Mar 2026 05:10:03 +0000</pubDate>
</item>
<item>
 <title>A data-directed approach to lexing.</title>
 <link>http://lambda-the-ultimate.org/node/5690</link>
 <description>&lt;p &gt;I invented a simple way to write lexers. I should probably write a formal paper about it but I have no academic institution nor business pushing me to, so I probably won&#039;t. It is data-directed, so it has flow-of-control far simpler than most lexers. It relies heavily on bitmask operations instead of control logic. &lt;/p&gt;
&lt;p &gt;The lexer uses a hash table. The table is keyed by an input character and optionally by the position in the token where the character is read. There is a &#039;base&#039; entry for every character, automatically generated from the character properties and the lexical rules for simple nonfixed tokens like identifiers and numbers. There are additional entries for characters which can appear in fixed tokens, indexed by both the character and the positions in which it appears in fixed tokens. The data stored in the table is bitmasks. &lt;/p&gt;
&lt;p &gt;The number of bits in each bitmask in this system is one per token class you want to recognize. Most of these are fixed tokens such as keywords and operators. Some are nonfixed tokens such as identifiers, numbers, and the text of inline constants. Depending on the complexity of the nonfixed tokens some may need to be represented by more than one bit. For example if you have a &quot;no tabs in indentation&quot; rule you may have type-1 whitespace that consists of a newline followed by some number of spaces, and type-2 whitespace that may contain spaces and tabs but no newlines. The parser could then enforce the no-tabs-in-indentation rule by declaring an error if it finds any instances of type-1 immediately followed by type-2.&lt;/p&gt;
&lt;p &gt;Each fixed token corresponds to one bit on the bitmask.  If the bit is on, then that keyword or syntax has not yet been ruled out as the value of the token being parsed. &lt;/p&gt;
&lt;p &gt;So the lexer works thus: &lt;/p&gt;
&lt;pre &gt;
// PSEUDOCODE ONLY. THIS IS NOT EXPECTED TO COMPILE, THIS HAS NOT BEEN TESTED, AND IT HAS NOT EVEN BEEN FORMALLY VERIFIED.
{
   for (index=0, workmask = oldmask = ALL_ONES; workmask != 0; index++) {
      input = readInput();
      oldmask = workmask;
      workmask &amp;amp;= table(input, index);
   }
   unread(input)                        // push excluded letter back into file cache, to be read as first character next time.
   repeat{ 
      tokenidx = round(log2(oldmask));                        // get the index of the highest bit set
      if ((tokenidx &amp;lt; fixtokencount) ||                       // if it&#039;s the bit of a nonfixed token return that 
          (tokenlengths[tokenidx] == index return(tokenidx);  // if it&#039;s the bit of a fixed token check to make sure length matches.
      oldmask -= 0x1&amp;lt;&amp;lt;tokenidx;                               // clear the bit.
      }
   until (oldmask == 0);                                      // until we have returned or all remaining set bits have been checked.
   print (&quot;This never happens.&quot;);                             // If we get here it&#039;s a bug, so report an error.
}
&lt;/pre&gt;&lt;p &gt;
At the start of a new token, it sets its working bitmask to all ones. Then it iterates through the input. Each time it reads a character C at position P, it fetches bitmask(C,P) from the hash table and ANDs it with its working bitmask.&lt;/p&gt;
&lt;p &gt;So for example, we can set our working bitmask to ones, then process &#039;w&#039;, &#039;h&#039;, &#039;i&#039; &#039;l&#039;, &#039;e&#039;, &#039; &#039;, by masking it with table(&#039;w&#039;,0), table(&#039;h&#039;,1), table(&#039;i&#039;,2), table(&#039;l&#039;,3), and table(&#039;e&#039;,4). At this point the bit for the &#039;while&#039; keyword is the only one still set. When we mask with table(&#039; &#039;,5) it goes dark. We check that the length of the token corresponding with that bit matches the number of tokens we&#039;ve processed and output &#039;while&#039;. &lt;/p&gt;
&lt;p &gt;(note: in this case the &#039;while&#039; bit and the &#039;identifier&#039; bit will both be set. After processing the table(&#039; &#039;,5) both will be unset, so both are candidates in the &#039;last nonzero mask&#039; rule. But given a conflict between keyword and identifier, we will always pick the keyword.)&lt;/p&gt;
&lt;p &gt;The length check is to handle things like &#039;-&#039; and &#039;--&#039; and &#039;-=&#039; all being syntax. After masking with table(&#039;-&#039;,0) all three will still be set. Some letter in position &#039;1&#039; would mask all three at the same time. But only one of those three finalists has length equal to the number of characters processed. &lt;/p&gt;
&lt;p &gt;There is a &#039;base&#039; bitmap for each character. These simply define a character&#039;s relationship to  the non-fixed categories with properties such as whether it&#039;s a digit, hex digit, binary digit, possible identifier character, etc. These are auto-generated based on the character&#039;s properties, and ignore the fixed tokens completely. &lt;/p&gt;
&lt;p &gt;What I like about this method is the absolute simplicity. of setting it up. You simply iterate through your list of fixed tokens, doing very obvious things with each: &lt;/p&gt;
&lt;pre &gt;
// PSEUDOCODE ONLY. THIS IS NOT EXPECTED TO COMPILE, THIS HAS NOT BEEN TESTED, AND IT HAS NOT EVEN BEEN FORMALLY VERIFIED.

for (bitplace = fixtokencount; bitplace &amp;gt;0;  bitplace--){         // fixed-tokens have highest priority so they get highest bit positions 
   bitval = 0x1 &amp;lt;&amp;lt; bitplace;                                       // nonfixed tokens like identifiers and numbers will have low bit positions
   for (letters in fixtokenlist[bitplace] )
       Tmask = table(letter,place) if it exists, table(letter,base) if it doesn&#039;t.  // get existing or copy default bitmask for letter and place
       Tmask &amp;amp;= ~bitval;                                                            // poke a hole at bitplace
       table(a,place) = Tmask.                                                      // store the changed mask back in the table
    }
    Lexerlengths[bitplace]=place;                                                   // store the length of the token in the lexer&#039;s length table.
}
&lt;/pre&gt;&lt;p &gt;
And you are done with fixed tokens. The lexer will recognize all of them, won&#039;t hallucinate tokens that don&#039;t exist, will run reasonably efficiently, and most important, the source will explain very clearly exactly how and why. &lt;/p&gt;
&lt;p &gt;There is no &quot;mysterious&quot; or &quot;difficult&quot; or even &quot;complicated&quot; thing going on here. Deterministic finite-state Automata and Chomsky grammars and state machines are lovely, but the way this works is so brutally simple it should be clear to any student on the first day it&#039;s explained.&lt;/p&gt;
&lt;p &gt;Benefits: &lt;/p&gt;
&lt;p &gt;Stunning simplicity of implementation. Better scaling than state-machine or flow-of-control approaches. Takes advantage of bit operations to parallelize a lot of things that would otherwise require sequential or carefully state-dependent implementation. Likely to further parallelize more easily than existing approaches.&lt;/p&gt;
&lt;p &gt;Costs: &lt;/p&gt;
&lt;p &gt;One Hash table lookup per character read is definitely the most expensive thing I&#039;m doing. Depending on the size of the code set in use and the size of the bitmap, the table can break L2 cache even on high-end desktop machines. A complex language having ~250 fixed tokens (using a 16-byte bitmap) and  all ~169K unicode codepoints (excluding private use, excluding surrogates) would make the table about 2.6 megabytes plus overhead. Overhead is brutal for hash tables, so that&#039;s no smaller than 4.5 megabytes and means definitely a lot of L2 cache misses. An implementation excluding Chinese characters and using an 8-byte bitmask on the other hand could have a table under 0.5 megabytes plus overhead, which will fit handily into most L2 caches. &lt;/p&gt;
&lt;p &gt;I&#039;m using a logarithm operation to get the highest bit set. On reflex this seemed wrong because &quot;transcendental function are SLOOOWW!&quot; However on reflection I realized I had learned that a very long time ago and it&#039;s no longer true. Logarithms are implemented directly in hardware on modern CPUs and take barely longer than a multiplication.&lt;/p&gt;</description>
 <category domain="http://lambda-the-ultimate.org/taxonomy/term/1">LtU Forum</category>
 <pubDate>Wed, 24 Dec 2025 06:29:49 +0000</pubDate>
</item>
<item>
 <title>Compiling high-level code to cryptography</title>
 <link>http://lambda-the-ultimate.org/node/5689</link>
 <description>&lt;p &gt;We showed in a forthcoming paper (CSF&#039;24) that a compiler can translate high-level sequential code into a distributed concurrent program that uses cryptography to achieve security. All source-level security properties are preserved -- robust hyperproperty preservation. This requires a new kind of compiler correctness proof based on the kind of simulation used in Universal Composability.&lt;br &gt;
See &lt;a href=&quot;https://www.cs.cornell.edu/andru/papers/viaduct-formal/&quot;&gt;Acay, Gancher, Recto, Myers, &quot;Secure Synthesis of Distributed Cryptographic Applications&quot;&lt;/a&gt;.&lt;/p&gt;</description>
 <category domain="http://lambda-the-ultimate.org/taxonomy/term/1">LtU Forum</category>
 <pubDate>Thu, 25 Jan 2024 13:02:50 +0000</pubDate>
</item>
<item>
 <title>Haxl(-like &quot;Monads&quot;) in terms of Delimited Continuations?</title>
 <link>http://lambda-the-ultimate.org/node/5687</link>
 <description>&lt;p &gt;Haxl allows for IO operations to be batched by having Applicative operators that result in a &quot;slightly unlawful&quot; Monad instance -- rather than strictly having &lt;code &gt;(&amp;lt;*&amp;gt;) = ap where ap f x = f &amp;gt;&amp;gt;= (&amp;lt;$&amp;gt; x)&lt;/code&gt;, it&#039;s merely &quot;morally equivalent,&quot; as it performs the IO operations in parallel rather than in serial as &lt;code &gt;ap&lt;/code&gt; would do.&lt;/p&gt;
&lt;p &gt;I&#039;m wondering if it&#039;s possible to implement something similar in a language that implements effects in terms of delimited continuations rather than in terms of monads. It seems a lot less obvious how to do so, at least; when evaluating the arguments of an applicative-shaped function call (pure function, effectful arguments), the effect handler must process them one by one, and can&#039;t introspect on the continuation to see what future effects might be performed.&lt;/p&gt;
&lt;p &gt;An unfortunate solution might be to have a domain-specific optimization pass, reliant on inlining and other optimizations, that notes an effect as having some &quot;do these in parallel&quot; operator and transforms a program that unconditionally performs multiple effects in sequence to a single effect that uses that operator. However, this is terribly unsatisfying, since it&#039;s a non-semantics-preserving optimization, rather than something that falls directly out of the user-written code.&lt;/p&gt;</description>
 <category domain="http://lambda-the-ultimate.org/taxonomy/term/1">LtU Forum</category>
 <pubDate>Wed, 27 Dec 2023 00:22:23 +0000</pubDate>
</item>
<item>
 <title>A case study of concatenative v.s. applicative syntax design</title>
 <link>http://lambda-the-ultimate.org/node/5686</link>
 <description>&lt;p &gt;I implemented a language a while ago.&lt;/p&gt;
&lt;p &gt;Based on some feedback, I change it&#039;s syntax from concatenative:&lt;/p&gt;
&lt;p &gt;&lt;a href=&quot;https://github.com/cicada-lang/inet-cute&quot;&gt;https://github.com/cicada-lang/inet-cute&lt;/a&gt;&lt;/p&gt;
&lt;p &gt;- Stack-based like forth.&lt;br &gt;
- Simple and shorter code.&lt;br &gt;
- Easy to do refactoring.&lt;/p&gt;
&lt;p &gt;to applicative:&lt;/p&gt;
&lt;p &gt;&lt;a href=&quot;https://github.com/cicada-lang/inet-js&quot;&gt;https://github.com/cicada-lang/inet-js&lt;/a&gt;&lt;/p&gt;
&lt;p &gt;- JavaScript-like syntax.&lt;br &gt;
- Using pattern matching to define interaction rule.&lt;br &gt;
- Can use currying, because we have explicit parentheses.&lt;/p&gt;
&lt;p &gt;But I am still not sure which is better.&lt;/p&gt;
&lt;p &gt;What do you think?&lt;/p&gt;</description>
 <category domain="http://lambda-the-ultimate.org/taxonomy/term/1">LtU Forum</category>
 <pubDate>Sun, 24 Sep 2023 03:47:55 +0000</pubDate>
</item>
<item>
 <title>Using JavaScript-like syntax to program with Interaction Nets</title>
 <link>http://lambda-the-ultimate.org/node/5683</link>
 <description>&lt;p &gt;website: &lt;a href=&quot;https://inet.run&quot;&gt;https://inet.run&lt;/a&gt;&lt;/p&gt;
&lt;p &gt;code: &lt;a href=&quot;https://github.com/cicada-lang/inet-js&quot;&gt;https://github.com/cicada-lang/inet-js&lt;/a&gt;&lt;/p&gt;</description>
 <category domain="http://lambda-the-ultimate.org/taxonomy/term/1">LtU Forum</category>
 <pubDate>Sat, 23 Sep 2023 19:37:31 +0000</pubDate>
</item>
<item>
 <title>Sorting the travelling salesman problem</title>
 <link>http://lambda-the-ultimate.org/node/5681</link>
 <description>&lt;p &gt;Hi There,

&lt;p &gt;Perhaps someone here might be kind enough to check out a paper I have published at [1] and provide some feedback.

&lt;p &gt;It is an analysis of the travelling salesman problem and the sorting problem, examining the topologies of their solution spaces.

&lt;p &gt;1.- &lt;a href=&quot;https://github.com/enriquepablo/article-tsp/blob/mirror/article.ipynb&quot;&gt;https://github.com/enriquepablo/article-tsp/blob/mirror/article.ipynb&lt;/a&gt;

&lt;p &gt;Thank you.</description>
 <category domain="http://lambda-the-ultimate.org/taxonomy/term/1">LtU Forum</category>
 <pubDate>Tue, 05 Sep 2023 16:33:14 +0000</pubDate>
</item>
</channel>
</rss>
