#BabelOfCode 2024
Week 4
Language: FORTRAN

Confidence level: High

PREV WEEK: https://mastodon.social/@mcc/113867584791780280
NEXT WEEK: https://mastodon.social/@mcc/113975448813565537
RULES: https://mastodon.social/@mcc/113676228091546556

I was very excited about doing TCL this week, but I told myself the first time I get a two-dimensional array problem I'd go FORTRAN, so I guess this week is FORTRAN.

A friend of mine who did AOC2024 in December noted the early challenges this year were *very* easy. Today's definitely is. I wonder if part 2 will have any depth.

I went into this thinking: C is basically cleaned up FORTRAN, right? I know C? This should be easy, right? Right off the bat I find there will be a lot of difficulties entirely not of the kind I'm used to in programming. After a brief adventure with accidentally naming my file .f and not .f90 causing horrific and baffling errors, I run a hello world off the Internet. There's a space before the printout. Hm, how do I turn that off?

https://stackoverflow.com/a/31236043

Oh my fuck, *what*?

How to get rid of unwanted spacing in Fortran's print output?

It may look like a trivial issue, but I couldn't find any answer through googling. I have this little program : Program Test_spacing_print Integer:: N Real:: A,B N=4; A=1.0; B=100.0 prin...

Stack Overflow

I get frustrated with C all the time for being fundamentally a 70s language. It may be I'm about to learn the pain of using a *50s language*.

(Alternately, I hear modern FORTRAN has all kinds of fancy niceties like operator overloading and might not resemble traditional FORTRAN all that much. But then I have the problem if I pick up a random tutorial it's hard to guess which *decade's* standard it's teaching me from, or if it's the GNU extension, if the GNU extension is that different, etc.)

Just learned FORTRAN has an aint() function

Don't that just beat all

@mcc does it have a y'all function? Because if so, I'm switching immediately

@foone pretty sure no

I assume that the "y'all" keyword would be a standin for every variable in scope. So you say

y'all += 4

and it adds 4 to all variables.

It might be possible to implement this in userspace in Python.

@mcc @foone But then what does all y'all do?
@darkling @foone y'all — increments all locals
all y'all — increments all globals and locals
@mcc @darkling @foone this suggests you could type y'all() and it would be the code equivalent of selecting everything on your desktop and pressing enter
@mcc @foone @darkling In some parts of Arkansas and elsewhere, “you ‘uns” is used instead of “y’all.” I assume “you ‘uns” would operate on all variables currently equal to 1.
@mcc
Y'all locals would prefer to go to a bar and not be 'incremented' though.
@darkling @foone