BASIC Programming With No Strings Attached

String art rendering of a face

Today in programming language hacks we have string art rendered in BASIC. String art — also known as pin and thread art, or filography — is an art form where images are invoked by thread woven between pins on the border of an image. In this case the thread and the pins are virtual and there is a simple 67 line BASIC program which generates and renders them.

Of course BASIC, the Beginner’s All-purpose Symbolic Instruction Code, isn’t just one thing and was a bit of a moving target over the years. Invented in 1964 at Dartmouth College by John Kemeny and Thomas Kurtz it turned into a family of languages as a dynamic array of implementations added, removed, and changed implementation details as the future unrolled.

We remember GW-BASIC and QuickBASIC, but the landscape was much broader than that. Implementations of QuickBASIC came with a “compiler”, qb45.exe, which worked by bundling the BASIC script as p-code into an executable along with the runtime binary, which we used back in the day to make “real applications”, not mere scripts.

Thanks to [Keith Olson] for writing in to let us know about this one. If you’re interested in seeing what the state of the art in string art is, be sure to check out String Art Build Uses CNC To Make Stringy Art and CNC Router Frame Repurposed For Colorful String Art Bot. The best string art is in the real world, not software!

15 thoughts on “BASIC Programming With No Strings Attached

  1. QBASIC was the first language i learned. It was taught to me in school

    I quickly exited the text mode and switched to screen 21 (or was it 12) to draw graphics.

    It took my 12 year old self a long time to learn it because internet access was not very common back then, and i didnt have any

    1. If you entered mode 13 you could then define a 64000 byte array and use some inline assembly to quickly copy the array contents to video RAM.

      Then it was just a matter of coding up routines that draw graphics into your newly created screen buffer, and keep throwing it into video ram over and over as fast as possible. Eventually you’d notice that you can use the same memory copy assembly code to push sprites into the array faster than QBASIC would compute it. Then read the keyboard input buffer and keep a table of which keys were being pressed simultaneously… pretty soon you had a BASIC program that was just a scaffolding for a bunch of machine code.

      Then you realized that QuickBASIC could actually compile it all to machine code and run it 10x faster, but by that time it was all time out for DOS machines and you had to transition to more modern languages to keep up with the times.

    1. Never heard of it, but will explore it a bit. I see it has been around since 1993.

      The languages I currently enjoy using for work/play is Python and of course C/C++.

      As for Basic, it’s a good nostalgic language as most of us older people were exposed to it first from the 60s on. Simple and straightforward for simple projects.

      1. My first programming experience was the horribly limited BASIC Programming on the Atari 2600 around ’79 or ’80. I was too ignorant to know that it was horrible, so it was cool.

  2. Implementations of QuickBASIC came with a “compiler”, qb45.exe, which worked by bundling the BASIC script as p-code into an executable along with the runtime binary, which we used back in the day to make “real applications”, not mere scripts.

    The p-code was actually compiled code fragments with the runtime library inserting program control code in between the parts. That’s what made it faster than directly interpreting BASIC but retained the ability to stop the execution and modify it.

    When you finally complete and debug your program, you can save it to disk as an executable file using QuickBASIC 4.0’s Make .EXE option. Here, QuickBASIC 4.0 acts like a normal compiler. All the interpreter operation codes are discarded, and the compiler produces just executable machine code and symbol information.

    Byte Magazine 1987-11
    https://archive.org/details/byte-magazine-1987-11/page/n144/mode/1up

Leave a Reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.