<story><title>WwwBasic – An implementation of BASIC designed to be easy to run on the Web</title><url>https://github.com/google/wwwbasic</url></story><parent_chain><item><author>pedasmith</author><text>New versions of BASIC are surprisingly common (heck, I even have one that&amp;#x27;s gotten some super-nice comments).&lt;p&gt;Mind-blowing BASIC example from the 1970&amp;#x27;s:&lt;p&gt;&lt;pre&gt;&lt;code&gt;    100 A$=&amp;quot;ABCDEF&amp;quot;
    110 A$ = REP (&amp;quot;123&amp;quot;, 4, 0)
    120 PRINT A$
&lt;/code&gt;&lt;/pre&gt;
The result is ABC123DEF -- at position 4 (strings start at 1), replace 0 characters with &amp;quot;123&amp;quot;. So the REP function looks at the statement it&amp;#x27;s part of, finds the variable that is being assigned to, and uses that as the starting string (!). It&amp;#x27;s kind of like a function, only with a weird implied variable that only works in an assignment.&lt;p&gt;You can&amp;#x27;t just PRINT the result directly, because then how would REP know what the string to change is?&lt;p&gt;Nowadays &amp;quot;weird&amp;quot; syntax has some solid foundational reason why it&amp;#x27;s useful or important. This not-really-a-function, though, simply has no justification whatsoever.&lt;p&gt;(This example is from the BASIC embedded in the Tektronix 4050 terminal).&lt;p&gt;There are enough variants of BASIC that there&amp;#x27;s a really nifty handbook with the differences at &lt;a href=&quot;https:&amp;#x2F;&amp;#x2F;archive.org&amp;#x2F;details&amp;#x2F;Basic_Handbook_2nd_Edition_1981_CompuSoft_Publishing&quot; rel=&quot;nofollow&quot;&gt;https:&amp;#x2F;&amp;#x2F;archive.org&amp;#x2F;details&amp;#x2F;Basic_Handbook_2nd_Edition_1981_...&lt;/a&gt;</text></item></parent_chain><comment><author>tralarpa</author><text>I did my first serious programming steps with BASIC on the C64 and the Amiga.&lt;p&gt;The (actually second) BASIC interpreter on the Amiga was made by Microsoft. It was great and horrible at the same time. Great because it had while-loops, labels instead of line numbers, and basic (no pun intended) support for the Amiga GUI, i.e you could open windows and create menus. Horrible because it was super slow and, for some reasons unknown to me, Microsoft had decided to not implement stack frames for subroutines. So, all local variables in subroutines were static and recursions were not allowed.&lt;p&gt;The weird thing: You still had to write the &amp;quot;STATIC&amp;quot; keyword although &lt;i&gt;all&lt;/i&gt; subroutines were static anyway! (I assume the STATIC keyword was optional in the other Microsoft BASIC version and non-static subroutines were supported there)</text></comment>
<story><title>WwwBasic – An implementation of BASIC designed to be easy to run on the Web</title><url>https://github.com/google/wwwbasic</url></story><parent_chain><item><author>pedasmith</author><text>New versions of BASIC are surprisingly common (heck, I even have one that&amp;#x27;s gotten some super-nice comments).&lt;p&gt;Mind-blowing BASIC example from the 1970&amp;#x27;s:&lt;p&gt;&lt;pre&gt;&lt;code&gt;    100 A$=&amp;quot;ABCDEF&amp;quot;
    110 A$ = REP (&amp;quot;123&amp;quot;, 4, 0)
    120 PRINT A$
&lt;/code&gt;&lt;/pre&gt;
The result is ABC123DEF -- at position 4 (strings start at 1), replace 0 characters with &amp;quot;123&amp;quot;. So the REP function looks at the statement it&amp;#x27;s part of, finds the variable that is being assigned to, and uses that as the starting string (!). It&amp;#x27;s kind of like a function, only with a weird implied variable that only works in an assignment.&lt;p&gt;You can&amp;#x27;t just PRINT the result directly, because then how would REP know what the string to change is?&lt;p&gt;Nowadays &amp;quot;weird&amp;quot; syntax has some solid foundational reason why it&amp;#x27;s useful or important. This not-really-a-function, though, simply has no justification whatsoever.&lt;p&gt;(This example is from the BASIC embedded in the Tektronix 4050 terminal).&lt;p&gt;There are enough variants of BASIC that there&amp;#x27;s a really nifty handbook with the differences at &lt;a href=&quot;https:&amp;#x2F;&amp;#x2F;archive.org&amp;#x2F;details&amp;#x2F;Basic_Handbook_2nd_Edition_1981_CompuSoft_Publishing&quot; rel=&quot;nofollow&quot;&gt;https:&amp;#x2F;&amp;#x2F;archive.org&amp;#x2F;details&amp;#x2F;Basic_Handbook_2nd_Edition_1981_...&lt;/a&gt;</text></item></parent_chain><comment><author>pvg</author><text>Isn&amp;#x27;t that just someone putting some weird thing in some oddball BASIC implementation? I don&amp;#x27;t think any of the popular ones did anything like that.</text></comment>