Hacker News Comments on
Birth of BASIC
Dartmouth
·
Youtube
·
46
HN points
·
2
HN comments
- This course is unranked · view top recommended courses
Hacker News Stories and Comments
All the comments and stories posted to Hacker News that reference this video.For some reason it took me years to understand the need for a line editor. It didn't make any sense in my head. Then one day I saw the famous picture of Bill and Allen as kids in front of a teletype [1] and it finally clicked.The way it worked was like this: As you keyed in your program, letter by letter, it was printed out on the paper immediately like a typewriter. If you ran the program and there was a problem, you'd just read (or re-read) the printout, find the line with the bug, then use a line editor to fix just that line. You might mark the paper with pencil to keep track of the change. After a while if you needed to see the latest version, you'd just print the whole program out, or just the lines you needed.
This realization finally clued me into what was going on when I was 10yo and programming BASIC on a TRS-80 Color Computer. It was essentially simulating a teletype (which makes sense given BASIC's inception at Dartmouth [2]), where you would type each line individually, then if there was a problem, you would edit the program individual lines at a time. I always thought it was an odd until I understood how actually using a teletype actually worked. Also explains why the command to write letters to the screen is called "PRINT".
1. https://www.gatesnotes.com/About-Bill-Gates/Early-Days-as-a-...
⬐ IncRndThat's also why TTY is the name for abstract devices. Terminals are simulated teletypes.⬐ russellbeattie⬐ rbanffyOMG... I just got sucked into a Wikipedia rabbit hole by looking up TTY. Hours!!!https://en.m.wikipedia.org/wiki/Teleprinter
Enjoy.
Many BASIC interpreters worked exactly like that. On a TRS-80, for instance, you would type your program and, when you needed to edit a line, you’d use the “edit” command with a line number as the argument and drop into a line editor.⬐ legalcorrectionAnd now autistic nerds keep using it, which is fine, but then insist that everyone else should learn it too, which is stupid.⬐ projektfuYeah, a lot of people would send their work to the line printer at the end of the day, and then start fresh the next day with a pencil to sketch out what they were going to change. Then using ed is a no-brainer.I heard that a lot of people preferred fewer files and longer functions for the same reason--it was all there on the fanfold output and could be read at once, rather than working in 80x25 chunks. After that mode of working was replaced by interactive programming at the display terminal, we started to prefer functions that didn't span more than 1-2 screens.
I enjoy messing around in the Owlet browser-based BBC BASIC editor. 8-bit graphics still has a place in modern web design ;)Related doc on youtube:
"Birth of BASIC"
⬐ simonhI think what was great about BASIC back in the day on early home computers was that it gave direct access to the hardware. You could PEEK or POKE to any address in memory and write programs that could manipulate any of the features of any attached hardware at the lowest level with individual commands. You didn't even have to write a program, but could just invoke commands imperatively. It was an incredible learning environment. I remember hacking a BBC Micro so that it mapped system memory directly into the video display, so the colour of each pixel on the screen represented a byte of memory, which changed in realtime. Learning Pascal on a Prime minicomputer was fine, but never had the same fun factor.⬐ zozbot234⬐ cghThis was more a function of how the systems were wired than anything to do with BASIC per se. Hardware-specific features were mapped to physical memory addresses, and the PEEK and POKE commands could be used to interact with those addresses. Many BASIC implementations also had commands to branch to machine-language subroutines or to perform machine-dependent IO.⬐ JtsummersThe feedback loop with BASIC was faster. You could execute the program directly from the editor (if not from an interactive prompt, our computer, a Tandy 1000 circa 1988/1989, didn't have that though). Even without the prompt, it was very close to the REPL experience (write a line or two, hit F5 to run it, see the result, edit, repeat). I didn't come to other languages until later, but even so the feedback loop was just slower: bring up editor, write code, save, compile, run, repeat. That extra bit of friction is noticeable after a while. And then there's just what makes a minimum viable program. In C it's something like:In BASIC it's:#include <stdio.h> int main(void) { printf("Hello, World!"); return 0; }
4 extra lines don't seem like much, but to the novice it can be a massive difference. Especially when all that other stuff seems like magic, versus the BASIC program which just gets to the point ("I want to print something, so I tell it to print and it does.").10 PRINT "Hello, World!"
⬐ blackrockI wonder why C didn’t just include stdio.h as a default library?⬐ pjmlpI guess, because compared with other systems programming languages since the early 60's, C grew out of language used to bootstrap compilers and its authors were happy with it being a kind of friendlier macro Assembler.One of the advantages of the Commodore 64 was its crappy BASIC dialect. To do anything with graphics or sound, you had to pretty much learn assembly. I'm pretty sure that whoever decided to stick Commodore BASIC v2 in that thing had no idea they were creating an entire generation of assembly programmers.⬐ wvenable⬐ vanilla-almondI wish as a kid I had more resources to learn assembly back when I had a Commodore 64. I effectively maxed out what I could do with the machine; I had made it as far as redefining the character set to make games but I still working in BASIC.But I never had the tools or instructions to do assembly -- it wasn't until I got a PC and had BBS resources that I did any advanced programming.
⬐ cgh⬐ soylentcolaI had a copy of the Programmer’s Reference Guide and I read The Transactor magazine, both of which featured lots of low-level stuff. And I grew up in a place that commonly had one to two metres of snow on the ground, so I was inside a lot staring at that blue-on-blue screen.⬐ protomythTruthfully, the brand specific magazines (e.g. Antic for Atari) were the best resources to learn to program. I learned 6502 out of a magazine then got some real manuals.We had a C=128 which added a whole bunch of additional options that could be used in BASIC programs. While grade-school me was completely baffled by assembly (wasn't in the manual that came with our used computer) it introduced me to the basics of sound synthesizers.You could define a wave pattern (square, sawtooth, triangle, ring, etc.), attack, decay, sustain, release, and pulse width with that version of BASIC and generate all sorts of sounds and music.
I spent loads of time messing around with using variables for these different parameters to see how I could generate the coolest/most annoying sounds.
Graphics were also a lot easier to play around with (it even had an interactive sprite editor built-in) but that's a whole other story.
⬐ jbperryAgreed. The limitations of the C-64 lead me to learn a whole lot more about the internal workings of computers than I think I ever would have learned using something more advanced. Unfortunately(?) that has been the only assembly that I really ever used extensively. Still, it was a great initial foundation.⬐ pjmlpSame applies to the Speccy, but learning anything but what came in the box was a challenge.By the time I finally started seeing some Assembly books and the Input magazines on a couple of stores, the 16 bit home chapter was already into its way.
Most of the spectrum books that I own have been bought when hunting for old books.
⬐ steve_taylorIt certainly made me want to learn assembly, but I didn't have access to the Programmer's Reference Guide or any other useful resources for assembly programming, let alone an assembler cart.At the same time, my school had a room full of Amstrad CPC 6128 computers with a very rich BASIC dialect that was good enough for making decent games. I'm very fond of that machine, but they're extremely hard to come by now, as are the 3 inch disks.
⬐ sedatkIt's possible to adapt CPC6128 to the modern world. I have a CPC6128 with an external 3.5" drive attached. There are even SD card modules for 6128, fyi :)Something I've wanted to asked ask for a while: who is programming in Basic today?The language has evolved substantially from its early days and there are many dialects. But it's rare to hear someone admit they program in Basic (at least on this forum). Programmers can be quite judgemental about choice of programming language.
Does anyone want to share their reason for using Basic? It is by choice or by necessity (e.g. maintaining a legacy codebase)?
Are there modern incarnations of the language that you feel are overlooked? (For example, I recently came across Pure Basic, a cross-platform compiler that lets you build self-contained binaries for Windows, Mac and Linux).
⬐ pjmlp⬐ DannyB2People that work in life sciences.Might seem a surprise to many HNers, but there are people using Excel for their research, instead of R, Python, Julia,....
I guess it helps that plenty of data readers are Windows only and provide COM/DLL automation interfaces.
So when their Excel macros + VBA outgrown themselves, they get IT to install them VB.NET and carry on.
So that medicine one is taking might have had its reaction curve analysis done in VB.
⬐ BasicBardoI do! My company runs a legacy Multivalue database (jBASE) which uses jBASIC as the native programming language. The dialect that we program in has a lot of the classic attributes of BASIC but it's also been modernized quite a bit. It's still a procedural language and there's a lot more GOTOs in the codebase than I'd like but it's got a native REST interface and runs on a modern OS.There's actually a good number of businesses that run Multivalue databases like this. They all use similar dialects of BASIC with various levels of enhancements. The databases are noSQL from before SQL was really a thing.
⬐ nanomonkeyAs of April, you can now program for the Nintendo Switch in SmileBASIC 4 [https://www.nintendo.com/games/detail/smilebasic-4-switch/].Back in 2010 I was writing production code in VB6 on a Inventory management and ERP system that ended up being sold off when the original developer decided to retire. As far as I know that piece of software is still being used today and runs quite a number of restaurants, airline catering companies and amusement parks.
⬐ kjs3You can still get a supported, paid version of BBC Basic for Windows at http://www.bbcbasic.co.uk/bbcwin/bbcwin.html.A couple of years ago a shop I was at had a dev that used it to construct test frameworks for the apps he was working on. Said he'd been using it since the 80s and it worked for him. The dev leads said OK and the tests were apparently extremely well done. Got bought by IBM, so I don't know if they're still doing testing that way :-).
⬐ sedatkVBA (Visual Basic for Applications) is still a thing. My brother is teaching Decision Support Systems using Excel/VBA and he says it's the most practical way to do it.⬐ foobarianI feel like a lot of the attraction of the early micro BASICs was: 1) Flip on power switch 2) Computer shows "READY" 0.5s later.With a modern Windows PC a 7 yro has to learn to use the mouse, to click, press icons, the concept of windows, etc. Which, she somehow picked up in about 1 month time frame and is now able to launch games and play PC Minecraft. But anyway...
⬐ 32bitkidQB64: https://www.qb64.org/portal/And
Color Maximite 1/2: http://geoffg.net/maximite.html
Are two interesting takes on modern BASIC
⬐ simonhMy kids do their Computer Science course at school in VB.NET here in the UK. I understand it's also possible to do it in Python, but they don't offer that at their school.⬐ gramieThere is also a free (except for iOS) version of BASIC (https://www.b4x.com/) that compiles to executables that run on Android, iOS, Windows, OSX, Linux, etc.It's very much like Visual Basic, including a visual UI editor, and has a very strong community. The developer (one guy!) often answers questions in the forums.
10 INVENT NEW LANGUAGE20 GOSUB 10
30 PROFIT
⬐ AnimalMuppet⬐ sergiusCaptain Nitpick here. That will eventually run out of memory and crash, because of GOSUB instead of GOTO.Clever, though...
⬐ DannyB2Eventually, when it reaches the obvious RETURN statement, it should then get to the PROFIT.And memory? Memory is unlimited! This is Java! Oh, wait, it's BASIC, memory isn't unlimited. Nevermind.
⬐ egypturnash10 INVENT NEW LANGUAGE 20 REM ??? 30 GOSUB 10 40 PROFIT
Imagine if they had put a Forth interpreter instead? That would have been real genius... but alas we got a crappy BASIC because everyone else had one.⬐ Jtsummers⬐ tasty_freezeTo be clear, BASIC came out in 1964 versus 1970 for Forth. I'm not sure how the creators of BASIC could've used Forth instead.⬐ sergius⬐ nicktBasic was a real bad idea to begin with...⬐ sergiusIn popular micros that came out in 1980? In 1970 you still huge expensive boxes as computers...⬐ pjmlpBesides the Jupiter Ace pointed about, I used to see ads in YourSinclair and Crash about Forth units to plug into expansion ports.Like the Jupiter Ace?For anyone who has only used Microsoft dialect BASICs, seeing the original Dartmouth BASIC features might be surprising. I learned BASIC on a Wang 2200 computer (circa 1973), which followed Dartmouth BASIC pretty closely and added a ton of quirky Wang-specific features on top. The following, as far as I recall, would have been valid in the 1964 Dartmouth BASIC:By combining INV with matrix multiply, it was a snap to solve systems of linear equations. The examples above are all square matrices, but many of the actions worked on non-square matrices too. It was also possible to change the dimensions of a matrix so long as the total number of elements was the same or less than what was allocated by the original DIM statement.10 DIM A(5,5), B(5,5), C(5,5) 20 MAT READ A,B 30 DATA <a list of numbers for matrix A and B here> 40 MAT C=A*B:REM matrix multiply 50 MAT PRINT C:REM print the contents of C in five rows 60 MAT C=A*(2):REM scalar multiply 70 MAT C=A+B:REM matrix addition 80 MAT C=A-B:REM matrix subtaction 90 MAT C=TRN(A):REM matrix transpose 100 REM C=IDN:REM fill C with identity matrix 110 REM C=ZER:REM fill C with zeros 120 REM C=INV(A),D: REM invert A, and put determinant in variable D
⬐ tasty_freezeLines 100-120 were intended to start with MAT C=..., but I had a thinko and typed REM instead.