Salta al contenuto principale


#BabelOfCode 2024
Week 1
Language: Applesoft BASIC

NEXT WEEK: mastodon.social/@mcc/113783248…

"Advent of Code" is an online event where you're given 25 two-part code puzzles, which you're supposed to solve in 25 days in December. I was busy so instead I'm doing a slow-motion, 1-puzzle-per-week version over the course of 2025, but with an added restriction: I have to do it in a different language each week.

@unjello proposed a hashtag, so maybe there are two of us on this
mastodon.gamedev.place/@unjell…
(1/2)

Questa voce è stata modificata (9 mesi fa)

Oblomov reshared this.

in reply to mcc

My rules for this challenge:
mastodon.social/@mcc/113676228…

And my language candidates list (note C and C++ are NOT on it):
mastodon.social/@mcc/113676267…

As I go I will be posting my progress here:
github.com/mcclure/aoc2024

For week one I'm doing Applesoft BASIC, for a few reasons: I want to get it out of the way on an early, easy puzzle; and two, it was my first language, on an Apple //c at age 6, so there is a poetry to starting there.
(2/2)


I was too busy to do AOC this month (that's adventofcode.com/).

So I'm thinking I'm going to do AOC 2024, *in 2025*, under the following rules:

- One challenge per week.
- I don't have to perform a challenge every week. The goal is to finish by the start of December.
- I have to do a different programming language every time.
- C, C++ and Objective-C are not eligible languages.
- If I make an honest attempt at a language and fail, I may retry in Go (but only Go) (I need to learn Go)


in reply to mcc

Language confidence level: Medium-high

"Day 1" is all manipulation on lists of numbers, so this fits BASIC nicely. It's simple enough I believe I'll be able to do it in BASIC without struggles, but complex enough I have to use a language feature I've never used (arrays).

With some difficulty ( mastodon.social/@mcc/113739186… ), I've set up the AppleWin emulator; I'm going to use this tool as an "IDE" to write the code:

mastodon.gamedev.place/@xot/11…

But I'll be loading into AppleWin to generate results.

in reply to mcc

So far largest difficulty is typing something, getting a SYNTAX ERROR, staring at it not being able to figure out what was wrong, and then realizing I used a lowercase letter

NO lowercase letters!! there is NO SUCH THING as lowercase letters. "x" this is not a variable!! it is not anything!! "X" ok that's better

in reply to mcc

as the dos 3.3 system master disk says if you boot it on a new enough machine,

BE SURE CAPS LOCK IS DOWN

mcc reshared this.

in reply to mcc

AOC puzzles tend to be inputs consisting of lists of simple numbers, and output is usually one single number; I think this is about not making people waste time on file parsing unless that's the point. I'm letting myself inject formatted code (learning Apple // disk routines is not the point of the project!); in this case I turned the input file into a series of DATA statements. To avoid letting Perl do "work" however, I preserved the structure of the file (two interleaved column) in the DATA.
in reply to mcc

Generation Z might be wondering: What's up with the 30,000?

We didn't have "editors" on C64/Apple era BASIC! Instead you'd type into the REPL lines beginning with a number, and saying like
10 PRINT "BUTTS"
would be "load this line into the program at index 10". At runtime it executes all lines in order. You'd usually leave 10 between each statement in case you needed to insert something in between. In the case of the DATA, I want it to go at the end, so it's close to the limit of 32768.

Oblomov reshared this.

in reply to mcc

Now you might be wondering, what if you say like
10 A = 4
20 B = 5
and then later you realize you need more than 9 statements between 10 and 20? THEN YOU'RE IN BIG TROUBLE.
You are going to be retyping a bunch of stuff, with repeated use of LIST and CTRL-C, and then maybe introducing bugs because those line numbers doubled as GOTO targets. We actually used to live like this
in reply to mcc

didn't ya have the RENUMBER command? Please tell me you did!
in reply to Brent Cook

@busterb I don't know what that is! There was a lot I didn't know about the Apple //. I didn't understand how to use "FOR".
in reply to mcc

On Sinclair Basic, iirc, how I’d have dealt with that is a hacky GOSUB
in reply to Jae

@considermycat yes i really should be using GOSUB (continues using line numbers)
@Jae
in reply to mcc

Well Sinclair Basic GOSUB used line numbers anyway. None of that fancypants BBC Basic PROC stuff
in reply to mcc

My Computer Studies teacher had a very low opinion of Sinclair Basic, for that and other reasons
in reply to mcc

I remember how awesome the RENUM command was when I first met it. Gwbasic?
Questa voce è stata modificata (10 mesi fa)
in reply to mcc

there were some slight mitigations to the retyping though. the editor was weird and was mainly "right arrow over text on the screen types the character unless you're in move mode (which you toggle with esc)

]LIST 20

]25 space, esc, arrow-keys to get to the start of line 20 after the line number, esc, right-arrow over the text, enter

]20 enter (to delete the copy with number 20)

if you want to skip some text, you can esc and arrow over it; to add more, esc, move somewhere else on the screen to type it, esc and move back to the text you want to copy.

there were also line renumbering programs, which i think weren't part of the base "os".

i'm pretty sure this was in the base apple //e, only saw a plus about once and never did much to it.

in reply to mcc

Confusion as I'm getting errors on a line with a complex boolean expression, irritation as I realize neither of the BASIC manuals I'm consulting explicitly document the "AND" and "OR" operators only list that they are operators that exist, dawning horror as I realize these boolean operators do not in fact appear to be short circuiting
in reply to mcc

This thread is bringing back so many memories of the bad old days programming BASIC.
It's good to be reminded occasionally that things have gotten better. 🙂
in reply to mcc

"A Touch of Apple //", Apple Computer, 1986

Left: Section "Break a Few Rules"
Right: Table of contents, final section of book

in reply to mcc

All the books I'm consulting for this are very Aesthetic. Just every element, the fonts, the writing tone, it just all has this nice feeling to it, and I don't even think it's because it reminds me of being seven. Look at the cover to this one

reshared this

in reply to mcc

anyone learning even rudimentary programming in the 80s absolutely spent some time on the good ol' Infinite Wireframe Grid Realm

mcc reshared this.

in reply to mcc

feels like I'm fighting for the user, or about to be.
Questa voce è stata modificata (10 mesi fa)
in reply to mcc

Successful test with day 1 sample data, producing sample-data result (11)
in reply to mcc

Now running the same program with the true data and it just… hangs. Actually not sure if this indicates there's a bug in my program or if it's just running VERY VERY SLOWLY at Apple // speeds. Also got this sinking horror realizing that some of the numbers in this list are over 65,536 and I'm not actually certain if Applesoft BASIC supports integers larger than 16 bits
in reply to mcc

UPDATE: LOL, oh no, oh *no*. After running for quite a while and me writing the above comment, my program prints the following one (1) line. That means the first two smallest numbers in two columns are 565 and 743, and the difference between them is 224. Neither of those numbers is in the list. In fact, every number in the list is five digits.

I'M WORKING WITH SHORTS. MY PROGRAM WORKS, BUT MY COMPUTER IS TOO WEAK TO PROCESS NUMBERS OVER 65,536. I HAVE NO IDEA WHAT I'M GOING TO DO NEXT LOL

Questa voce è stata modificata (10 mesi fa)

Oblomov reshared this.

in reply to mcc

reprocess the data into strings, write a quick math library for said strings, and wait a lot longer for the output?
in reply to mcc

That's weird, because there are no integers in Applesoft BASIC. All numbers are 40-bit floats (see mirrors.apple2.org.za/ftp.appl…).
in reply to mcc

@avidrissman The thing is the manual says it's two bytes per array element… maybe I just need to allocate a float array?
in reply to mcc

OK, now you’re teaching me. There is a difference between int and float arrays? Wow it’s been too many decades.

Probably worth switching to float arrays.

in reply to Avi Drissman :vm:

@avidrissman It's also not completely clear the "IDE" I'm using to write this code is using the version of BASIC I think it is. It claims to be ProDOS BASIC, which should be Applesoft not Integer, but I don't seem to be able to directly inject commands so it's a bit hard to test
in reply to mcc

You're using integer BASIC. Emulate an Apple IIe with a disk drive and use the modern floating point BASIC instead.

EDIT: It's not integer BASIC

Questa voce è stata modificata (10 mesi fa)
in reply to Something spooky named Gregly

@gregly yup I figured that out and posted it immediately below the post you replied to 😀

At this point I'm guessing something is weird about DATA/READ but it's only a hunch.

in reply to stilescrisis

@stilescrisis DATA is my suspect #1 because avi drissman tested the arrays and they default to float unless you specifically request integer, at least in his ProDOS BASIC
in reply to mcc

if that's the culprit, maybe you could replace the DATA/READ statements with just directly filling in the array? Just a long list of X(0)=123 statements. It'll be ugly but you've already got a script ready.
in reply to mcc

I'm definitely curious, post when you figure it out 😀
in reply to mcc

@stilescrisis Just did this to confirm that. Also because I’m bored and thought it would be fun. I have not coded in Applesoft BASIC for over 30 years, since junior-high school… I didn’t even know there were “real” and “integer” numbers at the time. 😅
in reply to Something spooky named Gregly

@gregly There goes that theory! Thanks for checking it.

(Is it cheating to debug the program in a faster, easier to work with BASIC and then finish by running it on the Apple II?)

in reply to stilescrisis

@stilescrisis @gregly I'd be worried about introducing problems during the "port". But also part of the challenge here is to see if I can "think in" the target language…
in reply to mcc

@stilescrisis I mean, not particularly vital since it didn’t reveal anything new 😅

But I thank you for that bit of motivation. It’s been a while since the days when I floored my teachers with my uncanny ability to… copy programs out of magazines.

What can I say, they were very easily astonished. 😑

in reply to mcc

Okay ok so talking to some people with contemporaneous memories and consulting the manual more carefully, I *think* the *variables* are 40-bit floats, but the *array* I'm using for storage is clipping to signed 16-bit. So I think I can fix my program by converting the array declaration to use floats.

The manual… *suggests* DIMs can have a type, but… doesn't explain how I specify it.

I'll figure this out… but first I'm going to walk around the block, eat some fried rice and angrily play Tetris.

in reply to mcc

I feel like I remember once specifying a type for an array... in AmigaBASIC. When I was, what, twelve? Maybe there was a $ involved?
in reply to Dag Ågren ↙︎↙︎↙︎

c64-wiki.com/wiki/DIM It was something much like this, but, annoyingly, this does seem to say that using no symbols on the name makes the variables reals.
in reply to Dag Ågren ↙︎↙︎↙︎

If you can't get anything else to work, maybe make the array a string array with DIM A$, and then use STR$ and VAL to convert to and from string when storing and loading? mirrors.apple2.org.za/Apple%20… , page 59
Questa voce è stata modificata (10 mesi fa)
in reply to mcc

Are you using a % and if so, does dropping that fix it?
in reply to mcc

mirrors.apple2.org.za/Apple%20…

You should get real arrays automatically if you don't use %. However, I'm completely doubting myself now, so lemme hack in Virtual II and see.

in reply to Avi Drissman :vm:

@avidrissman *scratching head*
i'm gonna have to run a few different test programs, and probably verify that the CYAN||DE ide is giving the same results as the AppleWin emulator.
in reply to mcc

There's two entirely separate BASIC implementations. There's a tiny integer-only one written by Woz and a more full-featured one written by Microsoft. What do you get if you try to execute PRINT 0.1 ?

EDIT: mcc was using Microsoft BASIC

Questa voce è stata modificata (10 mesi fa)
in reply to mcc

@avidrissman YOU WERE RIGHT mastodon.social/@mcc/113745200…


I AM A FOOL!!!!!!!!

When I took the screenshot earlier that made me abort and question all my assumptions about Applesoft BASIC, I believed I was seeing a printout of `PRINT A(SMI(0),0),A(SMI(1),1),DIFF`.

I wasn't!!! I had several REM'd PRINTs and the uncommented one said `PRINT SMI(0),SMI(1),DIFF`.

Those numbers I posted earlier, which I believed represented values being truncated?

No!!! Those numbers were INDEXES!!

The screenshot above showed my code WORKING CORRECTLY!


in reply to mcc

It’s never the ~compiler~ emulator 😀

In any case, it’s a blast watching you wrestle with Applesoft; enjoy the beginner-mind.

in reply to Avi Drissman :vm:

@avidrissman If you want to see me REALLY cuss up a storm just wait for whatever week I do Haskell
in reply to mcc

@avidrissman (I have never successfully written a program in Haskell, because I don't understand "do". One of my primary reasons for this language-tourism project is I want to understand Haskell "do".)
in reply to mcc

Okay so before proceeding I need to show you my Tetris score from the arcade. This is not actually very good, but it is not *bad*. This represents one week of practice with TGM3. Notice also my Easy record, which I got during warmup today. It's decent. Someone had left a stuffed Cinamaroll on the Tetris cabinet and it kept me company.

That out of the way…

Questa voce è stata modificata (10 mesi fa)
in reply to mcc

I AM A FOOL!!!!!!!!

When I took the screenshot earlier that made me abort and question all my assumptions about Applesoft BASIC, I believed I was seeing a printout of `PRINT A(SMI(0),0),A(SMI(1),1),DIFF`.

I wasn't!!! I had several REM'd PRINTs and the uncommented one said `PRINT SMI(0),SMI(1),DIFF`.

Those numbers I posted earlier, which I believed represented values being truncated?

No!!! Those numbers were INDEXES!!

The screenshot above showed my code WORKING CORRECTLY!

Questa voce è stata modificata (10 mesi fa)
in reply to mcc

Now another possibility is that I'm not a fool, rather we're seeing here is the downside of working in a language with no whitespace, strict limitations on variable names, with no means of debugging besides prints, and where both comments and debug prints have to compete for extremely scarce line-number real estate with your actual code. Plus, apparently, the value of taking a break to play some Tetris and actually eat dinner, rather than glaring at the screen stewing in your own bad assumptions
in reply to mcc

Apologies to everyone ( retro.pizza/@gregly/1137451313… ) who spent time trying to help me fix my entirely nonexistent bug.

Since I now *believe* I have a working program,it's time to move it to the "regular" emulator to actually run it.

CYAN||DE has a "Get Disk" button, which exports all the saved programs from your current browser session plus ProDOS 2.0.3 to a disk image. Here's my disk, with a hello world program, the two sample programs, and the hypothetical "real" one (with clearer debug prints)


@stilescrisis Just did this to confirm that. Also because I’m bored and thought it would be fun. I have not coded in Applesoft BASIC for over 30 years, since junior-high school… I didn’t even know there were “real” and “integer” numbers at the time. 😅
Questa voce è stata modificata (10 mesi fa)
in reply to mcc

Running the programs on my exported disk, TEST is empty; it looks like I saved it wrong. Well, whatever. SAMPLE and SAMPLE2 run totally as expected. So I expect PUZZLE to run. But there's still a problem: My program is still really slow.

I'm tired. I'm grumpy. I say, fuck it. I decide to cheat, just a little. I overclock the emulator.

…oh, that runs MUCH faster.

Questa voce è stata modificata (10 mesi fa)
in reply to mcc

About 1000 seconds later, my overclocked program completes with a result: 1889772. (This isn't spoilers, AOC problem sets and answers are randomized for every participant.) I plug it in. It's right on the first try! If I'd only believed in myself instead of freaking out at seemingly incorrect debug output, I could have started the incorrect-debugprints version of the program running 4½ hours ago before I walked to the arcade and it might have been finishing with the right answer right about now.
in reply to mcc

Part 2 looks actually slightly easier than part 1, but I am done for today. I have a pretty amazing headache right now! Maybe I shouldn't have intentionally chosen to spend my day off from my job programming doing the most unnecessarily difficult programming challenge I could think of

EDIT:
Run instructions in run.txt
github.com/mcclure/aoc2024/tre…
My 01-01 source code:
github.com/mcclure/aoc2024/blo…

Questa voce è stata modificata (10 mesi fa)
in reply to mcc

"Maybe I shouldn't have intentionally chosen to spend my day off from my job programming doing the most unnecessarily difficult programming challenge I could think of"

I can't remember a time since Y2K when I *didn't* spend my long periods of time off from my job programming doing hobby programming on Linux.

in reply to mcc

Nice. Very readable. I'm not used to seeing LET in front of variable assignments since it's not required, but now that Rust is popular, it looks more modern. For loops where it matters, it helps to know how to shave every extraneous token & REM.

Some folks think mistakenly that % integer vars are faster, but on MSFT 8-bit BASIC, they're actually slower than the default because it converts them to/from FP for math.

ProDOS patches Applesoft BASIC with a fast string GC not in MSFT/Commodore.

in reply to jhamby

@jhamby I went with the LET because in the CYAN||DE IDE it would cause those lines to have a highlight at the start that distinguished them from REMs…

I actually got 😠s from a friend once by making a programming language which was ML-like but used BASIC-like LET statements instead of ML-like LET statements and they are not the same (in functional programming languages, it's expected every instance of "let" creates a new lexical binding… in Emily 1 it did… not exactly this.)

in reply to mcc

oh, that makes perfect sense. Too bad there's no Apple IIGS version. I bought the ORCA compilers (and source code) from Byteworks so I'm hoping to write C and Asm code on the IIGS for the IIGS. ORCA/C supports C17 now, with regular patch updates on GitHub. #AppleIIForever is no joke.
in reply to mcc

I said I was done for the evening, but instead of going to bed I went ahead and did an attempt at the next problem, because it looked *so* easy. This time I used an advanced technology I'd never used in Applesoft BASIC before: for loops. Of course, it does not work.

Check this out. I've got two nested FOR loops for AIL and AIR. If you look at "PRINT AIL,AIR", it seems each time AIR increments, it's incrementing *BOTH* the AIL and AIR variables. AIL doesn't exist on line 271; line 280 thus fails

in reply to mcc

This *looks* as if nested for loops simply aren't supported, and the inner loop screws up the outer one. Fine. Except looking in "Applesoft Basic toolbox" (Addison-Wesley microcomputer books, 1984, vintageapple.org/apple_ii/pdf/… page 183) I see a flat out claim that this works, as long as I unroll in the correct order and don't GOTO out.

Does anyone see an obvious error I made and am not noticing because I ought to be in bed? This couldn't possibly be a Prodos/Applesoft BASIC difference, could it?

in reply to mcc

Holy shit. Holy shit. Holy shit. Holy shit. This was it.

mastodon.scot/@nettles/1137458…

All letters in an Applesoft Basic variable name after the first two are *advisory*. Basically a comment

Steve Wozniak— I have never had reason to say this before in my life, but— Steve Wozniak, you have done me wrong

( Possibly this is actually on Bill Gates? He has done me wrong previously actually. mastodon.social/@mausmalone/11… )


I don't know Applesoft BASIC, but after a quick look at some materials I _think_ variable names are only distinguished by the first two characters, so "AIR" and "AIL" refer to the same variable.

Oblomov reshared this.

in reply to Irenes (many)

@ireneista i don't think i knew it 35 years ago (i don't… think i knew variables could be more than one letter, back then), but i think i knew it briefly around 2011 when i briefly attempted to write an applesoft BASIC interpreter and did a bunch of research. and then forgot
in reply to mcc

STEVE WOZNIAK, I HAVE SLANDERED YOU, YOU ARE WONDERFUL AND YOU HAVE NEVER DONE ANYTHING BUT IMPROVE MY LIFE

plush.city/@fluffy/11374593064…


In fact, Wozniak wrote Apple Integer BASIC (the predecessor to Applesoft BASIC which was an MS-BASIC fork) and it actually did support arbitrary-length variable names, unlike most BASICs of the era.

Oblomov reshared this.

in reply to mcc

I've done it! It took me 35 or 36 years, three scanned reference manuals, and the help of multiple people on a global telecommunications network, but for the first time in my life I have SUCCESSFULLY WRITTEN A WORKING FOR LOOP IN APPLESOFT BASIC.

I will now write no more Applesoft BASIC for the rest of the week, probably the rest of my life. If I ever need to write an Apple // program again I'm writing my own assembler.

Run instructions:
github.com/mcclure/aoc2024/tre…
Source:
github.com/mcclure/aoc2024/blo…

Oblomov reshared this.

in reply to mcc

Something like that was my first thought, and then I thought "no, that would be insane, who would perpetrate such an atrocity?" TIL.
in reply to mcc

Oh no… this sounds really familiar… Honestly props to you though haha. I’ve been having fun doing asm on my //e’s, but I have *no* nostalgia for AppleSoft.
in reply to slembcke

@slembcke It was a thing I had to do. It wasn't a good thing to do. It was just a thing I had to do for myself
in reply to mcc

@slembcke Although I'm gonna be honest I was looking forward to Applesoft BASIC week more than Haskell week
in reply to mcc

if you wanted a cursed language, I’m surprised you didn’t have MUMPS on the list:
* function calls can be implicitly abbreviated up to the point of ambiguity
* one universal data type, which is implicitly coerced to string, integer, or floating-point data types as context requires
* globals persist between executions
in reply to mcc

I've been trying to do less living vicariously through others in general in my life lately, but in this case I really appreciate you for letting me relive the experience of using old school BASIC without having to actually personally suffer.
in reply to Meg

@megmac I'm like "hey, it's basically assembly with dynamic typing! it won't really be that bad!" it's been bad
@Meg
in reply to mcc

@megmac What's been really great about this experiment is like, how simultaneously shockingly helpful and shockingly unhelpful the documentation has been. Like the official manual says specifically how much RAM it takes up in *bytes* every time you use a for loop or create an array or whatever, but doesn't think it's relevant to explain things like "what happens if you put a FOR loop inside another FOR loop?" or "what are the semantics of the AND and OR operators?" or "what data type is this?"
@Meg

mcc reshared this.

in reply to mcc

But in the documentation I have seen in the thread so far, I *think* there was a hint about at least the 2-letterness of arrays names. The bit about memory usage of arrays mentioned 2 bytes for the name.
in reply to mcc

I don't know Applesoft BASIC, but after a quick look at some materials I _think_ variable names are only distinguished by the first two characters, so "AIR" and "AIL" refer to the same variable.
in reply to mcc

@nettles I think I might have known this at some point in my life but I had forgotten it D:
in reply to mcc

just a note of caution for this spoiler policy: I think some of the later problems (in the teens?) are less randomized? I have some friends who were working from the exact same problem.
in reply to cassie

@porglezomp Hm, well maybe at some point I should start adding spoiler tags? Do you want to recommend a certain point I should start with it?
in reply to mcc

I’m not sure at what point, I’ve only been following other people doing it this year.

(Although thinking about it more—maybe you don’t need to worry? I think all the early ones are probably thoroughly randomized and within a few weeks people probably won’t care much about spoilers for this year’s problems.)

in reply to mcc

god, I feel that… the number of times that I took a break, came back to my code, immediately found my mistake and facepalmed so hard it left a mark… 😅
in reply to mcc

When I got into RISC OS on the Raspberry Pi a few years ago and discovered BBC BASIC, I was angry for a few days that such a good BASIC never got exported outside the UK, for the most part. Apparently they were going to try to sell in the US, and had patched the ROM to recognize "COLOR" as well as "COLOUR", but Jack Tramiel had a price war going and they figured the BBC Micro wouldn't have been competitive with the C64, Apple II line, etc..

Applesoft BASIC has a really bad line editor.

reshared this

in reply to mcc

There are two BASICs. One is integer only and one is floating point. It should be easy to tell the difference (e.g. try PRINT 0.1)

According to this, the floating points use five bytes per number so it should hopefully be sufficient, albeit very slow: groups.google.com/g/comp.emula…

in reply to mcc

Would read this 1987 horror novel. Not sure about the title but damn that cover art.
in reply to mcc

Haha! That’s actually one of the Apple // books in the pile next to my desk!
in reply to mcc

For an Aesthetic vintage computer manual design, the ZX81 manual takes some beating. Artwork by legendary sci-fi artist, John Harris
in reply to mcc

now that's an image that smells like "book"
in reply to mcc

I would like a collection of these
I do have some books on this, but they diverge too much towards other less interesting aesthetics
in reply to mcc

Wait a minute, isn't proos the things you find in a greengrocer?
in reply to mcc

I think I now believe that the fetishizing of beautiful objects is a slipery slope into the world of porn... wait.. not people porn, but

seductive objects or books, catalog pictures, and displays an demos that make you drool, then that once you get them leave you cold and empty on the inside, craving more.

The whol point of wich is having the desire, not the thing itself.

in reply to mcc

This looks incredible! 😍 I would buy it just for the cover!

@mcc

@mcc
in reply to mcc

Not really! Most BASICs included RENUM which would renumber your lines automatically. Not sure about Apple II, but Apple IIgs and MS-DOS BASIC could do this.

Also, you can smash as many statements as you like on a single line with the : mark. The only limitation is that you can't target those statements via a GOTO/GOSUB.

in reply to mcc

all the basics I used (which doesn't include yours) had RENUMBER.

I fondly remember a BBC basic error message:

> renumber 0,0
*silly

in reply to mcc

I jumped directly from punched cards on an IBM mainframe to the original `ed` on Unix - so missed this delightful experience.
in reply to mcc

BASIC was my first programming language, too! But I was ancient compared to you - learned it on an Apple IIe when I was 12.

That was really fun and I probably should have pursued it more aggressively.

in reply to Charlotte

@Foritus oh god i have written so much perl… i've done things i'm not proud of
in reply to mcc

If it helps, I can still remember TCL from writing eggdrop IRC bots, much to my schadenfreude 😅
in reply to Charlotte

@Foritus oh yeah! I should actually add TCL to my list.

I've been working with FPGA stuff and to my absolute shock the entire FPGA ecosystem is completely stuffed with TCL? I think the idea is Verilog is a bit unfriendly and TCL is easy to slap on as a preprocessor in a language that doesn't expect to have a preprocessor. So I'm talking to the deep horrors electrical engineering people and the only programming language they know is… TCL

in reply to mcc

@Foritus

This finally explains to me why Spirent, where I was a software contractor almost 20 years ago, had so much TCL all over the place. (Lots of FPGA-based products for network load emulation and similar activities.)

in reply to mcc

woooah! clojure!

that language has just so many super-cool ideas in it, and so many neat little experiments

there's a lot of really neat picks in here
good luck with the challenge! :blobcheerL: :blobcheerR: :blobcheerL:

Unknown parent

mastodon - Collegamento all'originale
mcc
@steve @Foritus once you start using a language it's a big ask to expect you to switch to a different one… i expect the hdl people will continue using tcl indefinitely for the simple reason that they are already using tcl
in reply to mcc

Ooh, this is so cool! I'm excited to follow your journey!
Unknown parent

mastodon - Collegamento all'originale
mcc
@dysfun It's how you format disks on an Apple //c
Unknown parent

Unknown parent

Unknown parent

Unknown parent

Unknown parent

mastodon - Collegamento all'originale
fluffy 💜
@AlgoCompSynth yeah that's definitely a microsoft basic thing, Commodore BASIC was the same way
in reply to mcc

In fact, Wozniak wrote Apple Integer BASIC (the predecessor to Applesoft BASIC which was an MS-BASIC fork) and it actually did support arbitrary-length variable names, unlike most BASICs of the era.

reshared this

Unknown parent

gotosocial - Collegamento all'originale
Jordan
Despite its impact everywhere else I did not expect AI to ruin @mcc's day inside an Apple II emulator but here we are.
@mcc
Unknown parent

mastodon - Collegamento all'originale
mcc
@pare @mausmalone I wonder if any versions of BASIC ever let you execute RENUMBER as a line of a running program, and whether you could do abnormal self-modifying-code flow control tricks with this

reshared this

Unknown parent

mastodon - Collegamento all'originale
Pare

Sensitive content

Oblomov reshared this.

Unknown parent

mastodon - Collegamento all'originale
mcc

@tomjennings Yeah, I don't know what I would have done if the AOC input had turned out to be too large to fit in the emulator RAM…!

I also wonder what would have happened if someone on here hadn't spotted the two letter issue. I guess I would have rewritten the code to use GOTOs, and at some point realized the problem was the AIL/AIR variables, not the FORloops themselves…

in reply to mcc

@pare @mausmalone

The thought of running into this in the wild makes my head feel like it's gonna explode..