Some time back I blogged about how someone wrote a one page program in Just BASIC that draws a colorful fractal image.
And I quote (myself):
"What's great about BASIC and languages like it is that you don't have a write a lot of code that has nothing to do with what you're trying to create (like Java for example). It should be really easy to throw together a little code and play with graphics. Programming should be fun, not a burden.
Here is a thread that shows how to draw fractals in less than a page of BASIC."
But the link is now broken because the forum site shut down and we lost a lot of good stuff.
Here's where we make it right. A few months ago I found a fractal example for the Apple II written in Applesoft BASIC. I thought it was pretty cool, so I adapted it for Liberty BASIC.
startMS = time$("ms")
WindowHeight = 230
open "mandelbrot set" for graphics as #gr
#gr down()
#gr fill("black")
color$ = "red orange yellow green blue red orange yellow green black"
for x = 0 to 279
for y = 0 to 95
x1 = x / 280 * 3 - 2 : y1 = y / 191 * 2 - 1
i = 0:s = x1:t = y1
while i < 20 AND s * s + t * t < 4
s1 = s * s - t * t + x1
t = 2 * s * t + y1:s = s1: i = i + 1
wend
c = i/2
#gr color(word$(color$, c + 1))
if c <> 0 then #gr set(x, y) : #gr set(x, 191-y)
next y
next x
print "done in "; time$("ms")-startMS; " milliseconds"
Note: This is written to run on Liberty BASIC v5 to be one of the example programs. LB5 is as of the time of this writing is in alpha test. Click to visit the Liberty BASIC v5 board in our forum.
Showing posts with label basic. Show all posts
Showing posts with label basic. Show all posts
Thursday, September 19, 2019
Tuesday, November 20, 2018
The Java Propaganda Language
I recently posted the following reply to an article about how management failed when they made incompetent choices about an implementation technology simply because they wanted to use the popular tools instead of the right ones.
Back in the year 2000...
I worked for LingoMotors, a fantastic startup some years ago which had built an amazing AI system that would parse the English language. The whole thing was built using VisualWorks Smalltalk. We had more than a dozen doctorate level computational linguists, several of them famous in their community. The system was amazing, and it leveraged the strengths of Smalltalk in a great way. This was a way to tag information with real metadata about the meaning of the data, and our first customer was a large online bookseller.
When we needed another round of financing we kept on getting pressure from potential investors who agreed we had something great, but they wanted us to port the whole thing to Java before they would back us. They had no clue that doing this would have killed our competitive edge, and it was hard to secure more funding.
The choice of implementation technology had become an issue of political correctness, in a sense. A lot of really wonderful programming language products died when the Java juggernaut trampled the world with overhyped promises. Now it seems that Java is over the top of its S curve, and things are more relaxed. It could happen again.
Labels:
basic,
cincom,
incompetence,
java,
language,
management,
paradigm,
political correctness,
popular,
programming,
reckless,
smalltalk,
sun microsystems,
technology,
tools,
venture,
visualworks
Saturday, October 27, 2018
Jobs vs Woz - The Closed vs Open Hand
Most people know who Steve Jobs was. He was the charismatic and visionary frontman for Apple for many years. He even managed a friendly coup at Apple when he took back the company he was ousted from. He was a controversial person. He had his fans and his detractors. I think he certainly had his good points, but I am really more of a fan of the other less well known Steve of Apple, Steve Wozniak affectionately known as Woz.
Woz was the designer of the original line of Apple II computers. He had a vision of computers as computers, for everyone. A hippy vision of computing? ;-)
What appeals to me more about Woz is that he was generous and wanted to give people something great. His ambition lay more in personal accomplishment and also in sharing his knowledge with others. When he created the Apple II computer he wanted it to be open. He provided a schematic so that users could understand the computer, and so that they could modify it. People even wrote books about how to do this. Another example of this is that Woz included expansion slots so that people could extent the computer in this way.
When you turn on an Apple II you can program it right away. There is a built in machine language monitor. Depending on the model you can either use Woz's Integer BASIC or you can run Applesoft BASIC.
This version of an Apple computer is a real computer, for computing, by programming. A computer is a device for a computer user.
Enter the computer as appliance. :-/
Steve Jobs had a vision of computer as appliance. This is purely a business perspective. Sell more computers by marketing to the fat middle of the bell curve.
Of course he is not the only one to think this way. Somehow progress in computing tends towards reducing it down to a touchscreen and away from programming and true computer literacy. The Macintosh was a step in this direction. This has a certain irony because the form of the Mac user interface was inspired directly by the Smalltalk windowing user interface, a programming system. In addition to the appliance-like format of the Mac software, the computer itself was meant to be closed unit. You need a special screwdriver to open it, and there are no expansion slots.
So the Mac was a closed machine, and it pointed other systems in this direction (i.e. Microsoft Windows). You could purchase programming software for the Mac, but unlike other computers on the market there was no direct path to programming when you turned on the machine. Why was there no easy programming option on the desktop when you started the Mac OS? For more on this issue see Why Johnny Can't Code which is a popularly referenced article on this topic.
HyperCard eventually was made available on the Mac as an easy and fun programming tool and it was included free of charge for some years, but now it is gone.
Microsoft followed suit with Windows and they too also did not include even a version of their famous BASIC as an icon on the desktop of their new system. I wrote Liberty BASIC back in the early 1990s as a response to this. Microsoft eventually provided Visual Basic, but I strongly suggest the this should have been included, for free, and an icon to start Visual Basic should have appeared on the Windows desktop on startup.
I'm not going to suggest that there is some sort of conspiracy to dumb down the computer. What I will say is that this amounts to a stupid and harmful mistake. The computer is so powerful and wonderful as a creative too. These new computers as appliances are depriving people of so much by simply omitting an easy and friendly programming tool. A desktop icon to entice the curious to try something simple enough for children and powerful enough for casual applications programming.
So, what is really better? How do you define progress? What of the early 6502 and Z80 computers when compared to what we have today? The new computers dwarf these charming old timers, but they are less powerful in terms of the concepts they omit from the user.
Woz was the designer of the original line of Apple II computers. He had a vision of computers as computers, for everyone. A hippy vision of computing? ;-)
What appeals to me more about Woz is that he was generous and wanted to give people something great. His ambition lay more in personal accomplishment and also in sharing his knowledge with others. When he created the Apple II computer he wanted it to be open. He provided a schematic so that users could understand the computer, and so that they could modify it. People even wrote books about how to do this. Another example of this is that Woz included expansion slots so that people could extent the computer in this way.
When you turn on an Apple II you can program it right away. There is a built in machine language monitor. Depending on the model you can either use Woz's Integer BASIC or you can run Applesoft BASIC.
This version of an Apple computer is a real computer, for computing, by programming. A computer is a device for a computer user.
Enter the computer as appliance. :-/
Steve Jobs had a vision of computer as appliance. This is purely a business perspective. Sell more computers by marketing to the fat middle of the bell curve.
Of course he is not the only one to think this way. Somehow progress in computing tends towards reducing it down to a touchscreen and away from programming and true computer literacy. The Macintosh was a step in this direction. This has a certain irony because the form of the Mac user interface was inspired directly by the Smalltalk windowing user interface, a programming system. In addition to the appliance-like format of the Mac software, the computer itself was meant to be closed unit. You need a special screwdriver to open it, and there are no expansion slots.
So the Mac was a closed machine, and it pointed other systems in this direction (i.e. Microsoft Windows). You could purchase programming software for the Mac, but unlike other computers on the market there was no direct path to programming when you turned on the machine. Why was there no easy programming option on the desktop when you started the Mac OS? For more on this issue see Why Johnny Can't Code which is a popularly referenced article on this topic.
HyperCard eventually was made available on the Mac as an easy and fun programming tool and it was included free of charge for some years, but now it is gone.
Microsoft followed suit with Windows and they too also did not include even a version of their famous BASIC as an icon on the desktop of their new system. I wrote Liberty BASIC back in the early 1990s as a response to this. Microsoft eventually provided Visual Basic, but I strongly suggest the this should have been included, for free, and an icon to start Visual Basic should have appeared on the Windows desktop on startup.
I'm not going to suggest that there is some sort of conspiracy to dumb down the computer. What I will say is that this amounts to a stupid and harmful mistake. The computer is so powerful and wonderful as a creative too. These new computers as appliances are depriving people of so much by simply omitting an easy and friendly programming tool. A desktop icon to entice the curious to try something simple enough for children and powerful enough for casual applications programming.
So, what is really better? How do you define progress? What of the early 6502 and Z80 computers when compared to what we have today? The new computers dwarf these charming old timers, but they are less powerful in terms of the concepts they omit from the user.
Saturday, October 6, 2018
Raise Your Computer Literacy to Mastery
There are different levels of computer literacy.
- Beginner - You know how to turn on a computer, open a web browser, use email and a word processor, etc. and maybe how to copy files around. If you have been using a computer for many years and this is what you know, you are still a beginner.
- Power User - In addition to what the Beginner knows you also know how to tweak operating system settings and how to type some commands in a terminal or command window.
- Master - You know all the above and you also understand programming concepts. Without this knowledge you are really at the mercy of the computer and software providers.
I like to compare this to understanding something about cars and how they work. People who drive cars without automotive literacy face big challenges when buying a car (especially a used car), when the car breaks down on the road, and when bringing the car to the mechanic for repair. Understanding cars improves driving skills, personal safety, and saves you time and money.
When schools first started teaching young people about computers they had a high concept of literacy and they tried to teach programming using languages like Logo, and Pilot and BASIC and sometimes Pascal. Over time this eroded and computer class became more about just teaching the Beginner skill set described above.
Adults now are wowed by how much young people know about computers, but this is usually just a knowledge of computer trivia and of surface details, and not a deep understanding of computers at all. We must be careful not to be hoodwinked by the semblance of mastery.
Real mastery is achieved only if you understand programming and have learned to make the machine do what you want. Otherwise your computer will only do what other people have programmed it to do, and is that really what a so called personal computer is supposed to be? I am including phones and tablets when I use the word computer, because clearly these things are computers.
A non-obvious benefit of mastery of computer literacy is the personal growth that happens when you learn to program because of the way it sharpens the mind. Programming teaches analytical thinking and problem solving skills, and it can also be great fun.
I hope that this article encourages you the reader to raise your level of computer literacy!
Labels:
basic,
beginner,
college,
computer literacy,
java,
logo,
mastery,
Pascal,
pilot,
power user,
programming,
universities,
vocational training
Sunday, September 23, 2018
Programming Inside the Lines
Why do people program computers?
Let's compare programming to finger painting. If you gave a child some finger paints and a sheet of paper and a smock, would you yell at the child for what was painted, or if the activity made a mess?
I started programming when I was 11 years old. Nobody made me do it. I sat down with my father's HP-67 calculator and the wonderful manual and I was hooked! From that point forward I spent much less time on my electronics hobby and spent my energy programming.
So, what is fun about programming? Here is a short list:
I learned programming using the so called bad languages, and I had a blast and nobody got hurt! I learned a ton and nothing stopped me from learning the so called good languages later on. I encourage everyone to learn new things but if you decide to only learn one programming language you have not committed a crime to society. Don't let anyone ever tell you different.
I know that nobody needs my permission, but I'll give it to you anyway! Go forth and have fun programming! Color outside the lines and drum to your own beat! Don't be afraid of the self appointed programming police!
- Business - To automate a process or financial problem
- Automation - To control homes, factories, machines
- Research - Data mining, simulation, modeling
- Communication - Email, telephony, broadcasting, journalism
- Recreation - Games, movies, music
- And for fun - Yes, programming is also an enjoyable recreational activity.
Let's compare programming to finger painting. If you gave a child some finger paints and a sheet of paper and a smock, would you yell at the child for what was painted, or if the activity made a mess?
I started programming when I was 11 years old. Nobody made me do it. I sat down with my father's HP-67 calculator and the wonderful manual and I was hooked! From that point forward I spent much less time on my electronics hobby and spent my energy programming.
So, what is fun about programming? Here is a short list:
- Programming involves learning, which lights up neurons all over and stimulates the feel good hormone dopamine.
- Programming involves problem solving, which is also a kind of learning.
- Programming is a creative activity, and people enjoy making things.
- Programming is delightfully interactive. Give to the computer and it gives back.
- Programming as an enjoyable social activity, sharing/working/competing with others
I learned programming using the so called bad languages, and I had a blast and nobody got hurt! I learned a ton and nothing stopped me from learning the so called good languages later on. I encourage everyone to learn new things but if you decide to only learn one programming language you have not committed a crime to society. Don't let anyone ever tell you different.
I know that nobody needs my permission, but I'll give it to you anyway! Go forth and have fun programming! Color outside the lines and drum to your own beat! Don't be afraid of the self appointed programming police!
Sunday, September 16, 2018
Python - The Emperor's New Clothes
I recently posted a couple of examples of a starfield simulation written in BASIC. One of these was written in Commodore BASIC for the VIC-20. The other was written in Liberty BASIC for Windows.
BASIC gets a lot of flack from people with a certain kind of snob factor (yes, you know who you are). And there is the infamous comment by Edsger Dijkstra, and BASIC has never lived it down. Nowadays when you see people discussing what is the best first language I probably see Python mentioned most. In these forum discussions someone always seems to snidely denounce BASIC as that old thing with the GOTO and the unreadable spaghetti code. They don't seem to have a good reason to recommend Python, except that it isn't BASIC.
People also recommend C and it's derivatives such as C++ which also has GOTO. So go figure.
Wait, here is something scandalous! On the Python Software Foundation website, in their design and history FAQ page, they actually answer the question about why there is no GOTO in Python by encouraging people to use exception handling as a hack to simulate something like GOTO! Ummmm. See for yourself. https://docs.python.org/3/faq/design.html#why-is-there-no-goto
Okay, getting back to the starfield simulation example. If you look at the version of the starfield simulation written in Liberty BASIC, it addresses some of the things that BASIC is frowned on about.
BASIC gets a lot of flack from people with a certain kind of snob factor (yes, you know who you are). And there is the infamous comment by Edsger Dijkstra, and BASIC has never lived it down. Nowadays when you see people discussing what is the best first language I probably see Python mentioned most. In these forum discussions someone always seems to snidely denounce BASIC as that old thing with the GOTO and the unreadable spaghetti code. They don't seem to have a good reason to recommend Python, except that it isn't BASIC.
People also recommend C and it's derivatives such as C++ which also has GOTO. So go figure.
Wait, here is something scandalous! On the Python Software Foundation website, in their design and history FAQ page, they actually answer the question about why there is no GOTO in Python by encouraging people to use exception handling as a hack to simulate something like GOTO! Ummmm. See for yourself. https://docs.python.org/3/faq/design.html#why-is-there-no-goto
Okay, getting back to the starfield simulation example. If you look at the version of the starfield simulation written in Liberty BASIC, it addresses some of the things that BASIC is frowned on about.
- GOTO - Uh oh, not really. There is one GOTO, but in this case I'm not sure a WHILE/WEND forever loop is really better, so... The Commodore BASIC version has three GOTOs.
- Structure - The Liberty BASIC version uses control structures properly the way modern languages do.
- Line numbers - Liberty BASIC programs do not require numbers. You can give your routines meaningful names instead of numbers.
Okay, let's be frank. Liberty BASIC was not the first version of BASIC to solve these problems. There are many BASICs with modern features, and so it isn't fair to criticize BASIC as being a bad language for beginners. BASIC has been a proper language for teaching good programming practices for a very long time now.
What do you think? Comments welcome. :-)
Labels:
basic,
basic interpreter,
c,
c++,
Commodore,
dijkstra,
goto,
liberty basic,
line numbers,
python,
qbasic,
spaghetti code,
structured programming,
vic-20
Tuesday, September 11, 2018
BASIC over at Rosetta Code
I was curious to see how many different BASIC dialects are represented over at rosettacode.org. Here is the list (excluding VB dialects) of languages with BASIC in the name. I also included RapidQ because I know that is a BASIC also.
Rosetta code is a really cool site. If you're not familiar, it is a site showing how to solve many different kinds of problems in many programming languages, so if you like to solve problems you can help to add code to their site in your favorite BASIC. :-)
If your favorite version of BASIC is not there, you might consider adding it!
• Applesoft BASIC
• BASIC
• BASIC256
• BBC BASIC
• Commodore BASIC
• EhBASIC
• FreeBASIC
• FutureBasic
• FUZE BASIC
• GFA Basic
• GLBasic
• GW-BASIC
• Integer BASIC
• IWBASIC
• Liberty BASIC
• Locomotive Basic
• MSX Basic
• OxygenBasic
• PowerBASIC
• PureBasic
• QBasic
• Quite BASIC
• RapidQ
• REALbasic
• Run BASIC
• Script Basic
• Sinclair ZX81 BASIC
• Smart BASIC
• SmileBASIC
• Superbase BASIC
• TechBASIC
• TI-83 BASIC
• TI-89 BASIC
• True BASIC
• Yabasic
• ZX Spectrum Basic
• BASIC
• BASIC256
• BBC BASIC
• Commodore BASIC
• EhBASIC
• FreeBASIC
• FutureBasic
• FUZE BASIC
• GFA Basic
• GLBasic
• GW-BASIC
• Integer BASIC
• IWBASIC
• Liberty BASIC
• Locomotive Basic
• MSX Basic
• OxygenBasic
• PowerBASIC
• PureBasic
• QBasic
• Quite BASIC
• RapidQ
• REALbasic
• Run BASIC
• Script Basic
• Sinclair ZX81 BASIC
• Smart BASIC
• SmileBASIC
• Superbase BASIC
• TechBASIC
• TI-83 BASIC
• TI-89 BASIC
• True BASIC
• Yabasic
• ZX Spectrum Basic
Labels:
basic,
dialects,
examples,
liberty,
power,
problem solving,
programming,
rosetta code,
run
Saturday, August 25, 2018
Starfield Simulation in Liberty BASIC
Here is the starfield simulation that for the VIC-20 that I posted a few days ago, but ported as simply as possible to Windows using the Liberty BASIC language (http://www.libertybasic.com). If you compare them side by side you can see that a lot of the original code is preserved across the translation.
Enjoy!
Enjoy!
dim st(9,1)
gosub [setup]
timer 20, [cycle]
[cycle]
for c=0 to n
xold=st(c,0)
yold=st(c,1)
st(c,0)=xold*1.23
st(c,1)=yold*1.23
x=int(st(c,0))
y=int(st(c,1))
if abs(x)<15 and abs(y)<15 then
gosub [clearStar]
else
if abs(x)>200 or abs(y)>200 then
st(c,0)=(rnd(1)-0.5)*3
st(c,1)=(rnd(1)-0.5)*3
else
gosub [drawStar]
end if
end if
next c
wait
goto [cycle]
[clearStar]
#starfield "color black ; place "; xCenter + xold; " "; yCenter + yold
#starfield "\."
return
[drawStar]
gosub [clearStar]
#starfield "color white ; place "; xCenter + x; " "; yCenter + y
#starfield "\."
return
[setup]
input"# stars (1-10)";n
n=n-1
for x=0 to n
st(x,0)=(rnd(1)-0.5)*200
st(x,1)=(rnd(1)-0.5)*200
next x
open "starfield" for graphics as #starfield
#starfield "home ; posxy xCenter yCenter"
#starfield "down ; fill black ; backcolor black"
#starfield "trapclose [quit]"
return
[quit]
close #starfield
end
Tuesday, August 21, 2018
Starfield Simulation in Commodore BASIC
I posted a challenge in the VIC-20 group on Facebook. The idea was to replicate the forward screen of the starship Enterprise from Star Trek. This shows stars moving from the center of the screen to the edges, simulating forward motion. It isn't meant to be an accurate 3D simulation. ;-)
Here is my code of this. One other person also submitted a version of it. This could form the basis for a game.
[Update] --- I made a new version of this in Liberty BASIC! Click to see the new version
Here is my code of this. One other person also submitted a version of it. This could form the basis for a game.
[Update] --- I made a new version of this in Liberty BASIC! Click to see the new version
10 gosub 500
100 for c=0 to n
110 xold=st(c,0)
120 yold=st(c,1)
130 st(c,0)=xold*1.23
140 st(c,1)=yold*1.23
150 x=int(st(c,0))
160 y=int(st(c,1))
165 if abs(x)<2 and abs(y)<2 then 320
170 if abs(x)>10 or abs(y)>10 thenst(c,0)=(rnd(1)-.5)*3:st(c,1)=(rnd(1)-.5)*3:goto150
180 pstar=center+x+y*22
190 poke center+int(xold)+int(yold)*22,32
200 poke pstar,108
300 next c
310 goto 100
320 poke center+int(xold)+int(yold)*22,32
400 next c
410 goto 100
500 poke 36879,14
501 input"# stars (1-10)";n
502 n=n-1
505 print"{clrscrn}";
510 dim st(9,1)
520 for x=0 to n
530 st(x,0)=(rnd(1)-.5)*10
540 st(x,1)=(rnd(1)-.5)*10
550 next x
590 center=7932
600 return
Labels:
basic,
Commodore,
enterprise,
facebook,
simulation,
star trek,
starfield,
vic-20,
video game
Monday, August 20, 2018
Introducing The Friendly Computer!
When Commodore introduced the VIC-20 they called it The Friendly Computer. This is probably more because of the manual they included with it than because of anything else. The book was really easy to understand.
Here is my own VIC-20. This is an early one, with the squared off keys and the two-prong power plug. I've got it plugged into a Sylvania TV using an RF modulator.
If you look closely at the screen it reports CBM BASIC V2, and 3583 BYTES FREE. The computer comes with 5K RAM, but it uses some of that to map the screen, and some more for managing the BASIC interpreter. If they had thought to provide 8K RAM this would have doubled the amount the programmer has access to. This would have made the VIC-20 a lot more powerful.
Nowadays people wonder how anything could every be written with only 3.5K RAM, but we were so used to this back then. You might be surprised how much can be done with a little ingenuity. As a comparison, the original Atari 2600 VCS game console had only 128 bytes of RAM. The VIC-20 has 28 times more RAM! In addition, you could plug a RAM expansion cartridge into the VIC-20 to add more RAM. Commodore made several sizes up to 16K RAM, and other companies made bigger ones.
I also have a Commodore C2N cassette drive. I also had one of these in the 80's. I have been using the tape drive to save some small programs. This is nothing like a floppy drive, but you can save programs by name, and it sure beats retyping in programs every time you want to use them.
I also have a Commodore 1571 floppy drive. These are great, but they don't make it possible to send and received programs to and from other people on the Internet because the disks have a format that can't be read on Macs or PCs. I want to share what I'm doing, so I have purchased a kit to build my own SD flash memory adapter that will behave like a floppy drive and also let me use the SD card to copy files to other computers so I can share with others. I'm very excited about that and I'll blog about it also.
Here is my own VIC-20. This is an early one, with the squared off keys and the two-prong power plug. I've got it plugged into a Sylvania TV using an RF modulator.
If you look closely at the screen it reports CBM BASIC V2, and 3583 BYTES FREE. The computer comes with 5K RAM, but it uses some of that to map the screen, and some more for managing the BASIC interpreter. If they had thought to provide 8K RAM this would have doubled the amount the programmer has access to. This would have made the VIC-20 a lot more powerful.
Nowadays people wonder how anything could every be written with only 3.5K RAM, but we were so used to this back then. You might be surprised how much can be done with a little ingenuity. As a comparison, the original Atari 2600 VCS game console had only 128 bytes of RAM. The VIC-20 has 28 times more RAM! In addition, you could plug a RAM expansion cartridge into the VIC-20 to add more RAM. Commodore made several sizes up to 16K RAM, and other companies made bigger ones.
I also have a Commodore C2N cassette drive. I also had one of these in the 80's. I have been using the tape drive to save some small programs. This is nothing like a floppy drive, but you can save programs by name, and it sure beats retyping in programs every time you want to use them.
I also have a Commodore 1571 floppy drive. These are great, but they don't make it possible to send and received programs to and from other people on the Internet because the disks have a format that can't be read on Macs or PCs. I want to share what I'm doing, so I have purchased a kit to build my own SD flash memory adapter that will behave like a floppy drive and also let me use the SD card to copy files to other computers so I can share with others. I'm very excited about that and I'll blog about it also.
Back to BASICs
Some time ago I began to assemble a small collection of vintage home computers in order to begin blogging about what makes these machines so appealing. In particular, programming these computers in BASIC in my early years made a huge impression on me and my creation of Liberty BASIC was inspired by my love for BASIC.
I have obtained the following machines in working condition.
Apple //c
Commodore 128 (a Commodore 64 compatible machine which also has a Z80 processor)
Commodore VIC-20
Atari 800XL
TRS-80 Color Computer 2 (not sure I will actually use this one)
And a few less popular computers that might make guest appearances.
To begin with, I am focusing on the Commodore VIC-20. I have some ideas about very simple and fun projects in BASIC, and some Forth. Since most of these machine also have a 6502 processor, perhaps there will also be some posts about that.
I have obtained the following machines in working condition.
Apple //c
Commodore 128 (a Commodore 64 compatible machine which also has a Z80 processor)
Commodore VIC-20
Atari 800XL
TRS-80 Color Computer 2 (not sure I will actually use this one)
And a few less popular computers that might make guest appearances.
To begin with, I am focusing on the Commodore VIC-20. I have some ideas about very simple and fun projects in BASIC, and some Forth. Since most of these machine also have a 6502 processor, perhaps there will also be some posts about that.
Labels:
6502,
apple II,
apple IIc,
Atari,
atari 800xl,
basic,
Commodore,
commodore 128,
commodore 64,
forth,
liberty basic,
trs-80,
vic-20,
z80
Friday, January 8, 2016
Writing a book was more than I bargained for
I really had no idea how much work this was going to be. I had good starting material with the Liberty BASIC tutorial, which had actually been fashioned into a spiral bound book which I produced at the local Staples store, but this had to be more polished.
I had no serious word processing software. This meant that I needed to use the Write application that came with Microsoft Windows. The only strengths that this provided was that it was essentially free, it was easy to understand and didn't burden me with any strange gotchas that full blown word processors often do, and it allowed page footers.
This was hard work. The process was to produce a draft of a chapter, print it out and then I would lay down on the carpet with a pencil and read it, marking it up as I went. Then I would go back and enter in all my changes and repeat the process several times until that chapter seemed good enough for the book.
This took weeks. By the time I was done, I was determined to never, ever do it again. Of course this didn't end up being my last book. :-/
I had no serious word processing software. This meant that I needed to use the Write application that came with Microsoft Windows. The only strengths that this provided was that it was essentially free, it was easy to understand and didn't burden me with any strange gotchas that full blown word processors often do, and it allowed page footers.
This was hard work. The process was to produce a draft of a chapter, print it out and then I would lay down on the carpet with a pencil and read it, marking it up as I went. Then I would go back and enter in all my changes and repeat the process several times until that chapter seemed good enough for the book.
This took weeks. By the time I was done, I was determined to never, ever do it again. Of course this didn't end up being my last book. :-/
Labels:
authoring,
basic,
basic programming,
book,
liberty basic,
microsoft windows,
programming,
tutorial,
word processor,
write,
writing
Thursday, January 7, 2016
NRI Schools and my first book
About this time I received a phone call from someone at NRI Schools, McGraw-Hill Continuing Education Center which was a popular adult education company. They told me that they were developing a new computer programming course and they wanted to base it on Liberty BASIC. Wow!
Here's what they wanted to do. They would write their own course, which would be a staple bound series of books that they would distribute to their students. They also wanted an actual official Liberty BASIC manual from me for which they would prepay me.
This was to be a perfect bound book with a full color cover. I had never done such a thing before, so I had a lot to learn. It was very helpful that they were willing to prepay for the first 1000 copies of the book because otherwise I was not going to be able to bankroll this project.
I decided that the book would be based on the tutorial that came with Liberty BASIC.
This was going to be a lot of work, but it was very exciting!
Here's what they wanted to do. They would write their own course, which would be a staple bound series of books that they would distribute to their students. They also wanted an actual official Liberty BASIC manual from me for which they would prepay me.
This was to be a perfect bound book with a full color cover. I had never done such a thing before, so I had a lot to learn. It was very helpful that they were willing to prepay for the first 1000 copies of the book because otherwise I was not going to be able to bankroll this project.
I decided that the book would be based on the tutorial that came with Liberty BASIC.
This was going to be a lot of work, but it was very exciting!
Monday, March 14, 2011
Power BASIC and the Uncrashable Kingdom
I had it in mind to use Power BASIC as the compiler to implement the new DOS file server for the factory. This was a new, slicker and rebranded version of Turbo BASIC which I had been using for a while. It wasn't cheap. Power BASIC was a nicely polished compiler and had good documentation. I think we paid $300 or so for it.
I wanted to create a nice UI for the file server so I purchased a windowing library for Power BASIC. It made it easy to create text mode windows using graphics characters. The way it worked was very similar to the way that a Windows programmer would do it in C. You called functions which created windows, buttons, etc. These would return a numeric handle.
Your program would intercept messages from the UI library in an event loop and act on them. Each message would include the handle for the window or widget it was about, and also a value for an action such as a click or a key press. This is not an easy way to write windowing code, but the file server would have a simple enough UI. The end result looked nice and was functional.
I learned a lot on this project. This must have been the highest quality BASIC code I had written to this point. It was a multitasking file server using state machine techniques. Unlike its Xenix based predecessor, this file server never crashed once we had it up and running. Never.
I wanted to create a nice UI for the file server so I purchased a windowing library for Power BASIC. It made it easy to create text mode windows using graphics characters. The way it worked was very similar to the way that a Windows programmer would do it in C. You called functions which created windows, buttons, etc. These would return a numeric handle.
Your program would intercept messages from the UI library in an event loop and act on them. Each message would include the handle for the window or widget it was about, and also a value for an action such as a click or a key press. This is not an easy way to write windowing code, but the file server would have a simple enough UI. The end result looked nice and was functional.
I learned a lot on this project. This must have been the highest quality BASIC code I had written to this point. It was a multitasking file server using state machine techniques. Unlike its Xenix based predecessor, this file server never crashed once we had it up and running. Never.
Labels:
basic,
c,
c compiler,
DOS,
GUI,
multitasking,
power basic,
turbo basic,
xenix
Friday, April 23, 2010
The Expensive Break Clock
One of our Tandy Model 100 computers had become relegated to controlling the buzzer for indicating shift changes, breaks and lunch. We used the signal for controlling the cassette interface to turn the buzzer on and off. A twenty line BASIC program was used to check the time against a schedule that was hard coded into the program.
Invariably for one reason or another this computer would forget the program. Either Bob or I would then run over and type the program in from memory, set the clock and get it running again. I cannot even count the number of times I did this while I worked there, but it was really no big deal because after a few times it only took a minute.
So here was have this computer which was originally purchased for more than $1000 and we were using it to blow a whistle 8 times a day. Nowaways this would be completely appropriate because you can buy a computer on a chip with all the power of the Model 100 for about $30.
Invariably for one reason or another this computer would forget the program. Either Bob or I would then run over and type the program in from memory, set the clock and get it running again. I cannot even count the number of times I did this while I worked there, but it was really no big deal because after a few times it only took a minute.
So here was have this computer which was originally purchased for more than $1000 and we were using it to blow a whistle 8 times a day. Nowaways this would be completely appropriate because you can buy a computer on a chip with all the power of the Model 100 for about $30.
Labels:
basic,
cassette interface,
computer on a chip,
tandy model 100
Sunday, March 28, 2010
Welcome to My Research and Development Lab
In search of the perfect next development tool to create our shop floor control system I was now in full blown research and development mode. I would read lots of magazines looking to learn as much as I could. I had a modem and a phone line in my office now too, and I was downloading free programming tools and trying them out.
Bob allowed me to take off and go to the public library so that I could read magazines articles about languages and programming. There were plenty of articles about object oriented extensions to languages like C and Forth. I found all this very interesting, but I had no experience with object oriented programming so I really didn't know what to think.
I saw an ad in a magazine for a language called Actor by the Whitewater Group, and this really caught my attention. The code looked like C, but it was supposed to be object oriented. There was a code snippet in a screenshot in the ad that implemented a very simple drawing program. The code was just a few lines long. The screenshot also showed the simple drawing program and they used it to draw a version of the product logo. The idea was that you could create very sophisticated software with very little code. The only thing was that the software was not cheap, and it required a copy of Microsoft Windows 2.1. We weren't yet running Windows on any computer in our office. This was in the summer of 1988.
One other tool I was interested in was called Matrix Layout. This was a visual flowcharting tool that produced graphical DOS applications. I guess you could call it a kind of HyperCard, which is a Macintosh programming tool for end users. It was only $149 so I obtained a copy for myself. The developer's office was in Boston, so I just drove there one day after work and bought it at the receptionist's desk. I was ultimately quite disappointed by this product. I tried to prototype a version of the video rental application I wrote in BASIC, but it was too much effort for the result. Once you've used a real programming language, these visual tools for non-programmers feel very limited. Clarion is really a lot better because it has a real programming language you can use to script extensions beyond the visual layout tools. Matrix Layout did not provide any way to write scripts. A simple BASIC interpreter would have done great things for this tool.
Then there was Ashton Tate's Framework. This was a fascinating programming system where modules of your application are in a frame, which can hold more frames, and these can hold yet more frames, etc. It had a scripting language called FRED which was based on a Lisp, a very powerful language. Framework was an integrated office suite, and it was extensible using the frame concept and the the scripting language. I never actually got to try it out, but I'm not sure it would have been suitable for the shop floor control system I wanted to develop anyways.
If Bob was beginning to wonder about whether I was ever going to produce anything for all the time and money spent, I never knew it. He was very patient. I did manage to stay busy with smaller projects. He had lots of ideas to enhance the applications I had already written, and he would come to me and we would talk about what he would like.
Bob allowed me to take off and go to the public library so that I could read magazines articles about languages and programming. There were plenty of articles about object oriented extensions to languages like C and Forth. I found all this very interesting, but I had no experience with object oriented programming so I really didn't know what to think.
I saw an ad in a magazine for a language called Actor by the Whitewater Group, and this really caught my attention. The code looked like C, but it was supposed to be object oriented. There was a code snippet in a screenshot in the ad that implemented a very simple drawing program. The code was just a few lines long. The screenshot also showed the simple drawing program and they used it to draw a version of the product logo. The idea was that you could create very sophisticated software with very little code. The only thing was that the software was not cheap, and it required a copy of Microsoft Windows 2.1. We weren't yet running Windows on any computer in our office. This was in the summer of 1988.
One other tool I was interested in was called Matrix Layout. This was a visual flowcharting tool that produced graphical DOS applications. I guess you could call it a kind of HyperCard, which is a Macintosh programming tool for end users. It was only $149 so I obtained a copy for myself. The developer's office was in Boston, so I just drove there one day after work and bought it at the receptionist's desk. I was ultimately quite disappointed by this product. I tried to prototype a version of the video rental application I wrote in BASIC, but it was too much effort for the result. Once you've used a real programming language, these visual tools for non-programmers feel very limited. Clarion is really a lot better because it has a real programming language you can use to script extensions beyond the visual layout tools. Matrix Layout did not provide any way to write scripts. A simple BASIC interpreter would have done great things for this tool.
Then there was Ashton Tate's Framework. This was a fascinating programming system where modules of your application are in a frame, which can hold more frames, and these can hold yet more frames, etc. It had a scripting language called FRED which was based on a Lisp, a very powerful language. Framework was an integrated office suite, and it was extensible using the frame concept and the the scripting language. I never actually got to try it out, but I'm not sure it would have been suitable for the shop floor control system I wanted to develop anyways.
If Bob was beginning to wonder about whether I was ever going to produce anything for all the time and money spent, I never knew it. He was very patient. I did manage to stay busy with smaller projects. He had lots of ideas to enhance the applications I had already written, and he would come to me and we would talk about what he would like.
Labels:
actor,
ashton tate,
basic,
c,
forth,
framework,
fred,
hypercard,
Lisp,
matrix layout,
microsoft windows,
object oriented,
scripting,
visual programming,
whitewater group
Tuesday, March 23, 2010
Thinking Forth
I wrote some small programs in C, and I was having a good time doing that. However, my ambition was to write a shop floor control system and I started work on that using C. I found that C was manageable for small programming tasks. As the project got larger dealing with all the pointer arithmetic, manual memory management and casting of numeric types was beginning to drive me nuts. I had to conclude that C is a really good language for operating system work because it was designed for that, but that for application level work it just shouldn't be necessary to be concerned with bits, bytes, pointers, memory allocation etc. Heck, BASIC would have been a better language than C for this.
After my disappointing experience with Wendin DOS and C I decided that I needed a more expressive programming language. I started to dabble in different languages, and I would write toy shop floor control systems to see how the code would come together. My work was exploratory in the sense that I wasn't in a big hurry to produce a result. I felt that I didn't know which course to take. In particular, I didn't know how to code a solution to overcome the hurdle of multitasking.
For example I experimented with a 4GL called Clarion. Bob was willing to spend several hundred dollars on this based on some stellar reviews that it received in magazines. Clarion really was great, but it was oriented primarily as a development tool for forms based database apps, and it had a nice reports engine. It did also include a compiler for BASIC-like language, but this was a short lived experiment. I do seem to remember creating a custom app for accounting with Clarion so we did get some value for the money.
So after this my mind turned back to the Forth programming language. I had already some experience with it, and I was excited to see if I could use it to create a multiuser shop floor system.
I found a version of Forth called Fifth, which included a simple IDE for MS-DOS. I also played with a couple of other Forth implementations.
So I went looking and bought a book titled Thinking Forth by Leo Brodie, the same author of the wonderful Starting Forth book I encountered a few years earlier. This was the most inspiring book about programming I had read yet. I enjoyed Leo's explanations about how software needs to be written abstractly, that code should be as small and simple as possible, about the importance of choosing the best words for procedures and variables, and also how to write well factored code and what that really means. The book also has great interviews with experienced Forth programmers and many funny and illustrative cartoons. Great stuff. Now, where did I put my copy?
After my disappointing experience with Wendin DOS and C I decided that I needed a more expressive programming language. I started to dabble in different languages, and I would write toy shop floor control systems to see how the code would come together. My work was exploratory in the sense that I wasn't in a big hurry to produce a result. I felt that I didn't know which course to take. In particular, I didn't know how to code a solution to overcome the hurdle of multitasking.
For example I experimented with a 4GL called Clarion. Bob was willing to spend several hundred dollars on this based on some stellar reviews that it received in magazines. Clarion really was great, but it was oriented primarily as a development tool for forms based database apps, and it had a nice reports engine. It did also include a compiler for BASIC-like language, but this was a short lived experiment. I do seem to remember creating a custom app for accounting with Clarion so we did get some value for the money.
So after this my mind turned back to the Forth programming language. I had already some experience with it, and I was excited to see if I could use it to create a multiuser shop floor system.
I found a version of Forth called Fifth, which included a simple IDE for MS-DOS. I also played with a couple of other Forth implementations.
So I went looking and bought a book titled Thinking Forth by Leo Brodie, the same author of the wonderful Starting Forth book I encountered a few years earlier. This was the most inspiring book about programming I had read yet. I enjoyed Leo's explanations about how software needs to be written abstractly, that code should be as small and simple as possible, about the importance of choosing the best words for procedures and variables, and also how to write well factored code and what that really means. The book also has great interviews with experienced Forth programmers and many funny and illustrative cartoons. Great stuff. Now, where did I put my copy?
Labels:
4GL,
allocation,
basic,
c,
Clarion,
database,
fifth,
forth,
leo brodie,
memory,
multitasking,
pointers,
thinking forth,
wendin-dos
Friday, March 19, 2010
Moving to Belmont
About this time I moved to Belmont with my brother Paul and his little daughter Christina, and also a friend of ours from our church named Stuart Harrington. Belmont is a very nice little town between next to Waltham where I worked, so I had a 15 minute commute. What a great place to live. Drive 15 minutes one way and you're in Boston. Drive the other direction and you're in Lincoln. I really enjoyed that.
Eventually Stuart got married and moved out and we were joined by another friend from church named Paul Ward. Paul was a sonar operator in a fast attack sub when he served in the Navy. He told interesting stories. We decided to share a room. We bought a steel tubular framed bunk cot. I would get up early in the morning and help him deliver newpapers in Lexington. I had inherited one of the Osborne 1 computers from work which Paul and I would spend some time tinkering with and banging out simple BASIC programs. My memory is a bit foggy, but I seem to remember giving the computer to Paul.
I thought I might be able to purchase a new computer for myself now that I had a regular paying job. I was interested in practicing my C programming and Radio Shack had a nice little portable called the Tandy Model 600. I read somewhere that CP/M and a C compiler could be had for this little machine and I thought this would be a very neat computer to own. When they were getting ready to discontinue this model the price dropped well below a thousand dollars. However I wasn't very good at saving money.
I never did purchase a Model 600. Just as well because I think I would have outgrown it very quickly.
Eventually Stuart got married and moved out and we were joined by another friend from church named Paul Ward. Paul was a sonar operator in a fast attack sub when he served in the Navy. He told interesting stories. We decided to share a room. We bought a steel tubular framed bunk cot. I would get up early in the morning and help him deliver newpapers in Lexington. I had inherited one of the Osborne 1 computers from work which Paul and I would spend some time tinkering with and banging out simple BASIC programs. My memory is a bit foggy, but I seem to remember giving the computer to Paul.
I thought I might be able to purchase a new computer for myself now that I had a regular paying job. I was interested in practicing my C programming and Radio Shack had a nice little portable called the Tandy Model 600. I read somewhere that CP/M and a C compiler could be had for this little machine and I thought this would be a very neat computer to own. When they were getting ready to discontinue this model the price dropped well below a thousand dollars. However I wasn't very good at saving money.
I never did purchase a Model 600. Just as well because I think I would have outgrown it very quickly.
Labels:
basic,
c compiler,
cp/m,
osborne 1,
radio shack,
tandy model 600
Monday, March 8, 2010
MIX C
Unlike today, in the 1980s most computer magazines like BYTE, Compute!, and PC Magazine had lots of articles about programming and programming languages. BASIC, Pascal, Prolog, Lisp, Forth, assembly language; you name it. In 1987 C was a very popular language and a good C programmer made good money so I decided that I should learn it.
I found an magazine ad for MIX C headlined "C for yourself". They had a very special deal called MIX C Works and this included the compiler, a split screen code editor, and a source level debugger for only $89.90. The ad claimed that the included book would make learning C easy. I paid for this software myself, and it was so exciting to open the package when it arrived in the mail. Nice new crisp books and disks. It all felt very professionally done. It was a great investment.
It was very exciting to dig into the C tutorial and use the editor and the source level debugger. This was really well written software and book was as good as the ad promised. C is a nice, small language and well written C is actually quite pretty to look at with those curly braces.
We had some simple applications in engineering that were perfect for learning a new language. Open a file, translate the information in some way and write it back out to a new file.
I found an magazine ad for MIX C headlined "C for yourself". They had a very special deal called MIX C Works and this included the compiler, a split screen code editor, and a source level debugger for only $89.90. The ad claimed that the included book would make learning C easy. I paid for this software myself, and it was so exciting to open the package when it arrived in the mail. Nice new crisp books and disks. It all felt very professionally done. It was a great investment.
It was very exciting to dig into the C tutorial and use the editor and the source level debugger. This was really well written software and book was as good as the ad promised. C is a nice, small language and well written C is actually quite pretty to look at with those curly braces.
We had some simple applications in engineering that were perfect for learning a new language. Open a file, translate the information in some way and write it back out to a new file.
Labels:
assembly language,
basic,
byte magazine,
c,
compute magazine,
debugger,
forth,
learning C,
Lisp,
MIX C,
Pascal,
pc magazine,
Prolog
Sunday, February 7, 2010
My own Commodore 64
One of my close friends Jeff Benitz (whom I had originally met years before at Radio Shack while playing with their TRS-80s) bought a Commodore 64. I went with him to Westwood, Massachusetts to buy the used computer. It included a monitor, a cassette deck, and a dot matrix printer. We enjoyed staying up late into the night playing a game called Telengard, which was a popular Dungeons and Dragons style game. I seem to remember we went to Toys R Us to buy the game back when you could buy tons of software for this machine in the stores. Telengard was written in BASIC, and we figured out how to break into it to modify it. Terrific fun (if you ask me).
One other cool thing I remember doing with this computer was writing a custom routine to reprogram the custom graphics characters on the fly to draw detailed images. This was in BASIC. It was slow but it worked.
Eventually Jeff sold this computer to me. I didn't use it for much and after moving a couple of times I tossed it because I couldn't find the power supply. Oops. What was valuable became obsolete and disposable. Nowadays I wish I could find the time to rediscover the simple joy of programming old home computers.
One other cool thing I remember doing with this computer was writing a custom routine to reprogram the custom graphics characters on the fly to draw detailed images. This was in BASIC. It was slow but it worked.
Eventually Jeff sold this computer to me. I didn't use it for much and after moving a couple of times I tossed it because I couldn't find the power supply. Oops. What was valuable became obsolete and disposable. Nowadays I wish I could find the time to rediscover the simple joy of programming old home computers.
Labels:
basic,
c64,
commodore 64,
graphics,
jeff benitz,
programmable character set,
telengard
Subscribe to:
Posts (Atom)