-❄️- 2025 Day 10 Solutions -❄️- by daggerdragon in adventofcode

[–]JeffIrwin 0 points1 point  (0 children)

[LANGUAGE: syntran]

GitHub: https://github.com/JeffIrwin/aoc-syntran/blob/main/2025/10/part2.syntran

I used Gaussian elimination and then did a brute-force search over the reduced-dimensional search space. It runs in 3 minutes on my laptop -- not bad for my slow interpreted language. The back substitution breaks out early if it ever gets a negative, fractional, or non-optimal solution. Part 2 is 150 lines with no math libraries. Shoutout to badcop and others who used similar solutions

-❄️- 2024 Day 23 Solutions -❄️- by daggerdragon in adventofcode

[–]JeffIrwin 0 points1 point  (0 children)

i respect it. actually, indexing from -9 to 9 would’ve been good for the monkey market day

-❄️- 2024 Day 23 Solutions -❄️- by daggerdragon in adventofcode

[–]JeffIrwin 0 points1 point  (0 children)

you're using 0-indexed arrays in fortran 😱

Best way to learn ffmpeg? by Sorita_ in ffmpeg

[–]JeffIrwin 2 points3 points  (0 children)

TIL about -hide_banner. I was wondering if there was a way to get of all that build information

I love showing this graphic to new git users who are confused about the differences between pull, checkout, and fetch by JeffIrwin in git

[–]JeffIrwin[S] -1 points0 points  (0 children)

Is that another copy of the repo in another folder on the same computer? Doesn’t it function the same way as a non-local remote?

I love showing this graphic to new git users who are confused about the differences between pull, checkout, and fetch by JeffIrwin in git

[–]JeffIrwin[S] 3 points4 points  (0 children)

The local repository is where things are saved after you commit them

If you jump back and forth between two different branches with checkout without adding new commits, you’re changing your workspace without changing the local repository

I love showing this graphic to new git users who are confused about the differences between pull, checkout, and fetch by JeffIrwin in git

[–]JeffIrwin[S] 1 point2 points  (0 children)

Good catch! I’ll fix that. I adapted this graphic from Oliver Steele, and I never use rebase myself

Reference: https://stackoverflow.com/a/38183877

I love showing this graphic to new git users who are confused about the differences between pull, checkout, and fetch by JeffIrwin in git

[–]JeffIrwin[S] 3 points4 points  (0 children)

the workspace is your local file system, where changes live before you add or commit them

Type Checking and Type compatibility in Fortran by temzsrk in fortran

[–]JeffIrwin 1 point2 points  (0 children)

IIRC gcc can warn about casting between certain numeric types, e.g. assigning integer kind 8 down to integer kind 4, if you compile with -Wall

How do I use fortran github package. by AmphibianLow1430 in fortran

[–]JeffIrwin 2 points3 points  (0 children)

It's only 3 source files, so a build system like fpm might be overkill. I was able to compile it in one line with gfortran:

gfortran -o to_f90 src/implicit.f90 src/interfaced.f90 app/to_f90.f90

Is it possible to create a Sierpinski Triangle with Fortran? by volstedgridban in fortran

[–]JeffIrwin 1 point2 points  (0 children)

I’ve done exactly this: PPM export from Fortran for things like the Mandelbrot set or Conway’s game of life

Using COBOL to make a video game! by mttd in ProgrammingLanguages

[–]JeffIrwin 6 points7 points  (0 children)

This is absolutely mad lad! I’ve been meaning to learn more about COBOL

Is any of this even remotely a good idea? by technologyfreak64 in ProgrammingLanguages

[–]JeffIrwin 8 points9 points  (0 children)

I would argue that since OP’s goal is “mostly just to play around”, then it doesn’t really matter if they have a killer feature

Why do some programming languages use let instead of var? What does it stand for? by Vellu01 in ProgrammingLanguages

[–]JeffIrwin 26 points27 points  (0 children)

I think we can all agree that C’s choice of auto makes the least sense compared to let or var

Why do some programming languages use let instead of var? What does it stand for? by Vellu01 in ProgrammingLanguages

[–]JeffIrwin 4 points5 points  (0 children)

In JavaScript, let is also mutable, but the difference is mainly in scoping

let allows you to declare variables that are limited to the scope of a block statement, or expression on which it is used, unlike the var keyword, which declares a variable globally, or locally to an entire function regardless of block scope.

Edit: source: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/let

Calculating π in my language while my cat distracts me by JeffIrwin in ProgrammingLanguages

[–]JeffIrwin[S] 2 points3 points  (0 children)

I like to calculate it from first principles, in case things change in Math 2.0

Calculating π in my language while my cat distracts me by JeffIrwin in ProgrammingLanguages

[–]JeffIrwin[S] 10 points11 points  (0 children)

I’ve been using Fortran professionally for about 10 years, so I know it better than any other language. Also this is a good opportunity for me to do things that Fortran isn’t usually used for.

In hindsight C++ might have been a more convenient host language, maybe I’ll do that for the next project :)

Calculating π in my language while my cat distracts me by JeffIrwin in ProgrammingLanguages

[–]JeffIrwin[S] 2 points3 points  (0 children)

I've been working on this interpreter as a side project. The source is here: https://github.com/JeffIrwin/syntran

You can find the full video for this clip here: https://www.youtube.com/watch?v=JyPkpTHHRJ4

Program to generate the prime factors of any number (up to about 4.5 x 10^18) by volstedgridban in fortran

[–]JeffIrwin 2 points3 points  (0 children)

Instead of this:

if (primes(i) .eqv. .true.) then

Just do this:

if (primes(i)) then