<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-5660420964559314809</id><updated>2011-11-16T16:51:35.390-08:00</updated><title type='text'>Yabasic</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://yabasicblog.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5660420964559314809/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://yabasicblog.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Thomas Larsen</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>19</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-5660420964559314809.post-8253362689721815660</id><published>2010-03-30T17:49:00.000-07:00</published><updated>2010-03-30T17:51:59.646-07:00</updated><title type='text'>Blog moved</title><content type='html'>The Yabasic blog now uses Wordpress. It is located at &lt;a href="http://yabasic.basicprogramming.org/blog/"&gt;yabasic.basicprogramming.org&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;See you there!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5660420964559314809-8253362689721815660?l=yabasicblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://yabasicblog.blogspot.com/feeds/8253362689721815660/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://yabasicblog.blogspot.com/2010/03/blog-moved.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5660420964559314809/posts/default/8253362689721815660'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5660420964559314809/posts/default/8253362689721815660'/><link rel='alternate' type='text/html' href='http://yabasicblog.blogspot.com/2010/03/blog-moved.html' title='Blog moved'/><author><name>Thomas Larsen</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5660420964559314809.post-3137629037691351976</id><published>2010-02-12T20:27:00.001-08:00</published><updated>2010-02-12T20:27:35.175-08:00</updated><title type='text'>Yabasic 2.9.10 is out</title><content type='html'>&lt;!-- Yabasic 2.9.10 is out --&gt;&lt;p&gt;&lt;i&gt;I should prefix this by apologising for my lack of activity on Yabasic over the last couple of weeks. I have been extremely busy, and this is likely to continue. I do intend to daily spend some time working on Yabasic.&lt;/i&gt;&lt;/p&gt;&lt;p&gt;Yabasic 2.9.10 is &lt;a href="http://yabasic.basicprogramming.org/download.html"&gt;available for download&lt;/a&gt;. It is primarily a bug-fix release, and the only real addition is that you can specify a "symbol prefix" when importing a file or library. For example:&lt;/p&gt;&lt;pre&gt;use "curses" as c&lt;br /&gt;&lt;br /&gt;c.init ()&lt;br /&gt;&lt;/pre&gt;&lt;p&gt;Essentially, if "&lt;code&gt;as &amp;lt;prefix&amp;gt;&lt;/code&gt;" appears after the name of a file passed to &lt;i&gt;import&lt;/i&gt; or &lt;i&gt;use&lt;/i&gt;, all the symbols in that file will be prefixed with "&lt;i&gt;&amp;lt;prefix&amp;gt;.&lt;/i&gt;". If you have time, could you please check this out and report any bugs that you find?&lt;/p&gt;&lt;p&gt;This version, like the last, doesn't include any modules by default. That is not to say that Pedro's SDL module, for example, is not any good&amp;mdash;quite the contrary! I'm still playing around with different implementations of the module system (focusing in particular on module installation), and I need to do a bit more work in order to ensure that it is solid, stable, and "fool-proof". I'm in the process of creating a Curses module, which is helping me to test the module system.&lt;/p&gt;&lt;p&gt;Thanks, by the way, for expressing your views on the forums about features that you think should be re-added to Yabasic. I'll spend some time reading the various discussions, and I'll probably follow up with a post on this blog.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5660420964559314809-3137629037691351976?l=yabasicblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://yabasicblog.blogspot.com/feeds/3137629037691351976/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://yabasicblog.blogspot.com/2010/02/yabasic-2910-is-out.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5660420964559314809/posts/default/3137629037691351976'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5660420964559314809/posts/default/3137629037691351976'/><link rel='alternate' type='text/html' href='http://yabasicblog.blogspot.com/2010/02/yabasic-2910-is-out.html' title='Yabasic 2.9.10 is out'/><author><name>Thomas Larsen</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5660420964559314809.post-7584114704390491452</id><published>2010-01-26T20:03:00.000-08:00</published><updated>2010-01-26T20:50:01.347-08:00</updated><title type='text'>Releasing Yabasic 2.9.9, featuring modules and structures combined</title><content type='html'>&lt;!--Releasing Yabasic 2.9.9, featuring modules and structures combined--&gt;&lt;p&gt;Yabasic 2.9.9 is now &lt;a href="http://yabasic.basicprogramming.org/download.html"&gt;available for download&lt;/a&gt;. It isn't polished (just look at &lt;i&gt;todo.txt&lt;/i&gt;!), but nevertheless I invite you to test it, experiment with it, and report any bugs that you find.&lt;/p&gt;&lt;p&gt;What's new in 2.9.9?&lt;/p&gt;&lt;ul&gt;&lt;li&gt;In theory, modules are now fully integrated into Yabasic.&lt;/li&gt;&lt;li&gt;There are two new command-line options, &lt;i&gt;--library-path&lt;/i&gt; and &lt;i&gt;--module-path&lt;/i&gt;, which allow you to specify the directories that libraries and modules are loaded from respectively.&lt;/li&gt;&lt;li&gt;Now, the default module and library paths are relative (on Unix-like systems, &lt;i&gt;modules/&lt;/i&gt; and &lt;i&gt;libraries/&lt;/i&gt;; on Windows systems, &lt;i&gt;modules\&lt;/i&gt; and &lt;i&gt;libraries\&lt;/i&gt;). (Could someone please ensure that this works on Windows?)&lt;/li&gt;&lt;li&gt;There is a new special function (or array variable) called &lt;code&gt;__arg$ ()&lt;/code&gt; (synonym &lt;code&gt;__args$ ()&lt;/code&gt;). It takes a single numerical parameter, the number of an argument passed to Yabasic at startup. If the specified parameter is within range, the argument is returned as a string, otherwise an empty string (&lt;code&gt;""&lt;/code&gt;) is returned.&lt;/li&gt;&lt;li&gt;Several bugs have been fixed.&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;I have tried to integrate Pedro's module code into Yabasic, but I may have left bits out accidentally (although I used &lt;code&gt;vimdiff&lt;/code&gt; to check everything). Please let me know if you find any mistakes or omissions.&lt;/p&gt;&lt;p&gt;I managed to eliminate all compilation warnings. I did make three significant changes related to modules:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;I've used the term "module" throughout, as opposed to "plugin". I don't really have a major preference, but it is important that we use the same term consistently in order to avoid confusing users. It would be very easy to change to using "plugin" if that's what people prefer, but we would need to use it consistently. (By the way, the file extension for modules is now &lt;i&gt;.ybm&lt;/i&gt; rather than &lt;i&gt;.ybp&lt;/i&gt;.)&lt;/li&gt;&lt;li&gt;I've "expanded" some of the abbreviated symbol prefixes used by Pedro. For example, I changed &lt;code&gt;ybpi_&lt;/code&gt; to &lt;code&gt;yabmod_interface_&lt;/code&gt;, and &lt;code&gt;ybpf_&lt;/code&gt; to &lt;code&gt;yabmod_function_&lt;/code&gt;. (The main reason for this change is simple: to make modules more usable and understandable to inexperienced users.) Consequently, some of the existing module code (the SDL module, for example) will need to be changed in order to reflect the new symbol prefixes.&lt;/li&gt;&lt;li&gt;I've eliminated the anonymous variadic macro &lt;code&gt;CHECK_FUNCTION_CALL&lt;/code&gt;, which was used to check module function calls; such macros are not permitted in standard ISO C. It would, I think, be possible to write a function to perform the same task (using &lt;code&gt;va_arg&lt;/code&gt; and family) in an ISO C-compatible way, or alternatively to write several macros each taking a particular number of arguments.&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;You will need to compile modules manually for the time being; the &lt;i&gt;.ybm&lt;/i&gt; file should end up in the &lt;i&gt;modules&lt;/i&gt; directory.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5660420964559314809-7584114704390491452?l=yabasicblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://yabasicblog.blogspot.com/feeds/7584114704390491452/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://yabasicblog.blogspot.com/2010/01/releasing-yabasic-299-featuring-modules.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5660420964559314809/posts/default/7584114704390491452'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5660420964559314809/posts/default/7584114704390491452'/><link rel='alternate' type='text/html' href='http://yabasicblog.blogspot.com/2010/01/releasing-yabasic-299-featuring-modules.html' title='Releasing Yabasic 2.9.9, featuring modules and structures combined'/><author><name>Thomas Larsen</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5660420964559314809.post-1962775495557871883</id><published>2010-01-22T15:32:00.000-08:00</published><updated>2010-01-26T20:22:34.304-08:00</updated><title type='text'>An argument for free software</title><content type='html'>&lt;!-- Preserving our software heritage: free software --&gt;&lt;p&gt;You may have noticed that I often call Yabasic "free software". In this context, I always mean "software that is free in the sense of freedom". (Of course, Yabasic is also available free of charge.) I am careful to avoid confusing the terms "open source software" and "free software": the former is a development methodology (a way of creating software), and the latter is a philosophy. Software can be "open source", yet not be "free" in the sense of freedom. Yabasic qualifies both as free and as open source software.&lt;/p&gt;&lt;p&gt;A program qualifies as "free software" if its copyright holders have made it available under terms that allow recipients to freely use, copy, study, modify, and distribute it (either modified or unmodified). I could procrastinate at length about the moral high ground of the free software movement, but I'm not going to do that. Instead, I want to develop an argument for free software which is often neglected, an argument that is quite relevant to many BASIC programmers today: the argument from preserving our software heritage. Allow me to elaborate.&lt;/p&gt;&lt;p&gt;We all know that computers change and that the computing world evolves. Not so long ago, computers were found only within the domains of universities and highly-funded institutes; now, it's not uncommon (in the Western world, at least) for individual households to have more than one personal computer. Software changes rapidly as new algorithms and better techniques for data storage become known, and also as companies try to outdo each other. Suffice it to say, a lot of software that we currently use will look quite different in ten years' time.&lt;/p&gt;&lt;p&gt;Data formats and programming languages change as well. I am confident that BASIC will not die out within the space of a decade, and its potential as a fun language, often agreeable to beginners, may even cause certain variants to gain in popularity. (&lt;a href="http://yabasic.basicprogramming.org/"&gt;I live in hope.&lt;/a&gt;) We would be fooling ourselves, though, to think that pre-compiled software that runs quite well on our 32- or 64-bit computers will run just as well on modern systems ten years later. Unless programs are changed as the computing world changes, it is unlikely even that most of today's body of &lt;i&gt;source code&lt;/i&gt;&amp;mdash;whether written in C, C++, Java, or some other language&amp;mdash;would compile or run properly on a modern system in a decade's time.&lt;/p&gt;&lt;p&gt;What I'm getting at, then, is that software will quickly be rendered obsolete and unusable unless it is updated regularly as computers change, libraries are improved, and the computing world in general rolls on. Now to tie that into my main argument.&lt;/p&gt;&lt;p&gt;A program counts as "proprietary software" if its copyright holders do not allow users to use, copy, study, modify, or distribute it freely. Indeed, much proprietary software is licensed in such a way that users are forbidden from doing anything with the software except using it, and, usually to a &lt;i&gt;very&lt;/i&gt; limited extent, copying it locally. The copyright holders of proprietary software most often refuse to make source code publicly available, and this has a number of profound negative consequences.&lt;/p&gt;&lt;p&gt;For many reasons, programmers cannot be expected to support archaic programs indefinitely. Sadly, many historically-important programs fall out of common use and are lost in the mists of time&amp;mdash;often, &lt;i&gt;really&lt;/i&gt; lost, because the copyright holders selfishly refuse to release the source code into the public domain. (In some cases, it's impossible to contact the copyright holders.) If such programs will not run on today's systems, how much less will they function on the systems to be found in a decade's time? When historians try to research the history of the computing world, they will run up against walls of all kinds: technical walls, legal walls, and, perhaps worst of all, "language" walls.&lt;/p&gt;&lt;p&gt;Open up an compiled executable file in a text editor, and observe the wonderful Language of the Computer. You almost certainly cannot understand it, and there are few who can (and even they cannot fully deduce the source code of a program from its compiled executable). And it's not a static Language; changes are made to it as new ways of doing things are discovered. Programmers will keep up with the Language of the day, and, in ten years' time, &lt;i&gt;very&lt;/i&gt; few people will understand the arcane symbols you see in front of you now. In fifty? Well, I'll stop there, because you can guess the situation. If the program is free in the sense of freedom, you can rest in peace: the source code will probably still be accessible from some public archive even fifty years into the future.&lt;/p&gt;&lt;p&gt;How does this relate to us? Well, I think all of us have an interest in the history of BASIC, and a respect for our computing heritage. We now have to come to terms with the fact that so many BASIC interpreters and compilers, and so many BASIC programs, are no longer usable on modern systems (I know there are various emulators available, but often they are not fully functional). We will lose more and more BASIC-related programs in the future. Why? Because so many dialects of BASIC, and so much software created using BASIC, is proprietary, and the Language of the Computer slowly but surely changes.&lt;/p&gt;&lt;p&gt;&lt;i&gt;Free software is the only kind of software that reliably preserves our software heritage&lt;/i&gt;. Already, we are losing old proprietary BASIC interpreters and compilers&amp;mdash;pieces of software that would, ideally, help us to research, remember, and enjoy our history. Let's not support proprietary software. We need to address the problem now, so that humanity won't have to suffer ten, twenty, thirty, a hundred years from now because of our "short-mindedness".&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5660420964559314809-1962775495557871883?l=yabasicblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://yabasicblog.blogspot.com/feeds/1962775495557871883/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://yabasicblog.blogspot.com/2010/01/argument-for-free-software.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5660420964559314809/posts/default/1962775495557871883'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5660420964559314809/posts/default/1962775495557871883'/><link rel='alternate' type='text/html' href='http://yabasicblog.blogspot.com/2010/01/argument-for-free-software.html' title='An argument for free software'/><author><name>Thomas Larsen</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5660420964559314809.post-4251112902073479239</id><published>2010-01-17T20:12:00.001-08:00</published><updated>2010-01-17T20:12:34.482-08:00</updated><title type='text'>Distributing modules</title><content type='html'>&lt;!--Distributing modules--&gt;&lt;p&gt;How should we distribute Yabasic modules?&lt;/p&gt;&lt;p&gt;We could explicitly separate modules from the Yabasic core, distributing them individually so that users could download just the modules they wanted from a central location such as &lt;a href="http://yabasic.basicprogramming.org/"&gt;yabasic.basicprogramming.org&lt;/a&gt;. For example, a user could download &lt;i&gt;yabasic.3.*.*.tar.gz&lt;/i&gt;, &lt;i&gt;yabmod-sdl.*.tar.gz&lt;/i&gt;, and &lt;i&gt;yabmod-curses.*.tar.gz&lt;/i&gt; and then install each of these components separately; and if our user later required (say) a FLTK module, it would be a simple matter to download and install &lt;i&gt;yabmod-fltk.*.tar.gz&lt;/i&gt;. I'll need to take a closer look at the technicalities behind all of this to see exactly how such a system would function, but I doubt it would be too difficult to implement.&lt;/p&gt;&lt;p&gt;The alternative is to actually distribute modules with the Yabasic core. This approach has its benefits: users would only need to download one file (&lt;i&gt;yabasic.3.*.*.tar.gz&lt;/i&gt;) to get a "full" Yabasic. But there are also downsides; this "centralised" approach could quickly become cluttered and confusing, there would need to be a more stringent process for "officially" adopting modules, and users would find it more difficult to develop their own modules and share them. In my opinion, there's also a certain inelegance about it all: packing a bunch of source files together, each one written by a different author in a different style... maybe I'm just not pragmatic enough.&lt;/p&gt;&lt;p&gt;Which approach should we choose? I'll pass the microphone&amp;mdash;or, rather, the comment button&amp;mdash;to you.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5660420964559314809-4251112902073479239?l=yabasicblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://yabasicblog.blogspot.com/feeds/4251112902073479239/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://yabasicblog.blogspot.com/2010/01/distributing-modules.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5660420964559314809/posts/default/4251112902073479239'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5660420964559314809/posts/default/4251112902073479239'/><link rel='alternate' type='text/html' href='http://yabasicblog.blogspot.com/2010/01/distributing-modules.html' title='Distributing modules'/><author><name>Thomas Larsen</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5660420964559314809.post-315164136580595092</id><published>2010-01-17T20:11:00.001-08:00</published><updated>2010-01-17T20:11:32.718-08:00</updated><title type='text'>Documentation for Yabasic 3</title><content type='html'>&lt;!--Documentation for Yabasic 3--&gt;&lt;p&gt;Clearly, it is important to ensure that changes made to Yabasic are reflected accurately in the language's documentation. With Yabasic 3 introducing several major new features and many alterations on a more minor scale, it seems logical to write a completely new manual. Elmar Vogt has volunteered to take on this daunting task, and plans to start working on the manual this spring (read "autumn" if you live in the Southern Hemisphere).&lt;/p&gt;&lt;p&gt;Elmar intends to use LaTeX for document formatting, and, as a result, Yabasic's manual will be distributed in at least two widely-accepted formats: as a nicely-laid-out PDF document, and as an XHTML document for easy browsing and searching.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5660420964559314809-315164136580595092?l=yabasicblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://yabasicblog.blogspot.com/feeds/315164136580595092/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://yabasicblog.blogspot.com/2010/01/documentation-for-yabasic-3.html#comment-form' title='5 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5660420964559314809/posts/default/315164136580595092'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5660420964559314809/posts/default/315164136580595092'/><link rel='alternate' type='text/html' href='http://yabasicblog.blogspot.com/2010/01/documentation-for-yabasic-3.html' title='Documentation for Yabasic 3'/><author><name>Thomas Larsen</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>5</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5660420964559314809.post-5294967619965393187</id><published>2010-01-08T17:34:00.000-08:00</published><updated>2010-01-08T17:35:07.123-08:00</updated><title type='text'>Releasing 2.9.8, featuring structures</title><content type='html'>&lt;!--Releasing 2.9.8, featuring structures--&gt;&lt;p&gt;It is my pleasure to announce that Yabasic version 2.9.8 is now &lt;a href="http://yabasic.basicprogramming.org/download.html"&gt;available for download&lt;/a&gt;. It's notable mainly because it features an implementation of structures that is actually &lt;i&gt;usable&lt;/i&gt;. This is an unstable release and may contain quite a few bugs, and I would be very appreciative if you could help to test it. There is still a small amount of work that remains to be completed before I can finally stamp &lt;i&gt;Done&lt;/i&gt; on structures, in particular providing an easy way to declare structures local or static.&lt;/p&gt;&lt;p&gt;To avoid confusion: this release &lt;i&gt;does not&lt;/i&gt; incorporate any of Pedro's module code; it will probably be integrated into the next release (2.9.9). This is because I haven't had the opportunity to download and work on this code until now. You will notice that I've departed a little from my tentative schedule by working in this way, but I'm not terribly worried about that, as a stable Yabasic 3.0.0 release in early February still looks very feasible.&lt;/p&gt;&lt;p&gt;For your interest, here is a (fairly self-explanatory) example of structure usage.&lt;/p&gt;&lt;pre&gt;// Enable the "explicit" option.&lt;br /&gt;enable explicit&lt;br /&gt;&lt;br /&gt;// Define terrain, creature, and item types.&lt;br /&gt;terrain_None = 0&lt;br /&gt;terrain_Water = 1&lt;br /&gt;creature_None = 0&lt;br /&gt;item_None = 0&lt;br /&gt;item_Jewels = 1&lt;br /&gt;&lt;br /&gt;// Define the map's width and height.&lt;br /&gt;map_width = 100&lt;br /&gt;map_height = 100&lt;br /&gt;&lt;br /&gt;// Map structure for a basic roguelike game.&lt;br /&gt;struct map (map_width, map_height)&lt;br /&gt;   terrain&lt;br /&gt;   creature&lt;br /&gt;   items (20)&lt;br /&gt;end struct&lt;br /&gt;&lt;br /&gt;// Fill the map.&lt;br /&gt;for x = 1 to map_width&lt;br /&gt;   for y = 1 to map_height&lt;br /&gt;      map (x, y).terrain = terrain_Water&lt;br /&gt;      map (x, y).terrain = creature_None&lt;br /&gt;      for set_items = 1 to 20&lt;br /&gt;         map (x, y).items (set_items) = item_None&lt;br /&gt;      next&lt;br /&gt;   next&lt;br /&gt;next&lt;br /&gt;&lt;br /&gt;// Put jewels at a random location.&lt;br /&gt;map (int (ran (map_width)) + 1, int (ran (map_height)) + 1).items (1) = item_Jewels&lt;br /&gt;&lt;br /&gt;// And so on...&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5660420964559314809-5294967619965393187?l=yabasicblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://yabasicblog.blogspot.com/feeds/5294967619965393187/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://yabasicblog.blogspot.com/2010/01/releasing-298-featuring-structures.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5660420964559314809/posts/default/5294967619965393187'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5660420964559314809/posts/default/5294967619965393187'/><link rel='alternate' type='text/html' href='http://yabasicblog.blogspot.com/2010/01/releasing-298-featuring-structures.html' title='Releasing 2.9.8, featuring structures'/><author><name>Thomas Larsen</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5660420964559314809.post-5585915949560989234</id><published>2009-12-27T00:47:00.000-08:00</published><updated>2009-12-27T00:56:03.994-08:00</updated><title type='text'>Tentative timetable for Yabasic 3 (stable)</title><content type='html'>&lt;p&gt;I can make no guarantees about the actual release date for Yabasic 3 (stable). But this is my tentative timetable for development (which, knowing myself, I probably won't stick to).&lt;/p&gt;&lt;ul&gt;&lt;li&gt;December 31: Begin documentation.&lt;/li&gt;&lt;li&gt;January 1–2: Work on modules/plugins, ensuring that they are integrated fully.&lt;/li&gt;&lt;li&gt;January 3–7: Implement structures/types. Release version 2.9.8, a test version.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;January 8–15: Write a comprehensive user manual for Yabasic. Release version 2.9.9, a test version.&lt;/li&gt;&lt;li&gt;January 16–18: Develop a Curses module.&lt;/li&gt;&lt;li&gt;January 19–February 1: Develop a SDL module.&lt;/li&gt;&lt;li&gt;February 2: Release version 3.0.0, a stable version.&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5660420964559314809-5585915949560989234?l=yabasicblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://yabasicblog.blogspot.com/feeds/5585915949560989234/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://yabasicblog.blogspot.com/2009/12/tentative-timetable-for-yabasic-3.html#comment-form' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5660420964559314809/posts/default/5585915949560989234'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5660420964559314809/posts/default/5585915949560989234'/><link rel='alternate' type='text/html' href='http://yabasicblog.blogspot.com/2009/12/tentative-timetable-for-yabasic-3.html' title='Tentative timetable for Yabasic 3 (stable)'/><author><name>Thomas Larsen</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5660420964559314809.post-3683037833282912787</id><published>2009-12-26T18:52:00.000-08:00</published><updated>2009-12-26T19:28:20.300-08:00</updated><title type='text'>Blog moved</title><content type='html'>You will notice that the Yabasic blog has been moved from &lt;a href="http://yabasicblog.blogspot.com/"&gt;yabasicblog.blogspot.com&lt;/a&gt; to &lt;a href="http://yabasic.basicprogramming.org/blog/"&gt;yabasic.basicprogramming.org/blog&lt;/a&gt;. If you navigate to the former location, you will be redirected to the latter.&lt;br /&gt;&lt;br /&gt;The Blogger software is still being used, though&amp;mdash;only the hosting location has changed. I've also changed the style of the blog: I hope you enjoy it.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5660420964559314809-3683037833282912787?l=yabasicblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://yabasicblog.blogspot.com/feeds/3683037833282912787/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://yabasicblog.blogspot.com/2009/12/blog-moved.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5660420964559314809/posts/default/3683037833282912787'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5660420964559314809/posts/default/3683037833282912787'/><link rel='alternate' type='text/html' href='http://yabasicblog.blogspot.com/2009/12/blog-moved.html' title='Blog moved'/><author><name>Thomas Larsen</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5660420964559314809.post-4655682363006993415</id><published>2009-12-25T12:30:00.000-08:00</published><updated>2009-12-25T19:52:05.465-08:00</updated><title type='text'>Yabasic and modules</title><content type='html'>&lt;p&gt;I have not posted here for a little while—as I noted in my last post, I have been on holiday in New Zealand. I am sorry to say that this post will be rather short, as well. But before I start, I'd like to welcome Pedro Sá to the Yabasic blog: he is currently working on implementing modules (or "plugins", if you prefer that terminology) for Yabasic; and he now has posting access here, so I'm looking forward to hearing directly from him about his work so far.&lt;/p&gt;&lt;p&gt;Currently, the modules system works as follows: (1) C functions are imported into Yabasic, using the new &lt;span style="font-style: italic;"&gt;csub&lt;/span&gt; statement, by a Yabasic library which provides a Yabasic interface to a module; (2) the user imports the library (using &lt;span style="font-style: italic;"&gt;use&lt;/span&gt; or &lt;span style="font-style: italic;"&gt;import&lt;/span&gt;); and (3) the user is able to run the C functions in the module through the library interface.&lt;/p&gt;&lt;p&gt;Let's have a look at how that might work in practice.&lt;/p&gt;&lt;p&gt;An extract from the (yet-to-be-created) library &lt;span style="font-style: italic;"&gt;sdl.yab&lt;/span&gt; might look something like the following:&lt;/p&gt;&lt;pre&gt;csub openwindow (x, y, name$) from "sdl"&lt;br /&gt;csub usewindow (window_id) from "sdl"&lt;br /&gt;csub updatewindow () from "sdl"&lt;br /&gt;csub closewindow () from "sdl"&lt;br /&gt;csub color (red, green, blue) from "sdl"&lt;br /&gt;csub circle (x, y, radius) from "sdl"&lt;br /&gt;csub readkey$ () from "sdl"&lt;/pre&gt;&lt;p&gt;Then a user might write a program, &lt;span style="font-style: italic;"&gt;circle.yab&lt;/span&gt;, which looked something like the following:&lt;/p&gt;&lt;pre&gt;use "sdl" as "gui"&lt;br /&gt;&lt;br /&gt;gui.usewindow (gui.openwindow (100, 100, "Circle"))&lt;br /&gt;gui.color (0, 0, 0)&lt;br /&gt;gui.circle (50, 50, 20)&lt;br /&gt;gui.updatewindow ()&lt;br /&gt;gui.readkey$ ()&lt;br /&gt;gui.closewindow ()&lt;/pre&gt;&lt;p&gt;That's a very tentative example, because a lot of development work is currently taking place, so don't start writing your module-using programs just yet!&lt;/p&gt;&lt;p&gt;There have been a few minor hiccups so far, but Pedro has done a good job addressing these issues. Many others have helped out in this process, and I would like to personally express my appreciation to them.&lt;/p&gt;&lt;p&gt;And we would love to hear your suggestions and feedback on modules, because nothing is yet written in stone...&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5660420964559314809-4655682363006993415?l=yabasicblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://yabasicblog.blogspot.com/feeds/4655682363006993415/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://yabasicblog.blogspot.com/2009/12/yabasic-and-modules.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5660420964559314809/posts/default/4655682363006993415'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5660420964559314809/posts/default/4655682363006993415'/><link rel='alternate' type='text/html' href='http://yabasicblog.blogspot.com/2009/12/yabasic-and-modules.html' title='Yabasic and modules'/><author><name>Thomas Larsen</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5660420964559314809.post-6595848082274094742</id><published>2009-12-06T20:07:00.000-08:00</published><updated>2009-12-06T20:27:45.475-08:00</updated><title type='text'>Thanks—and a new version</title><content type='html'>&lt;!-- Thanks to everybody --&gt;&lt;p&gt;I want to thank everyone who has provided feedback on the 2.9.5 release of Yabasic. In most cases, the feedback I have received has been positive, and I'm very grateful for your encouragement and patience despite the imperfections and rough edges that still remain to be ironed out of the interpreter. I have also taken suggestions for improvement into consideration, and I'm currently working on addressing a few issues.&lt;/p&gt;&lt;p&gt;I'm releasing Yabasic 2.9.6 today (you can acquire it from &lt;a href="http://yabasic.basicprogramming.org/"&gt;yabasic.basicprogramming.org&lt;/a&gt;), which implements a few minor changes:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;a bug where the first internal command was not properly initialised has been fixed;&lt;/li&gt;&lt;li&gt;the &lt;code&gt;inc&lt;/code&gt; and &lt;code&gt;dec&lt;/code&gt; commands have been added (at least for scalar variables);&lt;/li&gt;&lt;li&gt;a bug related to &lt;code&gt;use&lt;/code&gt;-statement parsing has been fixed;&lt;/li&gt;&lt;li&gt;the special variables &lt;code&gt;__time$&lt;/code&gt; and &lt;code&gt;__date$&lt;/code&gt; have been added (&lt;code&gt;time$&lt;/code&gt; and &lt;code&gt;date$&lt;/code&gt; were removed unnecessarily, so please accept my apologies);&lt;/li&gt;&lt;li&gt;the statement &lt;code&gt;select&lt;/code&gt; is now a valid alternative (synonym) to &lt;code&gt;switch&lt;/code&gt;;&lt;/li&gt;&lt;li&gt;output is now flushed properly;&lt;/li&gt;&lt;li&gt;the short-&lt;code&gt;if&lt;/code&gt; form has been re-added.&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;I plan to re-add the &lt;code&gt;goto&lt;/code&gt;, &lt;code&gt;gosub&lt;/code&gt;, and &lt;code&gt;label&lt;/code&gt; statements. Line number support, however, will probably not be implemented; it is simply impractical if line numbers cannot be updated properly.&lt;/p&gt;&lt;p&gt;I should note that from December 14 to December 30 I'll be away in New Zealand, and I'm not sure how much Internet access, if any, I will have during this time. Thanks again! I'm pleased and humbled that the Yabasic community is alive and well, and honoured to be working on Yabasic. It has been well worth the effort so far, and will continue to be so long into the future.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5660420964559314809-6595848082274094742?l=yabasicblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://yabasicblog.blogspot.com/feeds/6595848082274094742/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://yabasicblog.blogspot.com/2009/12/thanks.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5660420964559314809/posts/default/6595848082274094742'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5660420964559314809/posts/default/6595848082274094742'/><link rel='alternate' type='text/html' href='http://yabasicblog.blogspot.com/2009/12/thanks.html' title='Thanks—and a new version'/><author><name>Thomas Larsen</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5660420964559314809.post-2391914456836682749</id><published>2009-11-26T19:56:00.000-08:00</published><updated>2009-11-26T20:18:57.104-08:00</updated><title type='text'>Yabasic 3 beta release (2.9.5)</title><content type='html'>&lt;!--Yabasic 3 beta release is available--&gt;&lt;p&gt;I can announce, at long last, that a beta release of Yabasic 3 (known as version 2.9.5) is &lt;a href="http://yabasic.basicprogramming.org/"&gt;available for download&lt;/a&gt;. I want to emphasise very strongly that this release is just that, a &lt;i&gt;beta&lt;/i&gt; release. Yabasic is still undergoing intensive development leading up to a stable and full-bodied version 3, and the "to-do" list for Yabasic remains quite long; it can be found in the file "doc/TODO" in the release tar-ball. I encourage you to experiment with Yabasic and test it rigorously, but there are a number of things you should be aware of before you begin to do so.&lt;/p&gt;&lt;p&gt;Firstly, you should be aware of the following changes and additions. (You can find a more complete list of new features in the file "doc/NEWS" in the release tar-ball: &lt;i&gt;please read this file&lt;/i&gt; before experimenting with the beta version.)&lt;/p&gt;&lt;ul&gt;&lt;li&gt;Basic structures. (Not quite completed, but the framework exists and is usable.)&lt;/li&gt;&lt;li&gt;Block comments between &lt;code&gt;/*&lt;/code&gt; and &lt;code&gt;*/&lt;/code&gt; markers.&lt;/li&gt;&lt;li&gt;Options, including "explicit" (which causes an error to be reported whenever a variable is used uninitialised).&lt;/li&gt;&lt;li&gt;Special variables beginning with the &lt;code&gt;__&lt;/code&gt; prefix.&lt;/li&gt;&lt;li&gt;Changes to the way in which files (and libraries) are imported. Note, in particular, the difference between the "import" command and the new "use" command.&lt;/li&gt;&lt;li&gt;Minor changes and additions to expression operators (for example, "mod" is now an operator).&lt;/li&gt;&lt;li&gt;Some syntactical restrictions have been removed.&lt;/li&gt;&lt;li&gt;Some bugs have been fixed.&lt;/li&gt;&lt;li&gt;Interface improvements have been made.&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;The following things have been &lt;i&gt;removed&lt;/i&gt;.&lt;/p&gt;&lt;ul&gt;&lt;li&gt;The commands "goto", "gosub", and "label" and line numbers (perhaps temporarily). See my &lt;a href="http://yabasicblog.blogspot.com/2009/11/goto-gosub-and-line-numbers-considered.html"&gt;blog post on the subject&lt;/a&gt;; I need to hear more feedback before making a decision.&lt;/li&gt;&lt;li&gt;Some functions and commands, particularly those pertaining to terminal and window management.&lt;/li&gt;&lt;li&gt;Variables such as &lt;code&gt;time$&lt;/code&gt;, &lt;code&gt;date$&lt;/code&gt;, and so on.&lt;/li&gt;&lt;li&gt;The functions &lt;code&gt;peek ()&lt;/code&gt;, &lt;code&gt;peek$ ()&lt;/code&gt;, and &lt;code&gt;poke ()&lt;/code&gt;. Note that file access peeks and pokes will probably be re-added, since they are fast, useful, and quite conventional.&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;Most of the system-dependent parts of Yabasic have been removed and will be migrated to modules in the near future. However, I am not confident that Yabasic will compile without errors on Windows systems, and I do not use Windows and therefore cannot test it. Because of this, I am relying on your bug reports and feedback to make Yabasic usable on Windows systems. Please record any changes needed to make Yabasic to run on Windows systems, and send them to me so that I can incorporate them into the next release. I remain committed to ensuring that Yabasic compiles on both Unix and Windows systems without errors or warnings.&lt;/p&gt;&lt;p&gt;On Unix systems, simply unpacking the release tar-ball, moving into the unpacked directory, and typing &lt;i&gt;make&lt;/i&gt; at a shell prompt should suffice to build Yabasic. You can, of course, use &lt;i&gt;make install&lt;/i&gt; to install Yabasic. On Windows systems, a different approach will be needed, and I would like to hear any suggestions you might have.&lt;/p&gt;&lt;p&gt;Over the next few months, I intend to work with Pedro Sá to implement modules and a universal standard for modular components. Currently, we have SDL and Curses modules planned, but suggestions are very welcome, and contributions highly appreciated.&lt;/p&gt;&lt;p&gt;I would love to receive feedback, bug reports, and feature requests, and you are welcome to &lt;a href="mailto:larsen.thomas.h_at_gmail.com"&gt;e-mail me&lt;/a&gt; any time. Keep an eye on &lt;a href="http://yabasic.basicprogramming.org/"&gt;yabasic.basicprogramming.org&lt;/a&gt; for news, announcements, and releases.&lt;/p&gt;&lt;p&gt;Enjoy!&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5660420964559314809-2391914456836682749?l=yabasicblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://yabasicblog.blogspot.com/feeds/2391914456836682749/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://yabasicblog.blogspot.com/2009/11/yabasic-3-beta-release-295.html#comment-form' title='5 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5660420964559314809/posts/default/2391914456836682749'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5660420964559314809/posts/default/2391914456836682749'/><link rel='alternate' type='text/html' href='http://yabasicblog.blogspot.com/2009/11/yabasic-3-beta-release-295.html' title='Yabasic 3 beta release (2.9.5)'/><author><name>Thomas Larsen</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>5</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5660420964559314809.post-110211673017728171</id><published>2009-11-10T20:11:00.000-08:00</published><updated>2009-11-26T20:21:54.754-08:00</updated><title type='text'>Limiting and reducing language complexity</title><content type='html'>&lt;!-- Limiting and reducing language complexity --&gt;&lt;p&gt;Programming languages have an unfortunate tendency to become increasingly complex as the communities associated with them grow. A language may initially be "simple", but as its user-base grows and users experiment with other tools and acquire new ideas pressure is placed on the language's developers to implement new features. Therefore, a language may begin to suffer from &lt;i&gt;featuritis&lt;/i&gt;&amp;mdash;the disease of having too many features, or being overly complex.&lt;/p&gt;&lt;p&gt;As Bruce MacLennan writes in his book &lt;i&gt;Principles of Programming Languages&lt;/i&gt; (3rd. ed., published by Oxford University Press), "Featuritis arises from the fact that it is inherently easier to defend adding a feature to a language than to oppose it. This is because the benefits of adding a feature often outweigh the consequent increase in complexity, and because the benefits are specific and clear, whereas the costs are often general and hidden."&lt;/p&gt;&lt;p&gt;I believe MacLennan has a point. Often, adding just a small feature to a programming language will improve it in some small way, perhaps even make it more &lt;i&gt;useful&lt;/i&gt;. However, one new feature leads to another, and after hundreds of small features&amp;mdash;all &lt;i&gt;useful&lt;/i&gt; in themselves&amp;mdash;have been implemented, a language begins to suffer from bloat and inconsistency, both of which lead to new users of the language quickly becoming confused.&lt;/p&gt;&lt;p&gt;Every language has a distinctive character, and this is something to be proud of, not to shy away from. Designers and authors need to appreciate the "personality" of various programming languages, encourage diversity, and remember that there will be some features outside the scope of any given programming language which should be left for other languages to implement.&lt;/p&gt;&lt;p&gt;How is it possible to decide which features are within the scope of a programming language and which are not? I believe that the answer lies in having an individual leading the development of a language. I do not like the term "benevolent dictator", but that probably best describes the kind of role that I refer to. If the development of a language is led by an individual person, as opposed to a committee, it logically follows that the language will reflect some aspects of that person's personality. If that individual identifies with the philosophy of the language, there is an increased chance that they will &lt;i&gt;know&lt;/i&gt; whether or not adding a feature is "good" for that language. If they feel uncomfortable with making a change, it probably is in the project's best interests not to implement it. And, as &lt;a href="http://yabasicblog.blogspot.com/2009/10/what-defines-basic.html?showComment=1256637693429#c6138219336610311450"&gt;"Syzygy" recently commented&lt;/a&gt;, "If one can feel the author's 'signature' in the interpreter, the programmer can follow along the lines of the author's thought, and will more readily understand what is feasible, and how an end can be achieved."&lt;/p&gt;&lt;p&gt;An individual will have their own sense of what is "right" or "wrong" for a language, and, provided that they do not continually have to justify their feelings about particular issues, they can guide a language's development, maintaining simplicity while increasing usefulness. Committees find this far more difficult to&lt;br /&gt;accomplish, since each person on the committee is obliged to explain their opinions to other members, and often it is very difficult to pinpoint exactly why one feels uncomfortable with a particular feature or change. I do not believe it is crucial that only one individual &lt;i&gt;develops&lt;/i&gt; a language; this would be impractical in many ways. But I do believe that an &lt;i&gt;individual&lt;/i&gt;, ultimately, should have the final say on what goes into and what stays out of a programming language.&lt;/p&gt;&lt;p&gt;Of course, the community can always fork a language and create a new project, particularly if they are greatly displeased with the attitude of, or some of the decisions made by, the development leader. Ideally, this will never happen: it is emotionally taxing and costly in terms of resources. But the option is always there for those who need it, and the right to fork is fundamental to the concept of free software.&lt;/p&gt;&lt;p&gt;Programming languages like &lt;a href="http://yabasic.basicprogramming.org/"&gt;Yabasic&lt;/a&gt; with small yet active communities usually do not suffer from featuritis. At any rate, I do not think that Yabasic is negatively impacted by feature creep, although I am undoubtedly biased. But as our community grows and the language is developed further, it is important that we move quickly to counteract any symptoms of featuritis if and when they do appear. I will be releasing a beta version of Yabasic 3 soon, within a week or two from now at most; and I look forward to hearing your feedback, bug reports, and&amp;mdash;of course&amp;mdash;feature requests. I would love to hear your thoughts on keeping Yabasic both simple and useful.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5660420964559314809-110211673017728171?l=yabasicblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://yabasicblog.blogspot.com/feeds/110211673017728171/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://yabasicblog.blogspot.com/2009/11/limiting-and-reducing-language.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5660420964559314809/posts/default/110211673017728171'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5660420964559314809/posts/default/110211673017728171'/><link rel='alternate' type='text/html' href='http://yabasicblog.blogspot.com/2009/11/limiting-and-reducing-language.html' title='Limiting and reducing language complexity'/><author><name>Thomas Larsen</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5660420964559314809.post-3642919118265454659</id><published>2009-11-01T20:06:00.001-08:00</published><updated>2009-11-01T20:07:51.084-08:00</updated><title type='text'>Goto, gosub, and line numbers: considered harmful, BASIC, or both?</title><content type='html'>&lt;p&gt;I want to discuss an issue that, in many ways, straddles the divide between old, "traditional" BASIC dialects and newer, more "modern" versions: are &lt;code&gt;goto&lt;/code&gt;, &lt;code&gt;gosub&lt;/code&gt;, and line numbers harmful, fundamental to BASIC, or both harmful and fundamental? Do they have a place in any modern BASIC dialect? Where is &lt;a href="http://yabasic.basicprogramming.org/"&gt;Yabasic&lt;/a&gt; on the scale that ranges from "traditional" to "modern"? In experimenting with Yabasic 3, I have removed these three features, and the decision before me is whether or not to re-add them. I hope to acquire some valuable feedback by provocatively arguing that they are not, actually, fundamental to a BASIC dialect, and additionally that they are harmful and unnecessary. All that said, I am quite willing to hear opposing arguments, and at this point I could fairly easily be convinced to re-add them.&lt;/p&gt;&lt;p&gt;The &lt;code&gt;goto&lt;/code&gt; statement jumps to a particular line number (or to a defined label, which is more common nowadays) within a program, and program execution continues from that point. There is no way to return from this jump to the location jumped from, other than by using another &lt;code&gt;goto&lt;/code&gt; statement to jump to a label or line number before that location. The &lt;code&gt;gosub&lt;/code&gt; statement, however, jumps to a particular line number or label with a view to return later&amp;mdash;by using, for example, the &lt;code&gt;return&lt;/code&gt; statement.&lt;/p&gt;&lt;p&gt;Line numbers date back to the original BASIC, where every single line was represented a numbered statement (hence &lt;i&gt;line numbers&lt;/i&gt;). By combining line numbers with the &lt;code&gt;goto&lt;/code&gt; statement, it was possible to write loops and simplify conditionals. For example:&lt;/p&gt;&lt;pre&gt;10 PRINT "HELLO, WORLD!"&lt;br /&gt;20 COUNT = COUNT + 1&lt;br /&gt;30 IF COUNT &amp;lt; 10 GOTO 10&lt;br /&gt;40 END&lt;/pre&gt;&lt;p&gt;This example displays the string "HELLO, WORLD!" ten times before exiting.&lt;/p&gt;&lt;p&gt;It is technically possible to write &lt;i&gt;any&lt;/i&gt; program without using the &lt;code&gt;goto&lt;/code&gt; or &lt;code&gt;gosub&lt;/code&gt; statements, line numbers, or labels. Using &lt;code&gt;goto&lt;/code&gt; can occasionally be useful for breaking out of nested loops prematurely:&lt;/p&gt;&lt;pre&gt;&lt;br /&gt;while condition_1&lt;br /&gt;   while condition_2&lt;br /&gt;      if time_to_go then&lt;br /&gt;         goto get_out&lt;br /&gt;      endif&lt;br /&gt;   wend&lt;br /&gt;wend&lt;br /&gt;&lt;br /&gt;label get_out&lt;br /&gt;&lt;br /&gt;...&lt;/pre&gt;&lt;p&gt;However, it is possible to use variables to accomplish precisely the same task:&lt;/p&gt;&lt;pre&gt;get_out = false&lt;br /&gt;while condition_1&lt;br /&gt;   while condition_2&lt;br /&gt;      if time_to_go then&lt;br /&gt;         get_out = true&lt;br /&gt;         break&lt;br /&gt;      endif&lt;br /&gt;   wend&lt;br /&gt;   if get_out then&lt;br /&gt;      break&lt;br /&gt;   endif&lt;br /&gt;wend&lt;br /&gt;&lt;br /&gt;...&lt;/pre&gt;&lt;p&gt;The &lt;code&gt;goto&lt;/code&gt; statement, in particular, leads to what computer programmers term &lt;i&gt;spaghetti code&lt;/i&gt;, which essentially means that a program, while executing, does not follow a logical consecutive order but instead jumps wildly from one location to another. This is not only considered poor design, it makes a program less understandable to users. However, &lt;code&gt;goto&lt;/code&gt; is often very tempting to a beginning programmer: I recall that when I first learnt Yabasic (and it was the first programming language I &lt;i&gt;really&lt;/i&gt; learnt), I used &lt;code&gt;goto&lt;/code&gt; very often to control program flow, because it was easy and seemed simple&amp;mdash;until I had to read and re-write my programs.&lt;/p&gt;&lt;p&gt;Similarly to &lt;code&gt;goto&lt;/code&gt;, &lt;code&gt;gosub&lt;/code&gt; tends to have adverse effects on program readability and maintainability. There are at least two other pitfalls: there is no guarantee that the location jumped from will be returned to eventually, and there is no way of passing information along with the &lt;code&gt;gosub&lt;/code&gt; statement, or of returning information from a routine, other than using global variables:&lt;/p&gt;&lt;pre&gt;name$ = "Thomas Larsen"   // bad practice!&lt;br /&gt;location$ = "Australia"   // bad practice!&lt;br /&gt;gosub display_person   // can't pass any arguments&lt;br /&gt;end   // must have this to avoid continuing into label&lt;br /&gt;&lt;br /&gt;label display_person&lt;br /&gt;&lt;br /&gt;print name$ + " lives in " + location$ + "."&lt;br /&gt;&lt;br /&gt;return   // can't return any value&lt;/pre&gt;&lt;p&gt;Conversely, subroutines, defined using the &lt;code&gt;sub&lt;/code&gt; statement, and subroutine calls suffer from neither of these flaws:&lt;/p&gt;&lt;pre&gt;display_person ("Thomas Larsen", "Australia")&lt;br /&gt;&lt;br /&gt;sub display_person (name$, location$)&lt;br /&gt;   print name$ + " lives in " + location$ + "."&lt;br /&gt;   return true&lt;br /&gt;end sub&lt;/pre&gt;&lt;p&gt;Line numbers inherently have many problems. For example, if a new statement is added to a program then all existing lines in the program must be re-numbered and all references to them updated. Some old BASIC dialects which included an editor performed this automatically or upon receiving a particular command (for example, GW-BASIC), but newer BASIC versions which execute programs stored in files which are created by other editors should not modify those files (for instance, Yabasic).&lt;/p&gt;&lt;p&gt;None of these features, particularly if they are used regularly in a program, are conducive to major re-writes or fundamental changes being made. One has to ask whether such features are actually in keeping with the philosophy of BASIC, which is arguably to make programming relatively easy, understandable, and enjoyable for beginning programmers (and veterans, too). If &lt;code&gt;goto&lt;/code&gt;, &lt;code&gt;gosub&lt;/code&gt;, and line numbers cause confusion, lead to flawed program design, and encourage undesirable programming habits, are they really fundamental to BASIC dialects? No, I would argue.&lt;/p&gt;&lt;p&gt;But, after all, this is just my two cents.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5660420964559314809-3642919118265454659?l=yabasicblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://yabasicblog.blogspot.com/feeds/3642919118265454659/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://yabasicblog.blogspot.com/2009/11/goto-gosub-and-line-numbers-considered.html#comment-form' title='6 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5660420964559314809/posts/default/3642919118265454659'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5660420964559314809/posts/default/3642919118265454659'/><link rel='alternate' type='text/html' href='http://yabasicblog.blogspot.com/2009/11/goto-gosub-and-line-numbers-considered.html' title='Goto, gosub, and line numbers: considered harmful, BASIC, or both?'/><author><name>Thomas Larsen</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>6</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5660420964559314809.post-8111693910197048398</id><published>2009-10-23T21:18:00.001-07:00</published><updated>2009-10-23T21:19:45.469-07:00</updated><title type='text'>The Most Stupid Bug of the Year</title><content type='html'>&lt;!-- The Most Stupid Bug of the Year --&gt;&lt;p&gt;In the header file &lt;i&gt;yabasic.h&lt;/i&gt;, distributed with the Yabasic source, there's a carefully-organised, enumerated list of Yabasic functions. I tidied it up and sorted everything alphabetically into groups of functions with one argument and zero, two, and three arguments:&lt;/p&gt;&lt;pre&gt;/* Yabasic functions (sorted carefully by number of arguments). */&lt;br /&gt;enum functions {&lt;br /&gt;   fZEROARGS, fRAN2,&lt;br /&gt;&lt;br /&gt;   fONEARGS, fABS, fACOS, fASC, fASIN, fATAN, fATAN2, fCHR, fCOS,&lt;br /&gt;   fEXP, fFRAC, fINT, fLEN, fLOG, fLOWER, fLTRIM, fMAX, fMIN,&lt;br /&gt;   fRAN, fRTRIM, fSIG, fSIN, fSQR, fSQRT, fSTR, fSYSTEM, fTAN, fTELL,&lt;br /&gt;   fTRIM, fUPPER, fVAL,&lt;br /&gt;&lt;br /&gt;   fTWOARGS, fAND, fEOR, fINSTR, fLEFT, fLOG2, fMID2, fOR, fRIGHT,&lt;br /&gt;   fRINSTR,&lt;br /&gt;&lt;br /&gt;   fTHREEARGS, fINSTR2, fMID, fRINSTR2&lt;br /&gt;};&lt;/pre&gt;&lt;p&gt;See if you can notice the bug before you continue reading. Trust me, it's not difficult to find if you know Yabasic.&lt;/p&gt;&lt;p&gt;It turns out that in the process of sorting the functions into their respective groups, I incorrectly placed &lt;code&gt;fMAX&lt;/code&gt; and &lt;code&gt;fMIN&lt;/code&gt; (corresponding to the functions &lt;code&gt;max ()&lt;/code&gt; and &lt;code&gt;min ()&lt;/code&gt;, respectively) in the group of functions taking only one argument. If you are familiar with Yabasic, you will know that both of these functions actually take two parameters. I was surprised when I ran a program that used one of these functions and was rewarded with a segmentation fault. It only took me a minute or two to figure out where the problem was and fix it, but I reckon it wins the prestigious title of Most Stupid Bug of the Year. And the year isn't even over yet...&lt;/p&gt;&lt;p&gt;Anyway, &lt;code&gt;fMAX&lt;/code&gt; and &lt;code&gt;fMIN&lt;/code&gt; are now in their proper places, in the group of functions accepting two parameters:&lt;/p&gt;&lt;pre&gt;/* Yabasic functions (sorted carefully by number of arguments). */&lt;br /&gt;enum functions {&lt;br /&gt;   fZEROARGS, fRAN2,&lt;br /&gt;&lt;br /&gt;   fONEARGS, fABS, fACOS, fASC, fASIN, fATAN, fATAN2, fCHR, fCOS,&lt;br /&gt;   fEXP, fFRAC, fINT, fLEN, fLOG, fLOWER, fLTRIM, fRAN, fRTRIM, fSIG,&lt;br /&gt;   fSIN, fSQR, fSQRT, fSTR, fSYSTEM, fTAN, fTELL, fTRIM, fUPPER, fVAL,&lt;br /&gt;&lt;br /&gt;   fTWOARGS, fAND, fEOR, fINSTR, fLEFT, fLOG2, fMAX, fMID2, fMIN, fOR,&lt;br /&gt;   fRIGHT, fRINSTR,&lt;br /&gt;&lt;br /&gt;   fTHREEARGS, fINSTR2, fMID, fRINSTR2&lt;br /&gt;};&lt;/pre&gt;&lt;p&gt;So all is now well.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5660420964559314809-8111693910197048398?l=yabasicblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://yabasicblog.blogspot.com/feeds/8111693910197048398/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://yabasicblog.blogspot.com/2009/10/in-header-file-yabasic.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5660420964559314809/posts/default/8111693910197048398'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5660420964559314809/posts/default/8111693910197048398'/><link rel='alternate' type='text/html' href='http://yabasicblog.blogspot.com/2009/10/in-header-file-yabasic.html' title='The Most Stupid Bug of the Year'/><author><name>Thomas Larsen</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5660420964559314809.post-3635373244719730827</id><published>2009-10-23T21:06:00.001-07:00</published><updated>2009-11-01T20:44:10.312-08:00</updated><title type='text'>What defines a BASIC?</title><content type='html'>&lt;!-- What defines a BASIC? --&gt;&lt;p&gt;You are probably aware that the name "Yabasic" stands for Yet Another BASIC. If you know your programming history, you will also be aware that BASIC is an acronym for Beginners' All-purpose Symbolic Instruction Code. Today, we have a huge body of "BASIC" dialects which bear little or no resemblance whatsoever to the original BASIC invented over forty years ago. The question is, are they actually BASIC languages at all? If the answer is yes, then this might lead us to ask another question: what defines a BASIC?&lt;/p&gt;&lt;p&gt;I want to focus briefly on the term "beginners". It would seem to imply that BASIC languages have a target audience of beginners, but I would argue that now this is not the case. Certainly, BASIC was originally a beginners' language, but it has evolved so much that there are now very complex, powerful dialects which are not particularly suited to those with no prior exposure to programming.&lt;/p&gt;&lt;p&gt;It is interesting to note that BASIC, in its early days, was used primarly within the confines of universities and colleges. This meant that "beginners" actually had at least some experience in operating computers, and, presumably, some familiarity with basic computer theory. Nowadays, we tend to apply the same term to those who have little or no experience in either programming or computer theory.&lt;/p&gt;&lt;p&gt;Then we have the term "all-purpose". Obviously, the original BASIC was not "all-purpose" as we know the term today: it was used mainly to find the answers to various mathematical problems. Nowadays, we have games, editors, and scripts written in a variety of "BASIC" dialects. Most modern "BASIC" dialects do not even attempt to be "all-purpose": it is widely accepted that different versions are better for accomplishing different objectives. However, the widespread use of BASIC variants in many different, diverse fields seems to have proved that the "BASIC" &lt;i&gt;concept&lt;/i&gt; is, indeed, "all-purpose" to a large extent.&lt;/p&gt;&lt;p&gt;So, what defines a BASIC? Is it syntactical conventions or the longstanding &lt;code&gt;print&lt;/code&gt; statement? Or a philosophy shared with the original BASIC? Or an ever-diluted (or ever-enriched) heritage? Or is there no definition, and the label "BASIC" is only widely used because it is an effective, respected "brand name"?&lt;/p&gt;&lt;p&gt;What might the future look like? How might "BASIC" dialects look in a decade, in two decades from now? Will they still deserve the label "BASIC"? What changes might have taken place? What changes &lt;i&gt;should&lt;/i&gt; have taken place?&lt;/p&gt;&lt;p&gt;There is one more very interesting question that I would like to open up for discussion: should there ever be a limit on how far a language can evolve? If a new and potentially very useful feature could be added to a language, but only by significantly or drastically altering it, should it be implemented&amp;mdash;or left for another, completely separate programming language to implement?&lt;/p&gt;&lt;p&gt;(I should apologise, by the way, for the shortness of this post; I was extremely busy during the past week. I would love to hear your ideas for future posts: please e-mail me at &lt;a href="mailto:larsen.thomas.h%20@%20gmail.com"&gt;larsen.thomas.h @ gmail.com&lt;/a&gt;, or else use the comments system.)&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5660420964559314809-3635373244719730827?l=yabasicblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://yabasicblog.blogspot.com/feeds/3635373244719730827/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://yabasicblog.blogspot.com/2009/10/what-defines-basic.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5660420964559314809/posts/default/3635373244719730827'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5660420964559314809/posts/default/3635373244719730827'/><link rel='alternate' type='text/html' href='http://yabasicblog.blogspot.com/2009/10/what-defines-basic.html' title='What defines a BASIC?'/><author><name>Thomas Larsen</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5660420964559314809.post-8071808691247622659</id><published>2009-10-16T21:10:00.000-07:00</published><updated>2009-10-23T21:32:21.091-07:00</updated><title type='text'>Structures in Yabasic 3</title><content type='html'>&lt;p&gt;Often, it is desirable to have variables that can contain data of mixed types (real numbers and strings). For example, take a student database (a typical example, I know, but sufficient). The name, gender, and date of birth of each student must be stored, as well as course information for each individual. To accomplish this in Yabasic as it stands, about six array variables are required. (Technically, fewer are necessary if clarity is unimportant.)&lt;/p&gt;&lt;p&gt;In Yabasic 3, &lt;i&gt;structures&lt;/i&gt; will be able to contain any type of data: real numbers, strings, and even other structures. This will allow for better organisation of variables and a more consistent approach to various aspects of Yabasic programming.&lt;/p&gt;&lt;p&gt;Take the aforementioned example, for instance. In Yabasic as it currently stands, an implementation of the student database might be as follows:&lt;/p&gt;&lt;pre&gt;number_of_students = 30&lt;br /&gt;number_of_courses = 5&lt;br /&gt;&lt;br /&gt;dim name$ (number_of_students)&lt;br /&gt;dim gender (number_of_students)&lt;br /&gt;dim dob_year (number_of_students)&lt;br /&gt;dim dob_month (number_of_students)&lt;br /&gt;dim dob_day (number_of_students)&lt;br /&gt;dim course_name$ (number_of_students, number_of_courses)&lt;br /&gt;dim course_teacher$ (number_of_students, number_of_courses)&lt;br /&gt;&lt;br /&gt;name$ (1) = "Amy"&lt;br /&gt;gender (1) = female&lt;br /&gt;dob_year (1) = 1989&lt;br /&gt;dob_month (1) = 5&lt;br /&gt;dob_day (1) = 14&lt;br /&gt;course_name$ (1, 1) = "Mathematics"&lt;br /&gt;course_teacher$ (1, 1) = "Pythagoras"&lt;br /&gt;course_name$ (1, 2) = "Physics"&lt;br /&gt;course_teacher$ (1, 2) = "Einstein"&lt;br /&gt;...&lt;/pre&gt;&lt;p&gt;Clearly, this has the potential to become extremely confusing, particularly when used in complicated Yabasic programs. In Yabasic 3, on the other hand, the same database program might conceptually be implemented as follows:&lt;/p&gt;&lt;pre&gt;number_of_students = 30&lt;br /&gt;number_of_courses = 5&lt;br /&gt;&lt;br /&gt;struct students (number_of_students)&lt;br /&gt;   name$&lt;br /&gt;   gender&lt;br /&gt;   struct dob&lt;br /&gt;      year&lt;br /&gt;      month&lt;br /&gt;      day&lt;br /&gt;   end struct&lt;br /&gt;   struct courses (number_of_courses)&lt;br /&gt;      name$&lt;br /&gt;      teacher$&lt;br /&gt;   end struct&lt;br /&gt;end struct&lt;br /&gt;&lt;br /&gt;students (1).name$ = "Amy"&lt;br /&gt;students (1).gender = female&lt;br /&gt;students (1).dob.year = 1989&lt;br /&gt;students (1).dob.month = 5&lt;br /&gt;students (1).dob.day = 14&lt;br /&gt;students (1).courses (1).name$ = "Mathematics"&lt;br /&gt;students (1).courses (1).teacher$ = "Pythagoras"&lt;br /&gt;students (1).courses (2).name$ = "Physics"&lt;br /&gt;students (1).courses (2).teacher$ = "Einstein"&lt;br /&gt;...&lt;/pre&gt;&lt;p&gt;Compare this with the previous example. It is more readable and logical, and easier to understand. If you are not convinced, imagine a complex database program making use of many data fields. Without structures, the risk of errors would be unacceptably high.&lt;/p&gt;Structures are not overly difficult to implement, although there may initially be a few hiccups. Instead of making complicated changes to the existing variable-handling code in Yabasic, a special "rearranging" trick could be used. Array indices could be brought to the right-hand side of the full structure name for the purpose of internal representation, allowing structures to make use of existing array and scalar handling routines in Yabasic: for example, &lt;code&gt;students (1).name$&lt;/code&gt; could become &lt;code&gt;students.name$ (1)&lt;/code&gt;. The &lt;code&gt;struct&lt;/code&gt; statement would, therefore, handle all necessary "dimensioning" of arrays, and, if appropriate, make variables local or static. Later, it will probably become possible for users to define &lt;i&gt;types&lt;/i&gt;, structure templates. Tentatively, their implementation might be as follows (but I am very open to suggestions):&lt;pre&gt;type person&lt;br /&gt;   name$&lt;br /&gt;   gender&lt;br /&gt;   struct dob&lt;br /&gt;      year&lt;br /&gt;      month&lt;br /&gt;      day&lt;br /&gt;   end struct&lt;br /&gt;end type&lt;br /&gt;&lt;br /&gt;number_of_people = 30&lt;br /&gt;&lt;br /&gt;struct people (number_of_people) as person&lt;br /&gt;&lt;br /&gt;people (1).name$ = "John"&lt;br /&gt;people (1).gender = male&lt;br /&gt;people (1).dob.year = 1987&lt;br /&gt;people (1).dob.month = 11&lt;br /&gt;people (1).dob.day = 5&lt;br /&gt;...&lt;/pre&gt;I expect to implement structures in time for the Yabasic 3 beta release, but types may come a little later, since I need more feedback on the basic design before I extend it significantly.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5660420964559314809-8071808691247622659?l=yabasicblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://yabasicblog.blogspot.com/feeds/8071808691247622659/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://yabasicblog.blogspot.com/2009/10/often-it-is-desirable-to-have-variables.html#comment-form' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5660420964559314809/posts/default/8071808691247622659'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5660420964559314809/posts/default/8071808691247622659'/><link rel='alternate' type='text/html' href='http://yabasicblog.blogspot.com/2009/10/often-it-is-desirable-to-have-variables.html' title='Structures in Yabasic 3'/><author><name>Thomas Larsen</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5660420964559314809.post-5646537397483365165</id><published>2009-10-08T23:08:00.000-07:00</published><updated>2009-10-16T21:43:42.637-07:00</updated><title type='text'>Introduction to Yabasic 3</title><content type='html'>&lt;p&gt;I indicated in my last post that I would provide some background to Yabasic 3, which I am currently developing, and discuss some of the decisions I have made so far in relation to Yabasic development. I will not delve too far into the history of Yabasic, although that topic may be the subject of a later post.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;Marc-Oliver Ihm authored Yabasic and maintained it up to version 2.763. Sadly, in 2007 he came to the conclusion that he would not be able to continue developing Yabasic: &lt;i&gt;"I am really not comfortable with this conclusion, but I have to admit that probably I will not develop Yabasic any further within the foreseeable future."&lt;/i&gt; However, Yabasic had a functional, clean code-base and a strong community associated with it.&lt;/p&gt;&lt;p&gt;As an avid Yabasic programmer, I wanted to keep Yabasic "alive" and operational. I wondered whether or not to take on the role of developing Yabasic, but I was reluctant to commit myself at a time when my knowledge of the C programming language (in which Yabasic is written) was fairly minimal. Eventually, after some experimentation, I finally &lt;a href="http://forum.basicprogramming.org/index.php/topic,239.0.html"&gt;decided&lt;/a&gt; to take on the responsibility of developing Yabasic with Pedro Sá. As you can see, I was optimistic about how long it might take to produce Yabasic 3: &lt;i&gt;"...I am working on the syntax parser, and I have not yet started on the various actions for the commands and functions, so the initial release date will be some time from now (hopefully no longer than a few months)."&lt;/i&gt; And that was in May 2008.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;Originally, I intended to write Yabasic 3 entirely from scratch. I estimate that I attempted a complete re-write about six times; at minimum, each implementation supported basic commands ("&lt;code&gt;print&lt;/code&gt;", at the very least). But I considered them all unsatisfactory, for one or more reasons.&lt;/p&gt;&lt;p&gt;Finally, I decided to use the existing code-base of Yabasic. I was determined to pare it down to the bare essentials, correcting existing bugs, implementing clean memory management (which I do not expect will be completed in time for the beta release, but it is certainly one of my goals for the future of Yabasic), improving consistency, and in general improving the language's aesthetics in order to prepare it for the changes I intended to make for Yabasic 3. Much of this process has already been completed, and my major focus has now shifted to implementing new features.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;So, what are these "new features"? Well, I've already implemented block comments, which are incredibly convenient when a programmer wishes to comment out a whole block of code. Now you can write the following:&lt;br /&gt;&lt;/p&gt;&lt;pre&gt;/* This is a block&lt;br /&gt;   comment that&lt;br /&gt;   extends over&lt;br /&gt;   multiple lines. */&lt;br /&gt;   print "Hello, world!"&lt;/pre&gt;&lt;p&gt;But the real meat of Yabasic 3, I hope, will be modules, libraries, and "user-defined types". At the risk of being too verbose, I would like to discuss each of these features in turn, explaining their benefits and implementation. Because "user-defined types" merit a topic of their own, I will cover them in my next post.&lt;br /&gt;&lt;/p&gt;&lt;h2&gt;Modules&lt;br /&gt;&lt;/h2&gt;&lt;p&gt;Previous versions of Yabasic implemented rudimentary graphics and some terminal manipulation. Users could, for example, open a window and draw lines, circles, and triangles or print text at a particular location and with a particular colour to the terminal. However, this functionality was built into the core of Yabasic itself, and a number of issues arose as a result of this design.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;There was the issue of compatibility of features across different computer systems. For example, while Marc-Oliver Ihm admirably made graphics handling very similar on both the GNU/Linux and Windows operating systems, there were still a few inconsistencies and incompatibilities that were noticeable in some "graphical" Yabasic programs. Once, I developed a graphical text editor in Yabasic (&lt;i&gt;YATE&lt;/i&gt;, or &lt;i&gt;Y&lt;/i&gt;et &lt;i&gt;A&lt;/i&gt;nother &lt;i&gt;T&lt;/i&gt;ext &lt;i&gt;E&lt;/i&gt;ditor), and had to spend a significant amount of time addressing compatibility concerns. Clearly, this is not a desirable burden to impose on any casual user.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;One way of addressing the issue is to separate Yabasic into a number of modules, with a "core" at the "centre". The Yabasic core is responsible for performing general, system-independent tasks (such as parsing, execution, variable handling, and expression evaluation), while modules are either system-dependent (for instance, graphics or terminal handling) or responsible for performing a specialised task (complex number handling, for example). In general, Yabasic programs written on any one platform should function on all platforms without requiring changes to be made in order to operate correctly or consistently. This implies that modules for performing a particular task should interface consistently with the Yabasic core and Yabasic programs.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;For aesthetic reasons there should be a clear division between system-dependent or specialised modules and the, ideally, system-independent Yabasic core. This does not mean, however, that neatness and clarity are more important in the Yabasic core than in Yabasic modules: indeed, this is not the case. Clarity and aesthetic design are important in any program. But a modular design, which divides a program into components with specific purposes, is easier to debug and usually more fail-safe.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;Modules should not get in the way of a programmer: they are, supposedly, tools for getting jobs done in a consistent, clear way, not obstructions. So I intend to make them blend pleasantly into Yabasic. It is important to note that modules will be compiled into Yabasic and will, therefore, be part of the compiled Yabasic executable. It is, however, important to distinguish modules from the Yabasic core. A standard for modules may need to be written, but I will look for more community input before resolving to pursue this course of action.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;How might modules look? Well, take the following old code which opens a window and displays a red circle in the middle of it:&lt;br /&gt;&lt;/p&gt;&lt;pre&gt;open window 100, 100&lt;br /&gt;color 255, 0, 0&lt;br /&gt;circle 50, 50, 20&lt;/pre&gt;&lt;p&gt;This might (tentatively, very tentatively) be accomplished like this in Yabasic 3:&lt;br /&gt;&lt;/p&gt;&lt;pre&gt;graphics.set_window (graphics.new_window (100, 100))&lt;br /&gt;graphics.color (255, 0, 0)&lt;br /&gt;graphics.circle (50, 50, 20)&lt;/pre&gt;I will not be writing many modules before the Yabasic 3 beta release. I might write a basic terminal-handling module for GNU/Linux, but developing a full, consistent set of modules will take more than a month or two and will require some community effort.&lt;br /&gt;&lt;h2&gt;Libraries&lt;br /&gt;&lt;/h2&gt;&lt;p&gt;In Yabasic, libraries usually are Yabasic programs that contain sets of functions. Users can import these libraries and call the functions defined in them. Thus, libraries can be shared between programs, and much difficult and duplicated effort can be avoided.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;Libraries have already existed in older versions of Yabasic. Yabasic 3, however, simplifies the implementation of libraries significantly while embracing and extending the general concept, and to this end library handling has been completely re-written.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;As I propose to implement libraries, the "&lt;code&gt;export&lt;/code&gt;" statement would disappear, and users would reference imported functions by their name prefixed with the name of the library. For example:&lt;br /&gt;&lt;/p&gt;&lt;pre&gt;import "number"      // imports library&lt;br /&gt;&lt;br /&gt;for number = 1 to 1000&lt;br /&gt;   if number.prime (number) then    // "number.prime ()"&lt;br /&gt;      print number&lt;br /&gt;   endif&lt;br /&gt;next&lt;/pre&gt;&lt;p&gt;The library file &lt;i&gt;number.yab&lt;/i&gt; would contain:&lt;br /&gt;&lt;/p&gt;&lt;pre&gt;sub prime (number)&lt;br /&gt;   local check&lt;br /&gt;   for check = 2 to sqrt (number)&lt;br /&gt;      if number mod check = 0 then&lt;br /&gt;         return false&lt;br /&gt;      endif&lt;br /&gt;   next&lt;br /&gt;   return true&lt;br /&gt;end sub&lt;/pre&gt;&lt;p&gt;This is, of course, a conceptual example, and I would like to hear your feedback.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5660420964559314809-5646537397483365165?l=yabasicblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://yabasicblog.blogspot.com/feeds/5646537397483365165/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://yabasicblog.blogspot.com/2009/10/introduction-to-yabasic-3.html#comment-form' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5660420964559314809/posts/default/5646537397483365165'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5660420964559314809/posts/default/5646537397483365165'/><link rel='alternate' type='text/html' href='http://yabasicblog.blogspot.com/2009/10/introduction-to-yabasic-3.html' title='Introduction to Yabasic 3'/><author><name>Thomas Larsen</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5660420964559314809.post-4398179319771719007</id><published>2009-10-04T23:25:00.000-07:00</published><updated>2009-10-04T23:28:45.746-07:00</updated><title type='text'>Yabasic blog</title><content type='html'>&lt;p&gt;Welcome to the Yabasic blog!&lt;/p&gt;&lt;p&gt;My name is Thomas Larsen, and currently I am busy developing the next version of the Yabasic interpreter, Yabasic version 3 (see &lt;a href="http://yabasic.basicprogramming.org/"&gt;yabasic.basicprogramming.org&lt;/a&gt; for more information). It is my intention to post regularly, at least once or twice a week, for two reasons.&lt;/p&gt;&lt;p&gt;Firstly, I want to keep you informed about progress on Yabasic development. Yabasic 3 development has taken longer than I ever expected it would, but I'm fairly confident that I will be able to release a beta version in November, or December at the latest.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;Secondly, I want to discuss certain features of Yabasic and gain valuable feedback. How should Yabasic evolve in the future? What could, or should, be done to make Yabasic more aesthetic, practical, and usable? With Yabasic 3 implementing new features such as user-defined types and modules, I look forward to hearing your answers to these questions.&lt;/p&gt;&lt;p&gt;When Yabasic 3 is out of beta, I intend to open this blog up to other interested Yabasic developers and programmers so that they, too, can share their experiences and ideas. I hope that future "generations" of Yabasic users will find the Yabasic blog interesting, useful, and inspirational.&lt;/p&gt;&lt;p&gt;In my next post, I'll provide some background to Yabasic 3 and discuss some of the decisions I have made so far in relation to Yabasic development.&lt;/p&gt;&lt;p&gt;Enjoy!&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5660420964559314809-4398179319771719007?l=yabasicblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://yabasicblog.blogspot.com/feeds/4398179319771719007/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://yabasicblog.blogspot.com/2009/10/welcome-to-yabasic-blog-my-name-is.html#comment-form' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5660420964559314809/posts/default/4398179319771719007'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5660420964559314809/posts/default/4398179319771719007'/><link rel='alternate' type='text/html' href='http://yabasicblog.blogspot.com/2009/10/welcome-to-yabasic-blog-my-name-is.html' title='Yabasic blog'/><author><name>Thomas Larsen</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>3</thr:total></entry></feed>
