<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Posts on Tuplet</title>
    
    
    
    <link>https://tuplet.dev/posts/</link>
    <description>Recent content in Posts on Tuplet</description>
    <generator>Hugo -- gohugo.io</generator>
    <language>en-us</language>
    <lastBuildDate>Tue, 23 Aug 2022 00:00:00 +0000</lastBuildDate>
    
	<atom:link href="https://tuplet.dev/posts/index.xml" rel="self" type="application/rss+xml" />
    
    
    <item>
      <title>Dev Diary 8</title>
      <link>https://tuplet.dev/posts/dev_diary_8/</link>
      <pubDate>Tue, 23 Aug 2022 00:00:00 +0000</pubDate>
      
      <guid>https://tuplet.dev/posts/dev_diary_8/</guid>
      <description>
        
          
          
          
        
        
        
&lt;div id=&#34;outline-container-headline-1&#34; class=&#34;outline-2&#34;&gt;
&lt;h2 id=&#34;headline-1&#34;&gt;
&lt;del&gt;Curzon&lt;/del&gt; Raku, my beloved old friend
&lt;/h2&gt;
&lt;div id=&#34;outline-text-headline-1&#34; class=&#34;outline-text-2&#34;&gt;
&lt;p&gt;
There&amp;#39;s a larger post bubbling in the back of my head about this, but for now, lets say that digging into &lt;a href=&#34;https://raku.org/&#34;&gt;Raku&lt;/a&gt; feels a lot like rediscovering an old friend. At the same time, I&amp;#39;m realizing that I&amp;#39;ve changed.&lt;/p&gt;
&lt;p&gt;
Raku is… brilliant. I regret not having stayed in touch with it during it&amp;#39;s rather prolonged development (21 years!!). You see, I &lt;em&gt;loved&lt;/em&gt; Perl 5. I don&amp;#39;t know if it was because it was my first &amp;#34;real&amp;#34; language (after Basic) and I imprinted on it, or if I was just exceptionally fortunate to start with a language that really supported my way of thinking. It&amp;#39;s, coincidentally, the same reason I&amp;#39;m not a Python dev. Python&amp;#39;s great, but it forces me to solve tasks in ways counter to how my brain wants to.&lt;/p&gt;
&lt;p&gt;
Anyway, I&amp;#39;m still just getting into it, but I&amp;#39;m loving what I&amp;#39;m discovering. At the same time, I&amp;#39;m learning that I&amp;#39;m not the same person I was. There was a tiny bit of fear that I&amp;#39;d be all &amp;#34;Never mind, screw tuplet. I&amp;#39;m just going to use Raku.&amp;#34; But, I&amp;#39;m finding that I still want something different.&lt;/p&gt;
&lt;p&gt;
For example, I&amp;#39;m annoyed by the c-style curlies. They feel like unnecessary clutter. I dislike the inconsistency of sometimes needing parens around args and sometimes not. While it is definitely multi-paradigmatic I find myself thinking that it hasn&amp;#39;t gone far enough towards supporting a lisp-like syntax. Also, I&amp;#39;ve spent so long in Ruby-land that the sigil-heavy syntax isn&amp;#39;t really a feature so much as a readability issue.&lt;/p&gt;
&lt;p&gt;
So, tuplet, is still on track.&lt;/p&gt;
&lt;p&gt;
…&lt;/p&gt;
&lt;p&gt;
[Days later]&lt;/p&gt;
&lt;p&gt;
Raku is, brilliant, and… a lot. It&amp;#39;s got a ton of documentation, but it&amp;#39;s simultaneously too much and too little. It&amp;#39;s not good for a new dev. For most languages I&amp;#39;m just like &amp;#34;ok how do you express this thing with your syntax&amp;#34;. Same idea, different clothes. But Raku isn&amp;#39;t like that. Raku&amp;#39;s like…&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&amp;#34;Well, you see… We don&amp;#39;t do it like that &amp;#39;round here. We express things differently. Oh, sure, you could do it in the old-n-busted way, but &amp;#39;cmere.&amp;#34; And then they lead you into this old broken down looking shed that&amp;#39;s actualy a Tardis in disguise. &amp;#34;Lemme show you some of the tools I&amp;#39;ve built with this-here CNC machine. … Yup. I see you checkin&amp;#39; out the thingawhatzit. That puppy&amp;#39;ll strip varnish of a flooblebobber to within 3 microns!&amp;#34;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;
Meanwhile you&amp;#39;re wondering what a &amp;#34;flooblebobber&amp;#34; is, and why you&amp;#39;d want to strip varnish from one.&lt;/p&gt;
&lt;p&gt;
I am still optomistic about it, but it feels like one of those projects that isn&amp;#39;t going to be easy, but&amp;#39;ll definitely be worth it in the long run.&lt;/p&gt;
&lt;p&gt;
—-
In case you don&amp;#39;t get the reference: &lt;a href=&#34;https://youtu.be/ED5V1KCqbpU&#34;&gt;Curzon, my beloved old friend.&lt;/a&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;

        
        </description>
    </item>
    
    <item>
      <title>Dev Diary 5</title>
      <link>https://tuplet.dev/posts/dev_diary_5/</link>
      <pubDate>Thu, 04 Aug 2022 00:00:00 +0000</pubDate>
      
      <guid>https://tuplet.dev/posts/dev_diary_5/</guid>
      <description>
        
          
          
          
        
        
        
&lt;div id=&#34;outline-container-headline-1&#34; class=&#34;outline-3&#34;&gt;
&lt;h3 id=&#34;headline-1&#34;&gt;
Back to writing a Language target
&lt;/h3&gt;
&lt;div id=&#34;outline-text-headline-1&#34; class=&#34;outline-text-3&#34;&gt;
&lt;p&gt;
Or… not.&lt;/p&gt;
&lt;p&gt;
It turns out that I &lt;em&gt;dramatically&lt;/em&gt; overestimated the amount of documentation available for creating a new language target for Antlr4. Basically it boils down to &amp;#34;edit one of the existing targets&amp;#34; Except there are all sorts of template directives in there that aren&amp;#39;t explained. I suspect the &lt;a href=&#34;https://github.com/antlr/stringtemplate4/blob/master/doc/index.md&#34;&gt;String Template documentation&lt;/a&gt; will probably address the syntax enough for me to understand the &amp;#34;what&amp;#34; of these templates but not the &amp;#34;why&amp;#34;.&lt;/p&gt;
&lt;p&gt;
So, after staring at the Python language target file I tried just generating the syntax with it. Now I&amp;#39;m reverse engineering. I thought I&amp;#39;d start with the Ruby one since I&amp;#39;m so familiar with it, but in addition to not being supported it has a lot of files. Like… &lt;em&gt;a lot&lt;/em&gt; of files:&lt;/p&gt;
&lt;img src=&#34;https://tuplet.dev/images/dev_diary/antlr_ruby_file_listing.png&#34; alt=&#34;/images/dev_diary/antlr_ruby_file_listing.png&#34; title=&#34;/images/dev_diary/antlr_ruby_file_listing.png&#34;/&gt;
&lt;p&gt;
I don&amp;#39;t know if this is reasonable, or ridiculous. I&amp;#39;m inclined to go with &amp;#34;reasonable&amp;#34; because why would you write over 8,000 lines of code if you didn&amp;#39;t have to?&lt;/p&gt;
&lt;p&gt;
So, now I&amp;#39;m wondering about maybe figuring out the grammar in Antlr using it&amp;#39;s sweet plugin and visualization tools. Then, take the grammar, and reimplement it in Janet using &lt;a href=&#34;https://janet-lang.org/docs/peg.html&#34;&gt;its built in Parsing Expression Grammar&lt;/a&gt; (PEG). Every time I tweak the grammar, I do it in Antlr where I can visualize and tweak things until it works. Then re-implement the changes in Janet.&lt;/p&gt;
&lt;p&gt;
This is, of course, just a terrible idea.&lt;/p&gt;
&lt;p&gt;
However, my options are:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Spend a very long time reverse engineering how the eff to write an Antlr4 Language target&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;frustrating, time consuming, not even remotely fun&lt;/li&gt;
&lt;li&gt;Probably will require writing thousands of lines of support code just to make it work, nevermind the code require to actually do the translation of the grammar into Janet.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Use one of the existing language targets (most likely Go)&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;So my compilation pipeline would be
&lt;code class=&#34;verbatim&#34;&gt;Tuplet -&amp;gt; Go -&amp;gt; Janet -&amp;gt; C -&amp;gt; executable&lt;/code&gt; This, of course, feels even stupider than reimplementing the grammar in Janet.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Port the grammar to Janet&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;
I honestly can&amp;#39;t decide which is a &lt;em&gt;worse&lt;/em&gt; idea. Passing through Go, or porting the Grammar to Janet and then porting every new language feature too.&lt;/p&gt;
&lt;p&gt;
The Go solution has the option of being something I could get up an running quickly, that would likely give me a fast running executable that could be replaced in some future date. It&amp;#39;s ridiculous, but it may be the fastest way to get to a working language. Also, it would likely prove to be a faster iteration cycle for new language features. I don&amp;#39;t have to reimplement a working, and somewhat tested, grammar while potentially introducing bugs in a much harder to test environment.&lt;/p&gt;
&lt;p&gt;
I could write unit tests for the Janet PEG I&amp;#39;d write, so they could be reliable, but once again I&amp;#39;m introducing more time into iteration loop of going from some new syntax idea, to compileable Tuplet code.&lt;/p&gt;
&lt;p&gt;
I guess that&amp;#39;s the answer. Most languages are bootstrapped off of some other language, because it&amp;#39;d take forever and be more painful to skip that. I guess the same idea applies here.&lt;/p&gt;
&lt;p&gt;
Sacrifice idealized compilation tool chain for speed of development. As i&amp;#39;m not really passionate about the compilation tool chain, that&amp;#39;s probably the right solution.&lt;/p&gt;
&lt;p&gt;
[Update]: I spent the night dreaming about writing a PEG in Janet. 🤦‍♀️&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;

        
        </description>
    </item>
    
    <item>
      <title>Dev Diary 7</title>
      <link>https://tuplet.dev/posts/dev_diary_7/</link>
      <pubDate>Thu, 04 Aug 2022 00:00:00 +0000</pubDate>
      
      <guid>https://tuplet.dev/posts/dev_diary_7/</guid>
      <description>
        
          
          
          
        
        
        
&lt;div id=&#34;outline-container-headline-1&#34; class=&#34;outline-2&#34;&gt;
&lt;h2 id=&#34;headline-1&#34;&gt;
Target Woes
&lt;/h2&gt;
&lt;div id=&#34;outline-text-headline-1&#34; class=&#34;outline-text-2&#34;&gt;
&lt;p&gt;Started writing a tiny grammar in &lt;a href=&#34;https://janet-lang.org&#34;&gt;Janet&lt;/a&gt; last night just to get a feel for it. Wrote one that matches my multi-line comments which I&amp;#39;ll need for the initial pass of the parser.&lt;/p&gt;
&lt;p&gt;
Discovered some problems.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Janet&amp;#39;s &lt;a href=&#34;https://janet-lang.org/docs/peg.html&#34;&gt;PEG&lt;/a&gt; doesn&amp;#39;t support unicode out of the box. It&amp;#39;s stuck in ASCII land. Gods forbid anyone wants to try and match a string that was written in another language. You know, something really esoteric like Spanish, or French. 🤦‍♀️Technically it &lt;em&gt;does&lt;/em&gt; support unicode &lt;em&gt;but&lt;/em&gt; there&amp;#39;s no easy way to do basic things like defining something that matches letters / word characters unless you&amp;#39;re willing to limit your input to ASCII.&lt;/li&gt;
&lt;li&gt;It doesn&amp;#39;t appear that grammars can use other grammars, which means each grammar must be self-contained. Not a big deal. Fairly standard actually, but it means you can&amp;#39;t compose grammars.&lt;/li&gt;
&lt;li&gt;There&amp;#39;s no good way to see which rule matched a given portion of the text. You can &amp;#34;tag&amp;#34; captured text, but it&amp;#39;s only a thing used for referencing past matches within the grammar.&lt;/li&gt;
&lt;li&gt;Janet has no regular expressions. They explain this by saying that their PEG is better, and they&amp;#39;ve got some reasonable arguments, BUT we&amp;#39;re back to unicode not being supported out of the box.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;I use regular expressions &lt;em&gt;a lot&lt;/em&gt;. I &amp;#34;cut my teeth&amp;#34; on Perl 5. I love them, and actually understand them at an expert level. The syntax is freaking horrible for newbs, but that&amp;#39;s a separate discussion. Anyway…. no regexp is going to be a pain, and frankly I don&amp;#39;t want to have to write unicode support into a regexp engine or a PEG.&lt;/p&gt;
&lt;p&gt;
This morning I decided to check in on the current state of &lt;a href=&#34;https://raku.org/&#34;&gt;Raku&lt;/a&gt; (a.k.a Perl 6), which has some amazing features, and I saw this piece of beauty.&lt;/p&gt;
&lt;img src=&#34;https://tuplet.dev/images/dev_diary/raku_grammar_example.png&#34; alt=&#34;a screenshot of a raku grammar. it is beautiful and has features i want.&#34; title=&#34;a beautiful raku grammar with great looking features&#34;/&gt;
&lt;p&gt;
ARG. I DON&amp;#39;T WANT TO BE SWITCHING LANGUAGES AGAIN.&lt;/p&gt;
&lt;p&gt;
I need this language to be &lt;em&gt;done&lt;/em&gt;. Or, at least working. I need to get it out of my brain so that I can sleep again.&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;

        
        </description>
    </item>
    
    <item>
      <title>Dev Diary 6</title>
      <link>https://tuplet.dev/posts/dev_diary_6/</link>
      <pubDate>Tue, 02 Aug 2022 00:00:00 +0000</pubDate>
      
      <guid>https://tuplet.dev/posts/dev_diary_6/</guid>
      <description>
        
          
          
          
        
        
        
&lt;div id=&#34;outline-container-headline-1&#34; class=&#34;outline-2&#34;&gt;
&lt;h2 id=&#34;headline-1&#34;&gt;
Nanopass Compiler?
&lt;/h2&gt;
&lt;div id=&#34;outline-text-headline-1&#34; class=&#34;outline-text-2&#34;&gt;
&lt;p&gt;I realized that in order to really leverage my contract stuff I&amp;#39;m going to need a multi-pass compiler. For example, I want to have the compiler let you know that there&amp;#39;s a problem when you feed the output of a function that returns an Integer to the input of a function that takes a String. You can&amp;#39;t do that until you&amp;#39;ve ingested all the functions in your app, and processed their contract definitions. So, it&amp;#39;s really an &amp;#34;ok, your syntax is fine, let&amp;#39;s see if your usage is too&amp;#34; phase of compilation.&lt;/p&gt;
&lt;p&gt;
A multipass compiler is thus required. The &lt;a href=&#34;http://nanopass.org/&#34;&gt;Nanopass Compiler framework&lt;/a&gt; is the king of that hill. If you aren&amp;#39;t familiar with it I recommend you &lt;a href=&#34;https://youtu.be/Os7FE3J-U5Q&#34;&gt;watch this talk from 2013&lt;/a&gt;. It&amp;#39;s about 40 minutes and moves &lt;em&gt;fast&lt;/em&gt; but don&amp;#39;t worry if some of the stuff goes over your head. It&amp;#39;s the basic gist of how things work that&amp;#39;s important, not the actual implementation details.&lt;/p&gt;
&lt;p&gt;
I&amp;#39;m having a really hard time finding a good guide for how to do much of anything with transpilers though. I figured that Racket has been a playground for language prototyping and design for years now, so surely there must be something. There really wasn&amp;#39;t; at least, not that I could find. So, I &lt;a href=&#34;https://www.reddit.com/r/Racket/comments/wdq838/any_good_sourcetosource_compiler_guides/&#34;&gt;asked on the Racket subreddit&lt;/a&gt;. I got some useful responses about Nanopass compilers, but nothing really about tutorials on transpiler creation.&lt;/p&gt;
&lt;p&gt;
&lt;a href=&#34;http://createyourproglang.com/&#34;&gt;Create Your Own Freaking Awesome Programming Language&lt;/a&gt; is still the best i&amp;#39;ve found but I don&amp;#39;t believe it covers multipass compilation. It&amp;#39;s not that I can&amp;#39;t figure out how to do it from the resources available. The problem is that I don&amp;#39;t know what the right way to approach the problem is. What&amp;#39;s the right way to structure my passes? How do i decide how much to tackle in each pass or what order to do them in? The &lt;em&gt;how&lt;/em&gt; isn&amp;#39;t that hard. It&amp;#39;s just learning syntax. It&amp;#39;s the &lt;em&gt;approach&lt;/em&gt; that&amp;#39;s unclear.&lt;/p&gt;
&lt;p&gt;
I don&amp;#39;t know how to &lt;em&gt;think&lt;/em&gt; about compiler design, especially multipass ones.&lt;/p&gt;
&lt;p&gt;
So, last night was a rabbit hole of education. I watched the video linked above. I learned that nanopass compilation isn&amp;#39;t just a general technique but a general technique coupled with a specific framework that has only been implemented in a couple languages (not Janet).&lt;/p&gt;
&lt;p&gt;
As an aside, I&amp;#39;m getting really sick of how much emacs hates inserting tabs, so i went on a little side-track as to what it&amp;#39;d take to define a new language in emacs and have tab indentation be the default there. The long and short of it is that indentation is complicated in emacs, and written by monsters who not only think that spaces are better because they &amp;#34;keep everything the same&amp;#34; when different people have different tab widths, but also think that it&amp;#39;s fine to mix tabs and spaces for indentation so that it minimizes the number of characters used (&lt;em&gt;why?!?!&lt;/em&gt;). &lt;a href=&#34;https://weblog.masukomi.org/2010/07/26/why-you-should-never-indent-code-with-spaces/&#34;&gt;If you care at all about accessibility for low vision users you will stop indenting with spaces.&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;
Anyway. Lots of time. Little actual progress. I then spent far to much time awake in the middle of the night not-quite-dreaming about writing compiler code based on the little I&amp;#39;d learned.&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;

        
        </description>
    </item>
    
    <item>
      <title>Dev Diary 4</title>
      <link>https://tuplet.dev/posts/dev_diary_4/</link>
      <pubDate>Tue, 26 Jul 2022 00:00:00 +0000</pubDate>
      
      <guid>https://tuplet.dev/posts/dev_diary_4/</guid>
      <description>
        
          
          
          
        
        
        
&lt;div id=&#34;outline-container-headline-1&#34; class=&#34;outline-3&#34;&gt;
&lt;h3 id=&#34;headline-1&#34;&gt;
Lambda Lambda Lambda
&lt;/h3&gt;
&lt;div id=&#34;outline-text-headline-1&#34; class=&#34;outline-text-3&#34;&gt;
&lt;p&gt;
I&amp;#39;d come up with the temporary syntax of &lt;code class=&#34;verbatim&#34;&gt;~&amp;gt;[args]{function body}&lt;/code&gt; for lambdas but it was very not in line with the rest of the language, and not at all self-evident, and I just didn&amp;#39;t like it.&lt;/p&gt;
&lt;p&gt;
Then i saw how python handles it:&lt;/p&gt;
&lt;div class=&#34;src src-python&#34;&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-python&#34; data-lang=&#34;python&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;# lambda arguments : expression&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;x &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; &lt;span style=&#34;color:#66d9ef&#34;&gt;lambda&lt;/span&gt; a : a &lt;span style=&#34;color:#f92672&#34;&gt;+&lt;/span&gt; &lt;span style=&#34;color:#ae81ff&#34;&gt;10&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;print(x(&lt;span style=&#34;color:#ae81ff&#34;&gt;5&lt;/span&gt;))&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;
So what if we built off of that? What if &lt;code class=&#34;verbatim&#34;&gt;lambda:&lt;/code&gt; is a special function (basically a macro)?&lt;/p&gt;
&lt;div class=&#34;src src-text&#34;&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-text&#34; data-lang=&#34;text&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;# lambda: []
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;#		do_something:
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;var: plus_ten lambda: [a]
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;	return: +: a 10
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;println plus_ten: 5
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;#=&amp;gt; outputs 15&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;
under the covers it&amp;#39;d be converted to&lt;/p&gt;
&lt;div class=&#34;src src-scheme&#34;&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-scheme&#34; data-lang=&#34;scheme&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;(&lt;span style=&#34;color:#a6e22e&#34;&gt;def&lt;/span&gt; x (&lt;span style=&#34;color:#a6e22e&#34;&gt;fn&lt;/span&gt; [a]
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;           (+ a &lt;span style=&#34;color:#ae81ff&#34;&gt;10&lt;/span&gt;)))
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;(&lt;span style=&#34;color:#a6e22e&#34;&gt;print&lt;/span&gt;  (&lt;span style=&#34;color:#a6e22e&#34;&gt;x&lt;/span&gt; &lt;span style=&#34;color:#ae81ff&#34;&gt;5&lt;/span&gt;) )&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;
Janet&amp;#39;s fine with printing a non-string value so we don&amp;#39;t have to wrap it in a &lt;code class=&#34;verbatim&#34;&gt;(string/format &amp;#34;%s&amp;#34; (x 5))&lt;/code&gt; or anything like that.&lt;/p&gt;
&lt;p&gt;
Here&amp;#39;s what it&amp;#39;d look like using it in a map.&lt;/p&gt;
&lt;div class=&#34;src src-text&#34;&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-text&#34; data-lang=&#34;text&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;map: a_list lambda: [x]
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;				return: +: x 11
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;map: a_list &amp;lt;lambda: [x]
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;				return: +: x 11&amp;gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;map: a_list plus_ten&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;
The first 2 convert to&lt;/p&gt;
&lt;div class=&#34;src src-scheme&#34;&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-scheme&#34; data-lang=&#34;scheme&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;(map (&lt;span style=&#34;color:#a6e22e&#34;&gt;fn&lt;/span&gt; [x]
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;         (+ x &lt;span style=&#34;color:#ae81ff&#34;&gt;11&lt;/span&gt;)) a_list)&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;
and the last is&lt;/p&gt;
&lt;div class=&#34;src src-scheme&#34;&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-scheme&#34; data-lang=&#34;scheme&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;(map plus_ten a_list)&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;
We learn 2 things from the above.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;yup, looks legit. Not only that, looks like any other function call. YAAAY&lt;/li&gt;
&lt;li&gt;it&amp;#39;s legal to indent as many levels as you want in a single line.
in this case going from 1 to 3. We already knew it was legal to dedent
multiple levels. Now I&amp;#39;m explicitly declaring that as acceptable.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;And yes, I&amp;#39;ve decided to make maps function as &lt;code class=&#34;verbatim&#34;&gt;map: list function&lt;/code&gt; instead of the lisp standard of &lt;code class=&#34;verbatim&#34;&gt;(map function list)&lt;/code&gt; becasue the &amp;#34;normal&amp;#34; order always felt weird to me.&lt;/p&gt;
&lt;p&gt;
And that colon after &lt;code class=&#34;verbatim&#34;&gt;return:&lt;/code&gt; is still bugging me. Also, I&amp;#39;m just &lt;em&gt;not&lt;/em&gt; a fan of the explicit return in a lambda. In that context it feels excessively verbose. To me a lambda is all &amp;#34;hey i just need a quickie function in here that isn&amp;#39;t going to be referenced anywhere else.&amp;#34; You rarely write a lambda for side-effects. They tend to be written explicitly for their return value.&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id=&#34;outline-container-headline-2&#34; class=&#34;outline-3&#34;&gt;
&lt;h3 id=&#34;headline-2&#34;&gt;
Return
&lt;/h3&gt;
&lt;div id=&#34;outline-text-headline-2&#34; class=&#34;outline-text-3&#34;&gt;
&lt;p&gt;I&amp;#39;m explicitly requiring &lt;code class=&#34;verbatim&#34;&gt;return&lt;/code&gt; to be called in a function for two reasons:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;when functions have &lt;em&gt;implicit&lt;/em&gt; returns it is frequently impossible to tell if the thing a function is returning is something you can rely on, or just the coincidental output of the last line of a function. That is to say, I don&amp;#39;t know if i can trust that your function will always return a boolean as it is now, or if that was just an unintented side-effect of the last action you performed in you rfunction.&lt;/li&gt;
&lt;li&gt;it&amp;#39;s sometimes non-obvious what a function is or could be returning, and you have to spend a couple minutes working your way through its branches to figure it out.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;So, that&amp;#39;s why I&amp;#39;m calling it out in lambdas. However, as I write this, I&amp;#39;m realizing that contracts would solve this problem.&lt;/p&gt;
&lt;p&gt;
There could be a compile-time check to see if a function has a contract, and if so, doesn&amp;#39;t require a &lt;code class=&#34;verbatim&#34;&gt;return&lt;/code&gt;, but any function without a contract, would require one. I&amp;#39;m not sure I like the inconsistent result then. Some functions would have a &lt;code class=&#34;verbatim&#34;&gt;return&lt;/code&gt; and some wouldn&amp;#39;t.&lt;/p&gt;
&lt;p&gt;
…
Just fixed &lt;code class=&#34;verbatim&#34;&gt;return&lt;/code&gt; so that it no longer needs a colon after it. I needed to move the &lt;code class=&#34;verbatim&#34;&gt;RETURN&lt;/code&gt; token down below the &lt;code class=&#34;verbatim&#34;&gt;FUNCTION_NAME&lt;/code&gt; token that referenced it.&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id=&#34;outline-container-headline-3&#34; class=&#34;outline-3&#34;&gt;
&lt;h3 id=&#34;headline-3&#34;&gt;
Line continuation
&lt;/h3&gt;
&lt;div id=&#34;outline-text-headline-3&#34; class=&#34;outline-text-3&#34;&gt;
&lt;p&gt;I&amp;#39;m running into instances where it&amp;#39;s just not clear what function the following line is an argument to. For example:&lt;/p&gt;
&lt;div class=&#34;src src-text&#34;&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-text&#34; data-lang=&#34;text&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;        if: and: x true
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;            y
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;            z&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;
It would be legitimate to assume that &lt;code class=&#34;verbatim&#34;&gt;y&lt;/code&gt; is a 3rd parameter to &lt;code class=&#34;verbatim&#34;&gt;and:&lt;/code&gt;. It&amp;#39;s on a new line, and it&amp;#39;s indented more than the prior line. At the same time, it&amp;#39;s also reasonable to assume that it&amp;#39;s a 2nd argument to &lt;code class=&#34;verbatim&#34;&gt;if:&lt;/code&gt; which Is what I intended it as.&lt;/p&gt;
&lt;p&gt;
The current solution to this would be to say&lt;/p&gt;
&lt;div class=&#34;src src-text&#34;&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-text&#34; data-lang=&#34;text&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;        if: &amp;lt;and: x true&amp;gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;            y
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;            z&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;
And that&amp;#39;s fine, but the code is waving a metaphorical red flag at me and letting me know that we&amp;#39;re going to need the ability to say &amp;#34;this thing continues on the next line.&amp;#34; Python has it, and those folks know what they&amp;#39;re doing with indentation.&lt;/p&gt;
&lt;p&gt;
Yes, I really should brush up on my Python here rather than re-inventing their wheel badly, but until then, I&amp;#39;ve decided that my continuation string will be &lt;code class=&#34;verbatim&#34;&gt;...&lt;/code&gt; or an actual elipsis (&lt;code class=&#34;verbatim&#34;&gt;…&lt;/code&gt;). Because an elipsis indicates that the sentence / line has literally trailed off without completing.&lt;/p&gt;
&lt;p&gt;
I&amp;#39;ll figure out what the right rules around its usage are later. Correction, I&amp;#39;ll shamelessly rip-off Python&amp;#39;s rules for its usage later.&lt;/p&gt;
&lt;p&gt;
Python rules: &amp;#34;Line continuation is automatic when the split comes while a statement is inside parenthesis ( &lt;code&gt;()&lt;/code&gt; ), brackets ( &lt;code class=&#34;verbatim&#34;&gt;[]&lt;/code&gt; ) or braces ( &lt;code class=&#34;verbatim&#34;&gt;{}&lt;/code&gt; ).&amp;#34; - &lt;a href=&#34;https://developer.rhino3d.com/guides/rhinopython/python-statements/&#34;&gt;Rhino Developer&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;
So, there&amp;#39;s your answer. You need the line continuation indicator whenever the line is continuing but it&amp;#39;s not in a grouping. That… doesn&amp;#39;t actually work for me. I want this to be valid syntax:&lt;/p&gt;
&lt;div class=&#34;src src-text&#34;&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-text&#34; data-lang=&#34;text&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;        if: true
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;            do_this:
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;            do_that:&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;
So, back to this&lt;/p&gt;
&lt;div class=&#34;src src-text&#34;&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-text&#34; data-lang=&#34;text&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;        if: and: x true
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;            y
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;            z&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;
I think it&amp;#39;s just too ambiguous. I can&amp;#39;t describe a rule in english that clearly describes that such that &lt;code class=&#34;verbatim&#34;&gt;y&lt;/code&gt; is unambiguously an argument to &lt;code class=&#34;verbatim&#34;&gt;if:&lt;/code&gt; and not &lt;code class=&#34;verbatim&#34;&gt;and:&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;
Also, I just realized that it&amp;#39;s &lt;em&gt;also&lt;/em&gt; not clear if &lt;code class=&#34;verbatim&#34;&gt;x&lt;/code&gt; is an argument of &lt;code class=&#34;verbatim&#34;&gt;if:&lt;/code&gt; or &lt;code class=&#34;verbatim&#34;&gt;and:&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;
So, that means we have to do this&lt;/p&gt;
&lt;div class=&#34;src src-text&#34;&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-text&#34; data-lang=&#34;text&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;        if:
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;            and:
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;                x true
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;            y
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;            z&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;
Or&lt;/p&gt;
&lt;div class=&#34;src src-text&#34;&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-text&#34; data-lang=&#34;text&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;        if: &amp;lt;and: x true&amp;gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;            y
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;            z&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;

        
        </description>
    </item>
    
    <item>
      <title>Dev Diary 2</title>
      <link>https://tuplet.dev/posts/dev_diary_2/</link>
      <pubDate>Sun, 24 Jul 2022 00:00:00 +0000</pubDate>
      
      <guid>https://tuplet.dev/posts/dev_diary_2/</guid>
      <description>
        
          
          
          
        
        
        
&lt;div id=&#34;outline-container-headline-1&#34; class=&#34;outline-2&#34;&gt;
&lt;h2 id=&#34;headline-1&#34;&gt;
The Language So far
&lt;/h2&gt;
&lt;div id=&#34;outline-text-headline-1&#34; class=&#34;outline-text-2&#34;&gt;
&lt;p&gt;In &lt;a href=&#34;dev_diary_1.html&#34;&gt;the prior post&lt;/a&gt; I described how Tuplet came to be. This post is going to lay out where the language stands &lt;em&gt;today&lt;/em&gt;.&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id=&#34;outline-container-headline-2&#34; class=&#34;outline-2&#34;&gt;
&lt;h2 id=&#34;headline-2&#34;&gt;
What is actually written
&lt;/h2&gt;
&lt;div id=&#34;outline-text-headline-2&#34; class=&#34;outline-text-2&#34;&gt;
&lt;p&gt;As of today, it&amp;#39;s just a grammar. Antlr can convert this into a lexer and parser for me, but before I do that I&amp;#39;ll have to &lt;a href=&#34;https://github.com/antlr/antlr4/blob/master/doc/creating-a-language-target.md&#34;&gt;create a new language target for Antlr&lt;/a&gt;. Specifically, I need to create a target for &lt;a href=&#34;https://janet-lang.org&#34;&gt;Janet&lt;/a&gt;. I could use one of the existing language targets like Go, but then the tool-chain would be &lt;code class=&#34;verbatim&#34;&gt;Tuplet-&amp;gt;Go(executable)-&amp;gt;Janet-&amp;gt;C-&amp;gt;executable&lt;/code&gt; which would require working in 3 languages (Tuplet, Go, and Janet) to expand the language, and that just seems ridiculous. Heck, &lt;code class=&#34;verbatim&#34;&gt;Tuplet-&amp;gt;Janet-&amp;gt;C-&amp;gt;executable&lt;/code&gt; seems ridiculous. At least the &lt;code class=&#34;verbatim&#34;&gt;Janet-&amp;gt;C&lt;/code&gt; portion of it is invisible.&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;

        
        </description>
    </item>
    
    <item>
      <title>Dev_diary_3</title>
      <link>https://tuplet.dev/posts/dev_diary_3/</link>
      <pubDate>Sun, 24 Jul 2022 00:00:00 +0000</pubDate>
      
      <guid>https://tuplet.dev/posts/dev_diary_3/</guid>
      <description>
        
          
          
          
        
        
        
&lt;div id=&#34;outline-container-headline-1&#34; class=&#34;outline-2&#34;&gt;
&lt;h2 id=&#34;headline-1&#34;&gt;
Building an Antlr4 Language Target
&lt;/h2&gt;
&lt;div id=&#34;outline-text-headline-1&#34; class=&#34;outline-text-2&#34;&gt;
&lt;p&gt;
As mentioned in &lt;a href=&#34;dev_diary_2.html&#34;&gt;the last post&lt;/a&gt; I need to &lt;a href=&#34;https://github.com/antlr/antlr4/blob/master/doc/creating-a-language-target.md&#34;&gt;create an Antlr4 language target&lt;/a&gt; for &lt;a href=&#34;https://janet-lang.org/&#34;&gt;Janet&lt;/a&gt; (the language Tuplet will compile to). There are 4 &lt;em&gt;minor&lt;/em&gt; problems.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;I&amp;#39;ve never created an Antlr language target&lt;/li&gt;
&lt;li&gt;There are no existing Antlr language targets for a lisp to learn / copy from.&lt;/li&gt;
&lt;li&gt;I haven&amp;#39;t touched Java since like 2009 (13yrs).&lt;/li&gt;
&lt;li&gt;I&amp;#39;ve never programmed &lt;em&gt;anything&lt;/em&gt; more sophisticated than a &amp;#34;hello world&amp;#34; in Janet.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;So that&amp;#39;s &amp;#34;fun&amp;#34;.&lt;/p&gt;
&lt;div id=&#34;outline-container-headline-2&#34; class=&#34;outline-3&#34;&gt;
&lt;h3 id=&#34;headline-2&#34;&gt;
Step 1
&lt;/h3&gt;
&lt;div id=&#34;outline-text-headline-2&#34; class=&#34;outline-text-3&#34;&gt;
&lt;p&gt;I need to create a template for a Janet module. So, I need to &lt;em&gt;learn how&lt;/em&gt; Janet handles modules.&lt;/p&gt;
&lt;div id=&#34;outline-container-headline-3&#34; class=&#34;outline-4&#34;&gt;
&lt;h4 id=&#34;headline-3&#34;&gt;
Sidetrack 1: function names
&lt;/h4&gt;
&lt;div id=&#34;outline-text-headline-3&#34; class=&#34;outline-text-4&#34;&gt;
&lt;p&gt;This of course, leads me to think about functions, which … long story short, = just added the ability to have some more funky characters in function names:&lt;/p&gt;
&lt;div class=&#34;src src-text&#34;&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-text&#34; data-lang=&#34;text&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;fragment FUNCTION_ID_CONTINUE
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt; : ID_START
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt; | [/&amp;gt;&amp;lt;=-] | DIGIT&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;
Now you can have a &lt;code class=&#34;verbatim&#34;&gt;x-&amp;gt;string:&lt;/code&gt; function or &lt;code class=&#34;verbatim&#34;&gt;x==y:&lt;/code&gt; function or &lt;code class=&#34;verbatim&#34;&gt;x2d-&amp;gt;3d:&lt;/code&gt; function. Still not allowing you to start a function with anything other than a letter. Sadly, still only ASCII letters because I haven&amp;#39;t figured out the incantation for any letter of any language without including underscore which regexp seems to think is a &amp;#34;word character&amp;#34;.&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id=&#34;outline-container-headline-4&#34; class=&#34;outline-4&#34;&gt;
&lt;h4 id=&#34;headline-4&#34;&gt;
Sidetrack 2: private functions
&lt;/h4&gt;
&lt;div id=&#34;outline-text-headline-4&#34; class=&#34;outline-text-4&#34;&gt;
&lt;p&gt;Janet has a concept of private functions that aren&amp;#39;t exported with the module. Also private constants.&lt;/p&gt;
&lt;p&gt;
I have wanted to implement this but haven&amp;#39;t gotten around to it. Now it&amp;#39;s relevant. In Janet a private function looks like this &lt;code class=&#34;verbatim&#34;&gt;(defn- ...)&lt;/code&gt; but a public function is &lt;code class=&#34;verbatim&#34;&gt;(defn ...)&lt;/code&gt;. Constants are similar &lt;code class=&#34;verbatim&#34;&gt;(def- ...)&lt;/code&gt; is a private constant and &lt;code class=&#34;verbatim&#34;&gt;(def ...)&lt;/code&gt; is a public constant. Constants because they&amp;#39;re not mutable. Variables, oddly take a 2nd parameter… &lt;code class=&#34;verbatim&#34;&gt;(var \*private-var\* :private)&lt;/code&gt;&lt;/p&gt;
&lt;div class=&#34;src src-janet&#34;&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code class=&#34;language-janet&#34; data-lang=&#34;janet&#34;&gt;# public constant
(def my-public-constant &amp;#34;docs&amp;#34; :abc)
# private constant
(def- my-private-constant &amp;#34;docs&amp;#34; :abc)

# public function
(defn my-function &amp;#34;docs&amp;#34; ... )
# private function
(defn- my-private-function &amp;#34;docs&amp;#34; ... )

# public variable
(var *api-var* &amp;#34;docs&amp;#34; nil)
# private variable
(var *private-var* :private &amp;#34;docs&amp;#34; 123)
# ^^^ inconsistent stuff like this is why i&amp;#39;m writing a language
# why isn&amp;#39;t it just var- ?
# i think you can use :private with def too???&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;
It seems easier to just handle all the forms of function definition up front rather than going back and handling it later, so, now I need to decide how to handle privacy in my lang. Are there just 2 levels: Private and Public? Or maybe 3 like Java: Private, Protected, and Public. I think I can get pretty far with just 2. Realistically I haven&amp;#39;t encountered any practical use of Ruby&amp;#39;s &lt;code class=&#34;verbatim&#34;&gt;protected&lt;/code&gt; in my day job in years. I seem to recall it being useful in Java ~20 years ago…&lt;/p&gt;
&lt;p&gt;
I know I said handle it all now, but &amp;#34;protected&amp;#34; is different. It opens up a &lt;em&gt;lot&lt;/em&gt; of questions and complexity. So, we&amp;#39;ll deal with that as we need it. &lt;em&gt;If&lt;/em&gt; we need it.&lt;/p&gt;
&lt;p&gt;
So how to handle &lt;code class=&#34;verbatim&#34;&gt;private&lt;/code&gt;? My initial instinct was to emulate ruby and add a &lt;code class=&#34;verbatim&#34;&gt;private&lt;/code&gt; keyword and everything that came after that in the file was private. But, that leads to weird separation of methods between the public method and the private internal ones it relies on. Also, there&amp;#39;s no way to visually distinguish between a public method name and a private method name and that violates two of the guiding principles.&lt;/p&gt;
&lt;p&gt;
So, new rule. Starting a function name with &lt;code class=&#34;verbatim&#34;&gt;p-&lt;/code&gt; designates it as a private function. Thus, when you see &lt;code class=&#34;verbatim&#34;&gt;p-multiply:&lt;/code&gt; you know that you&amp;#39;re looking at a private function that, presumably, multiplies things. &lt;code class=&#34;verbatim&#34;&gt;@P_THINGY&lt;/code&gt; would be a private global variable that can&amp;#39;t be seen from outside the module. Non-global variables are always scoped to the function or namespace, and should never be directly accessible from outside.&lt;/p&gt;
&lt;p&gt;
This doesn&amp;#39;t involve any grammar changes because &lt;code class=&#34;verbatim&#34;&gt;p-foo:&lt;/code&gt; is already supported naming for a function. It would involve parser changes, but I haven&amp;#39;t written that yet because I haven&amp;#39;t written the language target which is what I&amp;#39;m ostensibly supposed to be doing &lt;em&gt;right now&lt;/em&gt;.&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id=&#34;outline-container-headline-5&#34; class=&#34;outline-4&#34;&gt;
&lt;h4 id=&#34;headline-5&#34;&gt;
Something something modules
&lt;/h4&gt;
&lt;div id=&#34;outline-text-headline-5&#34; class=&#34;outline-text-4&#34;&gt;
&lt;blockquote&gt;
&lt;p&gt;By default, modules correspond one-to-one with source files in Janet, although you may override this and structure modules however you like. - Janet docs&lt;/p&gt;
&lt;/blockquote&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id=&#34;outline-container-headline-6&#34; class=&#34;outline-4&#34;&gt;
&lt;h4 id=&#34;headline-6&#34;&gt;
Sidetrack 3:
&lt;/h4&gt;
&lt;div id=&#34;outline-text-headline-6&#34; class=&#34;outline-text-4&#34;&gt;
&lt;p&gt;Case statements, and if statements.
For if statements the plan was to just go with standard scheme for now:&lt;/p&gt;
&lt;div class=&#34;src src-scheme&#34;&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-scheme&#34; data-lang=&#34;scheme&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;(&lt;span style=&#34;color:#66d9ef&#34;&gt;if &lt;/span&gt;test true_response false_response)&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;
So, for example&lt;/p&gt;
&lt;div class=&#34;src src-text&#34;&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-text&#34; data-lang=&#34;text&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;if: true
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    println: &amp;#34;twas true&amp;#34;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    println: &amp;#34;twas false&amp;#34;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;
Simple right?&lt;/p&gt;
&lt;p&gt;
Then i realized i have the potential for variables of multiple types, which meant my contract grammar needed to support it. I thought i&amp;#39;d handled that case but went to check. Nope. Turns out i only handled it in a former incarnation of contracts which were just glorified type annotations.&lt;/p&gt;
&lt;p&gt;
So, I went to implement the grammar for that, and in the process decided to write an example implementation of the &lt;code class=&#34;verbatim&#34;&gt;contract:&lt;/code&gt; function. Well, that involved the need for a  &lt;code class=&#34;verbatim&#34;&gt;case:&lt;/code&gt; function which I hadn&amp;#39;t tried implementing, and that led to the following if statement&lt;/p&gt;
&lt;div class=&#34;src src-text&#34;&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-text&#34; data-lang=&#34;text&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;var: a_list [1 2 3]
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;if: &amp;gt;: size: a_list
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;		2
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;	println: &amp;#34;big list&amp;#34;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;	println: &amp;#34;small list&amp;#34;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;	return: true&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;
That should convert to&lt;/p&gt;
&lt;div class=&#34;src src-scheme&#34;&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-scheme&#34; data-lang=&#34;scheme&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;(&lt;span style=&#34;color:#66d9ef&#34;&gt;if &lt;/span&gt;(&amp;gt; (&lt;span style=&#34;color:#a6e22e&#34;&gt;size&lt;/span&gt; a_list) &lt;span style=&#34;color:#ae81ff&#34;&gt;2&lt;/span&gt;)
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;	(&lt;span style=&#34;color:#a6e22e&#34;&gt;println&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;big list&amp;#34;&lt;/span&gt;)
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;	(&lt;span style=&#34;color:#a6e22e&#34;&gt;println&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;small list&amp;#34;&lt;/span&gt;)
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;	true)&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;
but the tuplet version completely violates the guideline of removing ambiguity.&lt;/p&gt;
&lt;p&gt;
This isn&amp;#39;t an option&lt;/p&gt;
&lt;div class=&#34;src src-text&#34;&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-text&#34; data-lang=&#34;text&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;if: &amp;gt;: size: a_list 2&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;because 2 becomes an argument to &lt;code class=&#34;verbatim&#34;&gt;size:&lt;/code&gt; not &lt;code class=&#34;verbatim&#34;&gt;&amp;gt;:&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;
This works, but it&amp;#39;s gross.&lt;/p&gt;
&lt;div class=&#34;src src-text&#34;&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-text&#34; data-lang=&#34;text&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;if:
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &amp;gt;: size: a_list
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;        2&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;
this is clearer, but still gross and annoying to type&lt;/p&gt;
&lt;div class=&#34;src src-text&#34;&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-text&#34; data-lang=&#34;text&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;if:
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;     &amp;gt;:
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;         size: a_list
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;         2&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;
Really, I need a grouping operator that isn&amp;#39;t just another array.&lt;/p&gt;
&lt;p&gt;
Parentheses would be the most obvious but I want to reserve those for raw lisp. I&amp;#39;m thinking there are 2 obvious options:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;grouping with angle brackets &lt;code class=&#34;verbatim&#34;&gt;&amp;lt; ... &amp;gt;&lt;/code&gt;
this works because calling less than or greater than functions always have a trailing colon: (&lt;code class=&#34;verbatim&#34;&gt;&amp;gt;:&lt;/code&gt; and &lt;code class=&#34;verbatim&#34;&gt;&amp;lt;:&lt;/code&gt;) so that you know it&amp;#39;s a function call.&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;grouping with parentheses, which means doing something else for raw lisp…&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code class=&#34;verbatim&#34;&gt;~(raw lisp)&lt;/code&gt; or &lt;code class=&#34;verbatim&#34;&gt;l(raw lisp)&lt;/code&gt; or &lt;code class=&#34;verbatim&#34;&gt;lisp(raw lisp)&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;I&amp;#39;m leaning towards angle brackets because people tend to be familiar with their use in HTML as a grouping, and it leaves the lisp completely unadulterated.&lt;/p&gt;
&lt;p&gt;
We can also say that the first thing in a grouping is going to be a function that gets called with the remaining arguments, just like lisp.&lt;/p&gt;
&lt;p&gt;
So, that gives us:&lt;/p&gt;
&lt;div class=&#34;src src-text&#34;&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-text&#34; data-lang=&#34;text&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;if: &amp;gt;: &amp;lt;size: a_list&amp;gt; 2&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;
but also this unfortunate case&lt;/p&gt;
&lt;div class=&#34;src src-text&#34;&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-text&#34; data-lang=&#34;text&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;if: &amp;lt;&amp;gt;: &amp;lt;size: a_list&amp;gt; 2&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;I think that would actually work because &lt;code class=&#34;verbatim&#34;&gt;&amp;lt;&amp;gt;:&lt;/code&gt; won&amp;#39;t be interpreted as a function, because functions have to start with a letter unless they&amp;#39;re one of the &amp;#34;special functions&amp;#34; and I don&amp;#39;t like the idea of using &lt;code class=&#34;verbatim&#34;&gt;&amp;lt;&amp;gt;:&lt;/code&gt; as a replacement for &lt;code&gt;!=:&lt;/code&gt; becacuse you should say what you mean not use some esoteric shorthand for is greater than or less than. So, there is no special case for &lt;code class=&#34;verbatim&#34;&gt;&amp;lt;&amp;gt;:&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;
So, it would work, but it&amp;#39;d be ugly, but that&amp;#39;d also be the developer&amp;#39;s choice not a language requirement. There&amp;#39;s no stopping people from writing ugly code.&lt;/p&gt;
&lt;p&gt;
So, time to add angle brackets to the grammar….&lt;/p&gt;
&lt;p&gt;
In the process of doing that I discovered that there&amp;#39;s a problem with the grammer with regards to &lt;code class=&#34;verbatim&#34;&gt;return&lt;/code&gt;. It only seems to want to lex correctly as a function: &lt;code class=&#34;verbatim&#34;&gt;return:&lt;/code&gt; but I&amp;#39;m getting a headache and decided it wasn&amp;#39;t worth fighting over. So, for now i return with &lt;code class=&#34;verbatim&#34;&gt;return:&lt;/code&gt; not &lt;code class=&#34;verbatim&#34;&gt;return&lt;/code&gt;. A fight for another day. I think it should be without the colon because it&amp;#39;s not going to behave like a normal function in that it can break you out of a loop like &lt;code class=&#34;verbatim&#34;&gt;break&lt;/code&gt; or break out of a function early.&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;

        
        </description>
    </item>
    
    <item>
      <title>Dev Diary 1</title>
      <link>https://tuplet.dev/posts/dev_diary_1/</link>
      <pubDate>Sat, 23 Jul 2022 00:00:00 +0000</pubDate>
      
      <guid>https://tuplet.dev/posts/dev_diary_1/</guid>
      <description>
        
          
          
          
        
        
        
&lt;p&gt;
This first development diary is going to be long. There&amp;#39;s a lot of thinking to write down before I can catch you up to where I today; July 23, 2022.&lt;/p&gt;
&lt;div id=&#34;outline-container-headline-1&#34; class=&#34;outline-3&#34;&gt;
&lt;h3 id=&#34;headline-1&#34;&gt;
The origins of Tuplet
&lt;/h3&gt;
&lt;div id=&#34;outline-text-headline-1&#34; class=&#34;outline-text-3&#34;&gt;
&lt;p&gt;
I write &lt;em&gt;&lt;a href=&#34;https://github.com/masukomi/masuconfigs/tree/master/bin&#34;&gt;a lot of utility scripts&lt;/a&gt;&lt;/em&gt;. For years I&amp;#39;ve been writing them in Bash becasue I&amp;#39;ve wanted them to be something I could share with my peers. One day, I just got sick of having to fight with yet another piece of Bash&amp;#39;s weird syntax. I&amp;#39;ve wanted to write my own language for years, something that was more tailored to the way my brain worked, and the ways I&amp;#39;ve come to believe a programming language should work.&lt;/p&gt;
&lt;p&gt;
I decided I wasn&amp;#39;t going to fight with Bash any more. I was going to act upon my dreams and build a language for me, but it&amp;#39;d compile to Bash so that I could still create those utility scripts that I could share with my peers. So, that&amp;#39;s what I set out to do.&lt;/p&gt;
&lt;p&gt;
One day I was working out how arrays would function, and I went down a little rabbit hole of what it takes to pass arrays into and out of functions in Bash. It wasn&amp;#39;t pretty, and it required Bash 4.4 or higher if you wanted any hope of doing it without truly ugly hacks.&lt;/p&gt;
&lt;p&gt;
I continued on though, until I tried to write a string-split function as part of the standard library. I ended up on &lt;a href=&#34;https://stackoverflow.com/a/45201229/13973&#34;&gt;this amazing Stack Overflow answer&lt;/a&gt;, and spent the next couple hours trying to make it actually work. &lt;em&gt;The. Next. Couple. Hours.&lt;/em&gt; It took me hours, with explicit – although imperfect – instructions to write a function that split a string on spaces. Hours. I&amp;#39;ve been coding professionally for nearly 30 years, and it took me &lt;em&gt;hours&lt;/em&gt; to write a generic form of that function, and I had to compromise to do it too.&lt;/p&gt;
&lt;p&gt;
That was the &amp;#34;straw that broke the camel&amp;#39;s back&amp;#34;, but the decision to abandon Bash fully took a couple more days to sink in. It was the realization that even if I did succeed, I couldn&amp;#39;t actually give my scripts to any of my peers, because I use macs, and they use macs, and Apple stopped distributing Bash at version 3.2.57. A version that couldn&amp;#39;t run the newer functions I&amp;#39;d need anway. Yes, you can upgrade bash on the mac, but I think &lt;em&gt;very few&lt;/em&gt; geeks actually do.&lt;/p&gt;
&lt;p&gt;
On top of that, was the acceptance of the fact that no-one cares about my scripts. I&amp;#39;ve got tons of things that&amp;#39;d save people time and effort, and when relevant, I let people know about them. They never ask for details. They never run the ones I share. Or if they do, they never tell me about it.&lt;/p&gt;
&lt;p&gt;
A few more days and the implications of that really sank in.&lt;/p&gt;
&lt;p&gt;
There is &lt;em&gt;absolutely no point&lt;/em&gt;, in my trying to make a language with other people&amp;#39;s needs, or convenience, in mind. No-one&amp;#39;s going to use it, so why should I make something with compromises to satisfy non-existent users.&lt;/p&gt;
&lt;p&gt;
Tuplet is &lt;em&gt;my&lt;/em&gt; langauge. It&amp;#39;s a language &lt;em&gt;for me&lt;/em&gt;. It is purely selfish. That&amp;#39;s not because I don&amp;#39;t want others to use it, but because it&amp;#39;s highly unlikely anyone else ever will. Just like it&amp;#39;s highly unlikely that anyone will ever read this.&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id=&#34;outline-container-headline-2&#34; class=&#34;outline-3&#34;&gt;
&lt;h3 id=&#34;headline-2&#34;&gt;
Finding a target
&lt;/h3&gt;
&lt;div id=&#34;outline-text-headline-2&#34; class=&#34;outline-text-3&#34;&gt;
&lt;p&gt;With bash out of the picture I started hunting around for a target language. I was still holding out hopes of &amp;#34;maybe I can make this easy for folks&amp;#34;, but one of the languages I was considering anyway was [Janet](&lt;a href=&#34;https://janet-lang.org/).&#34;&gt;https://janet-lang.org/).&lt;/a&gt; Janet, is a thoroughly modern Lisp. I don&amp;#39;t know why it took so long for someone to write such a beast, but what&amp;#39;s important is that it exists now.&lt;/p&gt;
&lt;p&gt;
At this point, I&amp;#39;d been iterating on the grammar for a while and had made a lot of progress. One night, I realized that I wasn&amp;#39;t using parentheses for anything, and that that, combined with the fact that I was writing a transpiled language, meant that I could literally write raw lisp in my code, and it would take zero effort to compile it. My parser could literally just go &amp;#34;oh look, stuff in parentheses. Just spit it all out unchanged.&amp;#34; This meant that I could trivially bootstrap the language with lisp until I had a standard library written in itself.&lt;/p&gt;
&lt;p&gt;
It&amp;#39;s important to note that Tuplet is basically a lisp. It&amp;#39;s heavily inspired by the thinking behind &lt;a href=&#34;https://www.draketo.de/software/wisp&#34;&gt;Wisp&lt;/a&gt;, otherwise known as &lt;a href=&#34;https://srfi.schemers.org/srfi-119/srfi-119.html&#34;&gt;SRFI-119&lt;/a&gt;. Wisp is basically just &amp;#34;I wish I could write Scheme but with Python style indentation instead of parentheses all over the place.&amp;#34; Tuplet takes this idea to the next step. It says &amp;#34;That&amp;#39;s cool, but there are a lot of places where languages like Python and Ruby are way, way easier to use.&amp;#34;&lt;/p&gt;
&lt;p&gt;
To put it another way, there are a lot of things I&amp;#39;ve come to love about Ruby and other modern languages, but I also love writing in Scheme.&lt;/p&gt;
&lt;p&gt;
Anyway… the realization that there was no real value in catering to others, combined with a love of Scheme, plus a thoroughly modern lisp that I wanted to use, made me decide to use Janet.&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id=&#34;outline-container-headline-3&#34; class=&#34;outline-3&#34;&gt;
&lt;h3 id=&#34;headline-3&#34;&gt;
Figuring out what I wanted
&lt;/h3&gt;
&lt;div id=&#34;outline-text-headline-3&#34; class=&#34;outline-text-3&#34;&gt;
&lt;p&gt;It&amp;#39;s hard to know what you realy want in a language until you start writing one. So, I just started writing down my ideas in an org file, and then writing grammars to generate lexers and parsers. Long story short, much time was spent, and frustration was had until I decided to use &lt;a href=&#34;https://www.antlr.org/&#34;&gt;Antlr&lt;/a&gt; and it&amp;#39;s fantastic plug-in for the various &lt;a href=&#34;https://www.jetbrains.com/&#34;&gt;JetBrains&lt;/a&gt; editors.&lt;/p&gt;
&lt;p&gt;
As I wrote, and edited, and saw the interplay of features I was designing, the &lt;a href=&#34;guiding_principles.html&#34;&gt;Guiding Principles&lt;/a&gt; began to emerge. Now that those are starting to form decisions are becoming easier because I can use them not only to guide those decisions, but to help understand why I want what I want.&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id=&#34;outline-container-headline-4&#34; class=&#34;outline-3&#34;&gt;
&lt;h3 id=&#34;headline-4&#34;&gt;
The actual language…
&lt;/h3&gt;
&lt;div id=&#34;outline-text-headline-4&#34; class=&#34;outline-text-3&#34;&gt;
&lt;p&gt;…will have to wait for another post. This one enough on it&amp;#39;s own, and there&amp;#39;s a lot of syntax already designed.&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;

        
        </description>
    </item>
    
  </channel>
</rss>