Live data from Hacker News

Show HN: We built a terminal-only Bluesky / AT Proto client written in Fortran

github.com

81–90 of 91 posts

Re: Show HN: We built a terminal-only Bluesky / AT Proto client written in Fortran

#81
post #4

out of curiosity, why fortran? no disrespect. I wrote a lot of scientific software in the earlier days of my career and I learned fortran to update ocean modeling software.

> why fortran? why not? the language is straightforward and loops are fast. It is portable and your code will work unchanged for the next 50 years. It may be a bit verbose, but that's not a big deal with today's tooling.

Yea na, Fortran is pretty compiler dependent and there are a lot of compilers. Already old Fortran code used all sorts of now-dead proprietary compilers and can take a huge effort to get it to compile on modern compilers or even modern computers. Modern code might use Gfortran which sometimes makes breaking changes so that's not an option. Perhaps if everyone uses the latest shiny new Flang or whatever, then it'll finally last 50 years? Not likely, given the history.

Re: Show HN: We built a terminal-only Bluesky / AT Proto client written in Fortran

#82

Earlier quoted context omitted.

Modern versions of Fortran are reasonably pretty. It’s a fairly nice language. You can probably get better performance out of C/C++ with unlimited effort. But, it is really nice for allowing computational scientists to get, like, 95% of the way there. I think it actually suffers from the reputation as this ancient/super hardcore performance language. The name comes from “Formula Translating System,” which implies… it…

ive maintained a simulation software where the core is written in fortran. its using some intel math library that is expensive that i cannot recall, does immense calculations and makes faster binaries than c on every compiler we tried

Have you tried using the restrict keyword everywhere you can in c?

In Fortran, arrays are not allowed to overlap which allows some optimisations. c has rules in the spec about how memory accesses must occur, and overlapping arrays being possible prevents some compiler optimisations. The restrict keyword is you promising that the memory at some pointer won't be accessed through another pointer.

You can compare two implementations in Fortran/c using godbolt to see how each of them compile.

Re: Show HN: We built a terminal-only Bluesky / AT Proto client written in Fortran

#84
post #83

I'm curious if you used AI during development and how it handled Fortran

Great question!

This was quite straightforward to code ’manually’, but we got stuck for some hours when trying to send the first message. CPU topped, fans spinning, no message through. Analyzed, and after a while when we got same block the nth time, someone proposed Claude.

So Claude got the repo, prompted Claude:

”You got one job, why isn’t message through and why CPU usage high?”

He didn’t solve it. Probably could have if we kept Clauding.

But we found the problem. The issue was that the code was hitting the terminal 300 times trying to send the message :)

For clarity reasons Claude got the job to write the README, personally I don’t like that approach, but we got many other projects so time management basically.

We are building Cobolsky too.

Right now we are building the part to get images through using Apples old algo. Will be 576x720 using the Föoyd-Steinberg dither, 1984 Apple algorithm :)

Re: Show HN: We built a terminal-only Bluesky / AT Proto client written in Fortran

#85

Earlier quoted context omitted.

ive maintained a simulation software where the core is written in fortran. its using some intel math library that is expensive that i cannot recall, does immense calculations and makes faster binaries than c on every compiler we tried

Have you tried using the restrict keyword everywhere you can in c? In Fortran, arrays are not allowed to overlap which allows some optimisations. c has rules in the spec about how memory accesses must occur, and overlapping arrays being possible prevents some compiler optimisations. The restrict keyword is you promising that the memory at some pointer won't be accessed through another pointer. You can compare two imp…

Dummy arguments may not alias anything else, including other dummy arguments, in conforming Fortran if either are modified, with some exceptions. But there are many ways in which arrays can overlap that don’t involve dummy arguments. GNU Fortran optimizes ASSOCIATE names as if they were free of aliasing, too, but that is a bug.

Re: Show HN: We built a terminal-only Bluesky / AT Proto client written in Fortran

#86
post #4

Earlier quoted context omitted.

> why fortran? why not? the language is straightforward and loops are fast. It is portable and your code will work unchanged for the next 50 years. It may be a bit verbose, but that's not a big deal with today's tooling.

Yea na, Fortran is pretty compiler dependent and there are a lot of compilers. Already old Fortran code used all sorts of now-dead proprietary compilers and can take a huge effort to get it to compile on modern compilers or even modern computers. Modern code might use Gfortran which sometimes makes breaking changes so that's not an option. Perhaps if everyone uses the latest shiny new Flang or whatever, then it'll fi…

For a standardized language, Fortran isn’t very portable across compilers. GNU Fortran has done a great job supporting legacy features, and I hope that our work in flang-new has made it easy to port to, as well. I basically ignored the zealots who wanted flang-new to be a strict compiler by default. The hobbyist project LFortran is quite the opposite, and will yell at you by default for perfectly conforming variations in keyword spelling. For those who like that sort of thing, that’s exactly the sort of thing that they like.

Re: Show HN: We built a terminal-only Bluesky / AT Proto client written in Fortran

#87
post #32

Earlier quoted context omitted.

I came here to suggest COBOL as a better fit, then saw your comment a few levels up in this thread. Out of curiosity, does your implementation use CODASYL? (For people that don't pay much attention to historical software systems, most CODASYL implementations were similar to JSON document databases, so going that way isn't as crazy as it sounds.)

Great comment! Thanks! No CODASYL, the JSON parser is hand-rolled Fortran with a depth-tracking key scanner CODASYL not a crazy direction for the feed composer Got more depth to explore here, still early :)

CODASYL is deeply integrated with COBOL; I'm not sure it ever even worked with fortran. (I was asking about the new COBOL version you mentioned.)

Re: Show HN: We built a terminal-only Bluesky / AT Proto client written in Fortran

#88

out of curiosity, why fortran? no disrespect. I wrote a lot of scientific software in the earlier days of my career and I learned fortran to update ocean modeling software.

You are not the first one to ask :) We built Cobolsky. Will go public soon. Parallelly too curious on Fortran. The world is better with a Fortran-based social network client in it :) When we are building the feed composer, in next version, Fortran will be great for the algorithm etc. Keeping the ancient languages alive. I built some Cobol stuff many years ago. Back at it again. Rusty. Both Cobolsky and Fortransky loo…

Ya know what? Rock on Fortran Friend. Keep doing what you are doing. We need more nerds passionate about Fortran.

Re: Show HN: We built a terminal-only Bluesky / AT Proto client written in Fortran

#90

Earlier quoted context omitted.

Your code will work unchanged until you try to change compilers or your compiler adopts a J3 breaking change to the language.

> your compiler adopts a J3 breaking change to the language Like all the 3 of them they added in the last 30 years, and that compiler vendors are not enforcing anyway because they don’t want to annoy their users? Windows’ backward compatibility is a joke compared to Fortran.

We're definitely enforcing some of them. But the latest one from F'2023 isn't going to be.
Post reply on HN