
“Vintage BASIC is an interpreter for a programming language of days gone by. A time when every home computer had a simple language called BASIC, and every kid who owned a computer learned it.“
Say no more. Now when everyone wants to create faster and more versatile BASIC dialect, Lyle Kopnicky did excatly opposite way, and recreated something old. Vintage BASIC is what BASIC was 20 years ago, with a full support for GOTO, GOSUB and such a keywords that are missing from modern dialects due “they allow bad programming techniques”.
Vintage BASIC is a open source software licensed with a BSD License, and it is written with Haskell.
Now, let’s hear some thoughts from a man behind Vintage-Basic.
E.K.V As usually at the begin of interview, let’s hear some “stats” about the person behind this interview. Could you Lyle give us a short brief, who, where and what?
Lyle Kopnicky My name is Lyle Kopnicky, I live in Portland, Oregon, USA, and I developed Vintage BASIC.
E.K.V Normally when new dialect is released, you can read from it’s website how it offers some new great features, functionalities or excellent versatility. You kind of turn this upside down with Vintage BASIC? Nothing that havent seen before, but still, something we havent seen for
a long time. Give us a short brief, what Vintage BASIC offers for a programmers?
Lyle Kopnicky I designed Vintage BASIC to run microcomputer-era BASIC programs as faithfully as possible. It is not an attempt to create a modern dialect. Instead it was an exercise in implementing a historic dialect using a modern functional language (Haskell).
The interpreter uses some innovative implementation techniques, that were really the interesting part to me. The historic dialect has many quirks and unusual behaviors by today’s standards. It was fascinating to me to try to implement these oddities using as elegant of a solution as possible. I wanted to avoid the standard stack mechanisms.
One thing you may find useful as a BASIC developer is that the syntax error messages are more detailed than you’d usually get from a BASIC interpreter.
Another advantage is that the interpreter is thoroughly unit-tested, so there are no interpreter bugs. It does a rock-solid job and all edge cases have definitive behavior.
E.K.V I can only assume that a man who does a exercise like Vintage BASIC, must have some loving memories from microcomputer-era?
Lyle Kopnicky Yes! BASIC was my first language; I learned it at a summer class when I was 10. I got a Commodore 64 for Christmas. Back then every kid who got a computer learned BASIC. You just turned on the computer and it was there, waiting for you. It was magical, being able to tell the computer what to do. I used to walk into Radio Shack and write a little toy program for the next unsuspecting customer. It would ask for their name and then print it all over the screen in an endless loop.
David H. Ahl’s book, BASIC Computer Games, was an inspiration to me. It showed the potential of what you could do with computers – everything from printing calendars to flying around the galaxy blowing up Klingons. I wasn’t that good of a programmer yet, but I tried to figure out how the games worked. I realize now that the code was poorly documented and that BASIC encouraged a sort of spaghetti-like programming style.
That book became sort of a benchmark in my mind of what simple games were like.
E.K.V From your answer, i got kind of image that you created Vintage BASIC (atleast partly) to be like a kind-of time machine to your childhood memories?
Lyle Kopnicky I was in graduate school at the time, in a class called Advanced Functional Programming, in which we used a language called Haskell. We were tasked with an open-ended class project, the purpose of which was to demonstrate some technique we had learned in the class.
We had studied how to build something called a monad. Essentially it lets you roll your own control structures in the language. An unusual thing about the older forms of BASIC is that it has dynamic control structures: the scope of FOR-NEXT loops, for example, cannot necessarily be determined by looking at the code; you need to run it. It occurred to me this was a lot like exception handling; I realized one could implement FOR as an exception handler and NEXT by throwing an exception. Thus was born the perverse experiment of implementing an archaic but beloved language using a modern one.
I implemented a usable subset of the language for my class project. But my fondness for BASIC led me to return to this project, in scraps of time, over a period of six years. I had never followed through on a personal project of this size, so it was a challenge to me. I was surprised that I kept feeling drawn back to it. One of my goals was to be able to faithfully run the games from BASIC Computer Games. It felt like a tribute to these days of joy from my childhood. Like I was giving back to the people who created the games, and introducing new people to the fun. At the same time, I was having fun writing the interpreter.
As I realized I was getting close, I began to spend more time on it. Since I’m now a professional software developer, I knew I had the skills to follow through. I decided to make it robust through unit testing, and to handle every edge case. I tried to make the code as elegant as possible. I took great care in constructing the web site. I found most of the games in source form but had to enter (and debug) some of the longer ones myself. It was just like old times, typing the games into the computer. I plugged away in my local coffee shop.
E.K.V I have had great fun with your Vintage BASIC, and i know few of my friends who have had great time with it too. But we all are peoples who got their first computers at microcomputer-era. So your dialect gives us those same feelings, what you just told about yourself. But if you consider younger peoples, those who have started to use computer at 90’s or even later, do you believe Vintage BASIC has something to offer for them? Do you personally believe, that Super Star Trek can give same magical feelings for them than it did give for us…long long time ago?
Lyle Kopnicky I’m glad people have been enjoying it! I’ve shown it to younger people, and they think it’s really cool, but unless you’re a programmer, you’re not going to really understand the fun of it. We grew up at an unusual time when many young students learned to program. They’ve pretty much all forgotten it now, but they have fond memories of it.
Later generations have their own nostalgia. Memories of making videos in Mario Paint, or making their first blog, or installing rogue apps on their iPhone. So they have similar feelings, but no two experiences translate exactly into each other. I think the important thing is to remember is that we can all be creative; we don’t have to be passive consumers of media.
E.K.V In personal level, do you see Vintage BASIC more like a tool with what to wake up old codes and games like from Ahl’s books, or a tool with what to program in “old-school” style?
Lyle Kopnicky I’m hoping that different people get different things out of it. Personally, I don’t have an interest in writing any more old-school BASIC code. Perhaps other people do. I was interested in the technical challenge of writing the interpreter, combined with the fun of reviving
the old games. Making it work on real-world code was important to me, so it wouldn’t just be an academic exercise.
I don’t write BASIC, and don’t play the games except to demo to people. I hope other people do those things and have fun with it.
E.K.V Currently Vintage BASIC executes codes from a file. But many also thinks, that beside of simple syntax, easy usage of basic at microcomputer-era was as important as the syntax. Just press power on, and start typing. If there was a line number, line was stored in memory, and if there werent a line number, line was executed instantly. Do you think that someday Vintage BASIC could offer this functionality too?
Lyle Kopnicky Yes, I’ve given some serious thought to providing what I call an “immediate mode”. That is, you can type statements to be directly executed. Or, as you mentioned, if it has a line number at the start, it would be directly executed.
But I could do it even better. If you can create programs on the fly, why can’t a program do it, too? So you could write something like:
10 PRINT "CREATING A PROGRAM"
20 10 PRINT "HELLO"
30 20 END
40 PRINT "NOW RUNNING PROGRAM"
50 RUN
So you have a “program within a program” that the host program can execute. This can go on ad infinitum. Even better would be to have a way to splice values in from the outer level. I might restrict this to expression contexts. Thus
10 INPUT "ENTER A NUMBER";N
20 PRINT "MAKING A PROGRAM TO COUNT TO "; N
30 10 FOR I = 1 TO {N}
40 20 PRINT I
50 30 NEXT
60 PRINT "NOW RUNNING PROGRAM"
70 RUN
80 PRINT "I HOPE YOU ENJOYED YOUR NEW PROGRAM"
By using the curly braces, you can splice a value in from the outer level to the inner program. You are creating an inner program that has the literal value the user entered. Of course you could just have done a loop in your inner program.
To really make it useful, you’d need to be able to have more ways of splicing code together. So, the more I think about it, maybe it’s better to just stick with the immediate mode.
E.K.V Well, you for sure do have visions about Vintage BASIC and it is allways pleasure to hear that developement continues. However, you think that syntax is now “locked”? No matter what changes might come, codes written with current release will allways work with later releases also, without need to edit’s?
Lyle Kopnicky It is my intention that Vintage BASIC continue to be able to run the programs from the BASIC Computer Games book. So if I add syntax, it will not break existing programs.
Another feature that I’ve wanted to add since the beginning of the project is concurrent GOTO. If you write something like
10 GOTO 100, 200, 300
100 FORI=1TO9:PRINTI*100:NEXT:END
200 FORJ=1TO9:PRINTJ*10:NEXT:END
300 FORK=1TO9:PRINTI*100+J*10+K:NEXT:END
the code will fork into three threads, each one starting on a different line. It will execute one statement from each thread in a round-robin fashion. So you would get some output like:
100
10
111
200
20
222
300
30
333
...
Note that they are not nested loops, but parallel loops. I think the concurrent GOTO is pretty useful. You could use it to do background computations while waiting for input.
The important thing is that it’s a subtle syntax extension that doesn’t break existing code.
E.K.V When i enter to www.vintage-basic.net, i dont see any community links. Actually, it takes time only to find your email addres. Are you planning to build any community services to your websites, or any other way to guide potential users of Vintage BASIC where to go when there is a problem or maybe some new code to show?
Lyle Kopnicky It occurred to me when I set up the site, but I didn’t think I’d get much interest. If you think people would be interested, I’ll set up forums. It wouldn’t be difficult.
E.K.V Well, hard to say how much interest Vintage BASIC will receive in future. Im sure there is lot’s of peoples who likes to have a fun with it, but serious coding…hard to say. Maybe a links to known mailing-list’s, bulletin boards and related would help to get some attention for Vintage BASIC?
ChipMunk BASIC, blassic and BwBasic are good examples of old-style basic languages. Not the most succesfull one’s, but they do have their little but devoted user base. I dont see any reason why Vintage BASIC would not become as a “member” of this list.
Lyle Kopnicky Well, I’ll look into setting up some forums*. Thanks.
*: After this question, Vintage-BASIC forums was opened.
E.K.V Beside of possible developing of Vintage BASIC, have you ever thought to create some more modern interpreter or compiler?
Lyle Kopnicky Absolutely. I studied programming language theory in graduate school. Compilers and interpreters are our bread and butter. I love the elegance of modern languages like Haskell, Ruby, or Oz. But I also appreciate the immediacy that BASIC had to offer.
I think the sweet spot now is to design domain-specific languages. That is, define a particular class of programs that people might need to write, and design a simple language just to fit that domain. Spreadsheets are an example. So is SQL for databases. One could design a language just for writing card games, which is something I’ve thought about doing before.
To reach the average user, instead of just programmers, the tools for programming need to be made simple. And they need to look familiar to the user, and provide immediate feedback. Like a level designer in a video game. The boundary between applications and programming languages is starting to blur.
At the moment, I’m fascinated with something called “language workbenches”. The idea is that you can develop in multiple languages, each suited to its own domain, and glue the code together seamlessly. It even allows for graphical modes of programming, like laying out diagrams, to fuse with textual representations of code. The code is just an abstract tree, and you can change the way you view it to suit your taste. It makes for easy refactoring and version control.
We’ll see where it all goes for me. I’m still gathering ideas and playing.
E.K.V If we think the versatility of programming scene, there is lot’s of programming languages. C, C++, Pascal, Python, numerous BASIC dialects, Haskell, Forth…gee, list would be endless. Some peoples thinks there is allready too many languages, in a meaning that few powerfull and
versatile language would be better than numerous of languages which are more or less pointed for certains tasks. How you see the versatility of programming languages? Enough allreayd, or maybe even more of them in future perhaps?
Lyle Kopnicky Well, individuals create languages. (OK, sometimes it’s a committee.) Whoever created it probably felt a need for it. Then they get to fight it out amongst programmers to see who wants to use it. Old languages die, or get refitted with new ideas. New languages catch people’s imagination. I think it’s fun. I’m all for a multiplicity of languages. Some people seem to get upset with it because they can’t learn them all.
So? Learn what you want to learn. Learn what you need to get a job, if that’s what you want. Don’t bother other people if they like something
different.
As for general languages vs. task-specific ones, I think I’ve stated that I like the idea of domain-specific languages. They fit the way users think about the problem. They might not have to be a “programmer” to use one. I think some people might be expressing concern that they can’t do everything they want with the domain-specific language. If everything used some general-purpose language, they could always do whatever they wanted.
Well, most domain-specific languages are not Turing complete. They are more or less description languages, and deliberately do not allow arbitrary code to be written. That provides certain guarantees about the performance of the implementation. It also makes it easier to represent the language in other ways – perhaps graphically, instead of as text. These are both important things for languages embedded in applications used by non-programmers. We don’t want them tying themselves in knots.
That being said, I also like applications that are constructed using a back-end, with some kind of API, and one or more user interfaces that attaches to that API. Photoshop is like that. So is Microsoft’s SyncToy. If you construct an application like that, people can make libraries in whatever languages they like, that can talk to that API and automate the functionality of the app. I think that’s a good way to go if you want ultimate control.
E.K.V Now after all you have sayd here, im sure that we will hear about you in a future. Your fingers are propably demanding you to sit next to the keyboard, so they can start coding?
Lyle Kopnicky Well, I do code all day at work. Aside from that, yes, I would like to do more coding, but I am often torn because I’m interested in making films and music as well. I also tend to “hit the books” and read up on technologies because no matter how much I learn, I always feel like I don’t know enough. I’ve been reading Concepts, Techniques, and Models of Computer Programming. And I’m going to take an AI class in the winter.
E.K.V So next step with Vintage-BASIC is a version, which predicts what user wants program to do, and can bypass or even fix the bugs itself?
Lyle Kopnicky Yes, and it will become self-aware and take over the world.
E.K.VI think that was greatest ending for a interview ever
Thanks Lyle, this was a pleasure.


Post a Comment