Remix.run Logo
noobermin 11 hours ago

So, the OP is an actual educator whereas I've only really advised grad students or undergrads. I'm surprised being exposed to any new language doesn't come with it's "whys" for students. Like why should we care about type safety anyway? Or why not loop over all indices, why use (:) for some of them? May be I'm not really convinced that the whys from students in a python class are worse than the whys in fortran. Honestly, if there is some compiler option for turning on implicit none by default, I'd just do that too just to get people in the door as that too feels like more confusion than it's worth keeping, although they do need to learn what it means before they leave.

Also, the downside is fortran does not have nice plotting capabilities without an external tool. At least I know of no nice libraries like matplotlib, which again is a point in just teaching them a more general purpose language from the get go to get used to it so they can plot and code in the same language...or perhaps, matlab/octave et al as others suggested. I feel like the niceness of fortran (namely, well defined type safe function/subroutine interfaces and easy path to writing performant code) that isn't offered by python is only useful after the first threshold of learning to put algorithm to paper. The literally second (and arguably for some fields, even more important) task of actually plotting results doesn't have the same convenience as the intrinsic procedures in fortran, whereas if they had learned julia or python, these tools would be at the very least be at the same convenience level of the array facilities, essentially behind a rather easy[^] to use library. In fact, in julia, you're already mostly there although it's not my cup of tea. Perhaps the answer is julia after all.

Does OP's courses just use an external program (like gnuplot) or a black box to plot?

[^] easy to use once you know how to program a little, of course.

shakna 11 hours ago | parent [-]

Fortran has a few nice plotting libraries. [0] Including matplotlib.

Personally, I've only used ogpf, which is a single-file library, making it easier to run for beginners.

[0] https://fortran-lang.org/packages/graphics/

noobermin 10 hours ago | parent [-]

I did a cursory scan and some of these seem not my cup of tea, but honestly ogpf looks rather pleasant for quick plots. Thanks! I might use this.

That said, the point of these being external libraries and thus making them a bit less convenient still sort of stands, as being external libraries means you need to link them which exposes more CS tier stuff (installing libraries, make files, etc) that distracts from just learning codes, which again just motivates using a tool that abstracts some of that behind a managed package and library system.

I'm assuming you could use things like lfortran in jupyter which I imagine might allow these things to be bundled, although I haven't followed that effort as of late.

pklausler 9 hours ago | parent [-]

What language does have built-in plotting capabilities that don't depend on external libraries?

int_19h 5 hours ago | parent | next [-]

It depends on how you define "built-in" exactly. I would argue that in this context, if the end user isn't aware that an external library is used under the hood, it still qualifies as built-in. In which case, R has plot() in its stdlib.

TimorousBestie a few seconds ago | parent [-]

By this definition, python doesn’t have plotting in its stdlib.

dgacmu 9 hours ago | parent | prev [-]

Language vs system with a language?

Mathematica, matlab, maple, octave, etc.