<?xml version="1.0" encoding="utf-8" ?>
<rss version="2.0" xmlns:osnews="http://osnews.com/rss2#">
	<channel>
		<title>OSNews: </title>
		<link>http://www.osnews.com/story/15617/uBASIC_-_a_Really_Tiny_BASIC_Interpreter</link>
		<description>Exploring the Future of Computing</description>
		<language>en-us</language>
		<copyright>Copyright 2001-2009, David Adams</copyright>
		<webMaster>adam+nospam@osnews.com</webMaster>
		<lastBuildDate>Wed, 25 Nov 2009 09:12:11 GMT</lastBuildDate>
		<image>
			<url>http://www.osnews.com/images/osnews.gif</url>
			<title>OSNews.com</title>
			<link>http://www.osnews.com</link>
		</image>
		<item>
			<title>Bloatware</title>
			<link>http://osnews.com/thread?155794</link>
			<guid isPermaLink="true">http://osnews.com/thread?155794</guid>
			<description>I use the 25 line dds.c - <a href="http://www.ioccc.org/1990/dds.c" rel="nofollow">http://www.ioccc.org/1990/dds.c</a> - from the 1990 ioccc competition for all my BASIC needs.<br />
<br />
Also: 'a very small scripting language for systems where memory really is at a premium'. Didn't some guys called Gates and Allen do something similar a few years back? <br />
<br />
--<br />
10 PRINT &quot;JamesW Rules &quot;;: GOTO 10</description>
			<pubDate>Fri, 25 Aug 2006 11:11:00 GMT</pubDate>
			<author>donotreply@osnews.com (JamesW)</author>
			<category>Comments</category>
		</item>

		<item>
			<title>Low on memory?</title>
			<link>http://osnews.com/thread?155841</link>
			<guid isPermaLink="true">http://osnews.com/thread?155841</guid>
			<description>If you have memory constraints, why on earth use a scripting language?</description>
			<pubDate>Fri, 25 Aug 2006 13:07:00 GMT</pubDate>
			<author>donotreply@osnews.com (Invincible Cow)</author>
			<category>Comments</category>
		</item>

		<item>
			<title>Hardware isn't the only constraint on the system.</title>
			<link>http://osnews.com/thread?155875</link>
			<guid isPermaLink="true">http://osnews.com/thread?155875</guid>
			<description>Just because there are hardware constraints, doesn't mean the user isn't time constrained.   Sometimes you need a quick an dirty one-time hack that would take a minute to knock out in a high level script.</description>
			<pubDate>Fri, 25 Aug 2006 14:13:00 GMT</pubDate>
			<author>donotreply@osnews.com (Calvin)</author>
			<category>Comments</category>
		</item>

		<item>
			<title>Thanks</title>
			<link>http://osnews.com/thread?155919</link>
			<guid isPermaLink="true">http://osnews.com/thread?155919</guid>
			<description>I am downloading it right now.  The problem with the versions of interperted Basic that I have right now is that they are so big and complex that I don't have the time to modify them.  A smaller program is just what I need.<br />
<br />
Again thanks for the URL and code.</description>
			<pubDate>Fri, 25 Aug 2006 16:21:00 GMT</pubDate>
			<author>donotreply@osnews.com (Earl Colby pottinger)</author>
			<category>Comments</category>
		</item>

		<item>
			<title>Neat</title>
			<link>http://osnews.com/thread?155924</link>
			<guid isPermaLink="true">http://osnews.com/thread?155924</guid>
			<description>I just donwloaded it, very neat.</description>
			<pubDate>Fri, 25 Aug 2006 16:39:00 GMT</pubDate>
			<author>donotreply@osnews.com (snowflake)</author>
			<category>Comments</category>
		</item>

		<item>
			<title>Cool</title>
			<link>http://osnews.com/thread?155948</link>
			<guid isPermaLink="true">http://osnews.com/thread?155948</guid>
			<description>Is this part of the other os write-up contest thing?</description>
			<pubDate>Fri, 25 Aug 2006 17:19:00 GMT</pubDate>
			<author>donotreply@osnews.com (Sphinx)</author>
			<category>Comments</category>
		</item>

		<item>
			<title>RE: Low on memory?</title>
			<link>http://osnews.com/thread?155965</link>
			<guid isPermaLink="true">http://osnews.com/thread?155965</guid>
			<description>An interpreted language can be very memory efficient, since you can reduce high level operations to a single byte.<br />
<br />
Simple example:<br />
<br />
PRINT &quot;THIS IS A STRING&quot;<br />
<br />
the PRINT gets turned into a token, say 0x25, followed by a 0x10 byte (16, string length) then the characters of the string.<br />
<br />
LD HL, STRING_LABEL<br />
JSR PRINT<br />
<br />
The interpreter has a 1 byte overhead above the actual data space, whereas in assembly you have a 6 byte overhead.<br />
<br />
For a single print statement, the rest of the interpreter is overkill. But for large programs, since the interpreter is a static cost, the cost of the interpreter becomes less and less in terms of the overall size cost of the program.<br />
<br />
Not to mention any actual productivity benefits.<br />
<br />
No, typically the cost of an interpreter has always been performance, not size.</description>
			<pubDate>Fri, 25 Aug 2006 19:04:00 GMT</pubDate>
			<author>donotreply@osnews.com (whartung)</author>
			<category>Comments</category>
		</item>

		<item>
			<title>RE: Hardware isn't the only constraint on the system.</title>
			<link>http://osnews.com/thread?155981</link>
			<guid isPermaLink="true">http://osnews.com/thread?155981</guid>
			<description>Thank you for clarifying that.  A lot of what I do for work entails &quot;quick and dirty, one-time hacks&quot;.  I used to use Perl, but now use Python.  I can get more done with Python (or Perl) in 15 minutes, than most programmers can do with C or C++ in a day.  Ok, two days.<br />
<br />
We are also starting to do more of our project development in Python.  There are lots of benefits besides developer time to take into consideration.  Readability and maintainability are two biggies.  With today's much higher performance CPUs and tons of memory, the runtime of these &quot;scripts&quot; is no longer an issue like it once was.  If your program has to do some massive number crunching, you can write just that part in C, and the rest in Python (or Perl), and have the best of both worlds.</description>
			<pubDate>Fri, 25 Aug 2006 20:13:00 GMT</pubDate>
			<author>donotreply@osnews.com (DoctorPepper)</author>
			<category>Comments</category>
		</item>

		<item>
			<title>One more thought...</title>
			<link>http://osnews.com/thread?156007</link>
			<guid isPermaLink="true">http://osnews.com/thread?156007</guid>
			<description>This takes me back to the early 1980's, and my introduction to micro-computers (VIC-20, mid-1982).  All of the major brands of computer had a built-in BASIC interpreter, and most of them were quite frugal with resource use.<br />
<br />
Take the TRS-80 Model 100 (released around 1983).  This small &quot;notebook&quot; computer had about 32 KB of programming in ROM, which held all of the built-in applications, including a text editor, address book, scheduler, communications program AND a BASIC interpreter.  That was a pretty handy little notebook, and there are lots of them still hanging around.<br />
<br />
The BASIC interpreter may not have been the most advanced in the world, but you could do a lot with it.  I wrote a simple automobile payment program one Saturday morning, then took the Model 100 with me to the auto dealership that afternoon, and used it to calculate what my payments would be, based on an assumed interest rate and the sticker price of the car.  It was pretty darned accurate too!<br />
<br />
That was a great time to be in computers!  Sometimes simple is good :-)</description>
			<pubDate>Fri, 25 Aug 2006 21:47:00 GMT</pubDate>
			<author>donotreply@osnews.com (DoctorPepper)</author>
			<category>Comments</category>
		</item>

		<item>
			<title>Forth</title>
			<link>http://osnews.com/thread?156031</link>
			<guid isPermaLink="true">http://osnews.com/thread?156031</guid>
			<description>8-bit home computers with built in Basic. These were the good times ;-)<br />
<br />
Now about uBasic: If you are looking for a small, trivially portable interpreted language, there's Forth. More powerful than Basic, most would say. Weirder too. <br />
<br />
Used in the 70s and 80s to make the best out of computers with 1KB RAM and a few Khz CPUs.<br />
Nowadays used in BIOS, boot loaders (FreeBSD's loader and others), embedded and such.<br />
Trivially portable: Most of Forth is written in Forth itself and you only need to implement a few hooks in assembly.<br />
Can act as an OS for itself. Cooperative multitasking, nonetheless! Yet it fits in ROM or a few disk sectors.<br />
<br />
Have a look, and have fun!</description>
			<pubDate>Sat, 26 Aug 2006 00:22:00 GMT</pubDate>
			<author>donotreply@osnews.com (dimosd)</author>
			<category>Comments</category>
		</item>

		<item>
			<title>Forth - No thanks</title>
			<link>http://osnews.com/thread?156076</link>
			<guid isPermaLink="true">http://osnews.com/thread?156076</guid>
			<description>Forth is one of those lanuages that could be written to be easy to read, but was written to be easy to process instead.  That is why I am a Basic/Comal fan.</description>
			<pubDate>Sat, 26 Aug 2006 05:34:00 GMT</pubDate>
			<author>donotreply@osnews.com (Earl Colby pottinger)</author>
			<category>Comments</category>
		</item>

		<item>
			<title>RE: Bloatware</title>
			<link>http://osnews.com/thread?156133</link>
			<guid isPermaLink="true">http://osnews.com/thread?156133</guid>
			<description>My eyes! They burn! Never understood what drove people to submit programs to the IOCCC. Must be have some sadistic streak in them. <img src="/images/emo/wink.gif" alt=";)" /> <br />
<br />
The code posted in the original article reminds me of the C interpreter I wrote during my undergraduate years. It's simple, it's straight forward, though I imagine BASIC is an easier language to parse than C since you have less overloaded constructs (the operator * for example).</description>
			<pubDate>Sat, 26 Aug 2006 19:01:00 GMT</pubDate>
			<author>donotreply@osnews.com (evangs)</author>
			<category>Comments</category>
		</item>
	</channel>
</rss>
