Programming in BASIC on the TRS-80
baugues.com
baugues.com
Why? Well I was mostly expired from a story in "Surely You're Joking, Mr Feynman" where he talks about being bored with physics, and he gets back into it by playing around with toy problems that he had to work out from first principles (the way that the wobble in a spinning plate precesses around the axis). So I've started programming in an emulator of this old 1980s computer. It seems to be working for me too - I'm finding myself to be much more engaged in my day job since I've started.
In my opinion, the RaspberryPi is the closest thing to a home-computer we have today, it encourages to learn, experiment and create things, it would be nice if it had a simpler, more home-computer-like standard operating system though. Linux (or any other current desktop or mobile OS) is simply too complex and scary. In contrast to that, smartphones and tablets are closed ecosystems optimized for consumption. I don't see how these closed-off platforms encourage kids to explore and learn to create something on their own.
There's also some stuff here on the RPi site on other BASIC options: https://www.raspberrypi.org/blog/celebrating-50-years-of-bas...
I would actually love to re-case an RPi in it's own retro keyboard unit and turn it into a proper TV-computer of old. Alas I don't really have anything in the way of that kind of solder/hardware skills.
EDIT: Actually, following some of my own links, it looks like someone's beat me to it: http://www.fuze.co.uk/
Another project though I think really seems to be gunning for that old-school feel with some modern conveniences is PICO-8, which is a retro Lua VM meant mainly for designing games, complete with REPL, built in editors, and even PEEK and POKE. :D
To be honest though, I also kinda wonder how well you'd do just plunking a kid down in front of one of those older machines. Especially the Tandy ones. The Color Computer came with an amazing manual, that's pretty much what got me into programming all on my own as a kid.
As a fun side note, here's a Lisp in 1.5 pages of Tandy Color Basic: https://twitter.com/J_Arcane/status/668545293164683264
https://archive.org/details/80-microcomputing-magazine-1983-...
It may very well run on a coco unchanged (they were very close) or someone modified it to work on a coco without changing the version remarks. I'm not motivated enough to do a biological meat powered DIFF between the tweet and the magazine.
I tried typing it in (in probably summer of 83), LOL thats not happening without typos, ended up convincing my Dad to get the load-80 for that month (essentially load 80 was a cassette tape delivered monthly with the code from the magazine so you don't have to type stuff in). Later Load-80 was a floppy disk. The future being very unevenly distributed it was at least half a decade before IBM PC clone users finally had "big blue disk" (which I enjoyed monthly)
It was my first experience with a LISP. I would advise that LISP and magazine series were very interesting but highly non-optimal way to introduce a roughly ten year old kid to LISP.
From memory by the third month or so of the series he had a crude database set up and implemented MATCH. Performance was slow, the REPL took maybe a minute to think about complicated things.
Its fun to page thru the ads. Dynamic ram had dropped below a buck per kilobyte. 80 micro was going thru a computer science phase, interesting to read the APL article a few pages later.
Edited to add, this is Randy Beer's home page today:
I'm still idle in a few bits of the CoCo scene and someone dug it up a while back so I snapped the code just because I was impressed that 1) it was pulled off in BASIC, and 2) in so little space.
Probably indeed not the best introduction to Lisp. I do wish I had had some intro to Lisp, or perhaps more ideally Scheme, back when I was that young though. I honestly believe I'd've stuck with programming if I'd discovered Lisp & FP when I was just starting to look beyond BASIC/QBasic. Instead all I saw was everyone telling me I should learn Assembly or C if I wanted to be a "real programmer", while Python and JavaScript were sneered at as mere "scripting languages," save for those like Perl that were intelligible only to other Perl hackers.
Once Java came along and I took two glances at that, I just gave up on programming for another decade, resigned to the idea that coding for a living was nothing more than a life of tedium and irritation.
I'm still not always sure I was wrong.
But I really wish there was material to get her started. I haven't found any introductory Logo books – finding an old book and updating it to a new dialect would be fine, but I'd appreciate some structure and thoughtfulness about the order of introduction. I probably should print out some primers too, so I don't have to remind her of RT and LT and FD every time.
I've been using this Logo interpreter: http://www.calormen.com/jslogo/ – it does all the traditional stuff pretty well, but it could also use this same sense of structure and content. A kid should be able to sit down and think: here's a thing I could try to do. And here's all the tools I need to do it. Really that's just content.
On the fancy side Hopscotch has been really impressive (significantly better than Scratch), but being iPad-only has been a problem. That said, my daughter still appreciates Logo even compared to something fancy.
(One important thing about my daughter's interest: I talk to her in detail about what I do. The importance of this occurred to me during a parent education event I was at, where they noted: when you ask your kid how their day was and they disappointingly say "fine", have you been telling them how your day was? Parents need to demonstrate that kind of storytelling and engagement, and in my experience kids suck it up more than you'd expect, even stories about seemingly boring work stuff.)
But I no longer think that's the thing...the point back then was, to me at least, "here is something big that no one else I know is doing but its so obviously very cool, empowering, and in a way, secret".
Nowadays, with so many devices intruding on every aspect of our lives, there is just very little of that secret anymore, and while of course its hard for me to know how modern tech is affecting kids nowadays, I just cannot imagine they can feel the same way as I did, sitting alone in a Radio Shack in 1978, writing BASIC programs in wonderment.
Kids love interactive and graphical environments and trying to do this in any mainstream language quickly becomes non trivial.
I chose Python and pygame but it gets confusing for the child to see things like:
from pygame.locals import *
and for event in pygame.event.get():
if event.type == QUIT:
pygame.quit()
and size = (120, 640)
screen = pygame.display.set_mode(size)
One can tell her to ignore these and just accept they are necessary but it does cause issues and looks very intimidating to a beginner.It was far easier and more straight forward to get something done in that than any other language. It's probably still the case.
Unfortunately, it didn't last long.
I feel sorry for folks learning to code today. I was thinking about creating a course to teach folks to program, and it occurred to me that a more useful course might be along the lines of "How to set up and run 'hello world' in various configurations" You could have a section on each O/S, and then exercises would cover the top 5 or 6 languages.
It's basically a development environment you operate from the REPL. Every time you define something, GT memorizes your definition; you can then save this "workspace" of definitions to a program file or load prior work into the workspace.
It's a shame that there are almost no programming environments that work the way BASIC did, where the command language for the development toolset is the same as the programming language itself.
I teach a weekend programming class for middle schoolers and the setup is a real pain. There's just too much stuff that gets in the way of learning to code. Our setup is Python 3 with Pycharm EDU2 installed on each child's laptop. for some lessons we have a Raspberry Pi (gopigo and minecraft) that the kids can control remotely using Python.
We tried using Idle but it crashes too much and is a bit of a pain to navigate with the multi-window display. Pycharm EDU is pretty good, but I haven't had much luck using it with lessons. The lessons take a lot of time to setup and sometimes just crash Pycharm or become unusable, holding up class. So we use Pycharm EDU just as an IDE.
I thought of using something remote like Koding or codio (I really like these options), but we have some lessons that require us to be local so we can reach out to our bot and rpi. A more lightweight IDE would be nice, something with nice debug capability like Pycharm EDU. These kids are sporting some really old laptops, hammy downs from older siblings mostly. Ideas welcome.
>> Back then, with a few lines of code I could write a program that ran on practically any home computer.
Pop open Chrome and you can write almost the same program from that magazine in Javascript. You'll have to figure out how to do the input, though.
Magazines like Linux Format even have multi-page coding tutorials for different languages all the time.
http://www.linuxformat.com/archives&listpdfs=1
>> There’s so many more steps to reach “Hello World” in any of today’s major languages
>> There’s also so much more distraction. With no Internet, no video games
There were TONS of games for the TRS-80. I used to sit in Radio Shack as a kid playing them all day long. You didn't have the Internet back then but you could dial into BBS's. That was a real time-waster.
It has returned to being a hobbyist scene, just like in the 80s. Basic compilers are written by hobbyists for hobbyists.
For native applications my favourite is PureBasic: http://www.purebasic.com/
It's a nice variant that compiles to a tiny, dependency free executables for Windows, Linux and OSX.
It also provides a nice gateway to the underlying assembler. http://www.purebasic.com/documentation/reference/inlinedasm....
It also has an online version called Spider Basic that compiles to JavaScript: http://www.spiderbasic.com/
You can still write native Win32 and Xlib apps in C not to mention all of the languages where OOP is an optional bolt-on.
It comes with close to a thousand BASIC listings.
The pixels are rendered in OpenGL 3D and you can play original games in a 3D perspective.
It's a huge repository of Color Computer and TRS-80 software, books and magazines.
https://archive.org/details/Getting_Started_with_TRS-80_Basi...
My introduction to programming was this via this book in the back of my sixth grade math class in 1982. Been hooked ever since.
I later found some GW-BASIC books which helped a little bit, but I wish the library had some newer stuff. C compilers were $500 back then so BASIC was all I had.
But the ease of learning BASIC is alive and well today, you can write a PHP program with as much ease (then you can learn to write better code later but the point is the barrier to entry is very very low).
You can even run PHP as an interpreter in a DOS-like command window in Windows, very easy.
POKE 16407, 43
This wrote a value into an absolute memory address. 16407 was one of the registers of the video controller. Poking various values into it would cause various funky things to happen on screen. 43 was one of the best values to put in there, but others were interesting too.Sometimes you had to reboot the machine to recover, though...
Time to turn my Apple 2e on and play for a while.