
Show HN: A Fortran web framework - mapmeld
https://github.com/mapmeld/fortran-machine
======
projectramo
I would love it if these projects were accompanied by a little blog post
stating who the person is, why they decided to do it etc. for projects where
it is obviously a labor of love.

Especially because of the effort it would take to get this working on a "dead"
language. Like who are you? How did you decide to work on this for the pure
joy of it? Why not Cobol? Why a web framework?

~~~
hellofunk
Fortran is actually still in major widespread use, particularly in the
scientific and engineering fields. This is partly because it has unparalleled
speed in some domains, better even than C or C++.

~~~
fhood
Fortran is ubiquitous in ocean and atmospheric modeling. I believe this is the
case for all earth sciences.

~~~
theophrastus
I have a buddy at US Fish and Wildlife where they do river flow modeling with
Fortran routines from the seventies formerly compiled on Windows machines. He
was finding it increasingly difficult to get his all-powerful shadowy IT
division to install a compliant MS Fortran compiler, and linux (somehow deemed
governmentally untenable?) was out of the question. So i helped him get his
~2000 Fortran lines into C/C++. _woowee..._ but did i see some hairy spaghetti
code. A favorite maneuver was to jump out of a loop, change the loop counter
on a subroutine branch, and jump back into the _middle_ of the loop.

~~~
hughw
Change the loop counter? That's supposed to be impossible in Fortran, isn't
it? Maybe that's a language extension?

~~~
theophrastus
This was from code originally from about 1978ish, which compiled on a
Microsoft Fortran compiler from the 2000s. It looked something like (without
indents):

    
    
        DO I=1,10000
          ...
          IF (QQQ .LT. RIX70) THEN
             CALL IXNARF( I, J, R1, R7, XL23 )
             GOTO 23
             ...
          END IF
          111 CONTINUE  
        ...
        END
    

IXNARF could change 'I' (because Fortran 77 passed arguments by reference not
value) and sometime after line (er... "card") 23 it might jump back into the
loop at 111.

oh and there was like three comments in the whole several thousand lines,
including my favorite at the top of one of the main loops:

    
    
        C  CHUGGA CHUGGA CHUGGA

~~~
sevenless
I remember you could change the value of 3 in Fortran 77.

Then there was the proposal for a Fortran COME FROM statement.

[http://www.fortran.com/fortran/come_from.html](http://www.fortran.com/fortran/come_from.html)

~~~
semi-extrinsic
I believe Intercal implements the COME FROM statement.

------
danpalmer
Also relevant: [https://github.com/azac/cobol-on-
wheelchair](https://github.com/azac/cobol-on-wheelchair)

~~~
elcapitan
The views are a little disappointing, using just plain mustache style.
Shouldn't a cobol web view have something like

    
    
        HEAD DIVISION
        META-TAGS SECTION.
    
        BODY DIVISION.

~~~
twic
DIV DIVISION?!

~~~
elcapitan
HR DEPARTMENT.

------
rlcarino
Hello,

I wrote the 'fortran+fastcgi+nginx' thingy. It has evolved into
[https://github.com/rlcarino/heeds](https://github.com/rlcarino/heeds).
Production live runs (and a little blog post about it) may be found at
[http://heeds.csu.edu.ph](http://heeds.csu.edu.ph). Some students from a
university connect to the runs with their Android phones without cell data
cost via Facebook's Free Basics which is available in that part of the world.
Usage instructions for students are in the FAQ of
[https://www.facebook.com/groups/csuheeds/](https://www.facebook.com/groups/csuheeds/).

Why do it? It is a consulting gig.

Ric Carino

------
cpr
Seeing this gave me a subtle but definite frisson of nostalgia for Fortran
(first language, learned in late 60's).

------
nickpsecurity
For those wondering why it's used, here's a write-up I found on Eric Raymond's
blog comparing Fortran and C:

[http://www.ibiblio.org/pub/languages/fortran/ch1-2.html](http://www.ibiblio.org/pub/languages/fortran/ch1-2.html)

Some comparisons are dated. However, I think the older variants still have
advantages in readability, more clear semantics, semantics closer to algorithm
itself (esp mathematical functions), less guessing by compiler for
optimizations, and maybe a few others. Those I listed seem to still be
advantages over C in general or as it's commonly used.

~~~
Trombone12
Also of note is that the implicit typing system of Fortran is held up as an
advantage (although a bit reluctantly)

------
ufmace
This reminds me of the time I actually found myself charged with integrating a
chunk of Fortran code compiled into a Windows DLL with an Excel sheet via VBA.
The VBA side was straightforward if a little icky, but handling strings in
Fortran was really giving me headaches. Documentation on Fortran, even down to
basic syntax, seemed inconsistent and hard to find online. I think I got the
project mostly working before I left that company for unrelated reasons.

------
mhd
I'm mostly used to Fortran 77 and that was ages ago, that actually looks quite
readable...

------
k__
Reminds me of: [https://github.com/azac/cobol-on-
wheelchair](https://github.com/azac/cobol-on-wheelchair)

------
supernintendo
Nice work! That home page, while admittedly simple, renders incredibly fast.
Have you done any benchmarks / performance comparisons to other web
frameworks?

~~~
mapmeld
No, not yet. It ought to be comparable to C++ in most cases. The difficult
part is extending Fortran to do something that you want / hasn't been shared
yet on the web.

------
WorldMaker
Given Ruby on Rails, COBOL on COGS, silly naming pattern, I'm a bit
disappointed this isn't called something like Fortran on Flumes.

------
haifeng
Just because you can?

~~~
ronnier
For some reason I've been seeing more and more Fortran lately. Maybe it's the
trendy thing to do.

~~~
phamilton
Honestly, High Performance Fortran has really nice support for parallel
arrays. For computational programming I see a lot of value.

~~~
valarauca1
The issue is what you give up. Yes the FORTRAN compiler/runtime is fast but
concurrent primitives weren't added until FORTRAN03, and recursion wasn't
fully supported until FORTRAN90 [1]. It hides almost all the implementation
details from the programmer.

Fortran is a really good language for number crunching. Academics who don't
know how to code can build very fast number crunching tools without really any
CS or hardware knowledge. This the target use case and target audience.

If you want to do low level system things with it, it'll be painful.

[1] Some fortran70 compilers had limited support for recursion it wasn't added
to the official language standard until 20 years later tho.

~~~
colechristensen
>The issue is what you give up.

This is the feature, not a bug. The purpose of fortran and why it is a fast
efficient tool for scientists to write software is is exactly that it hides
implementation details and is a bad systems language.

It allows you to define the important math parts of your program and hides the
implementation part exactly so the compiler has a lot more power to optimize.

------
jchomali
I am definitely going to try this! Would love to see a bit more about the
creator!

~~~
mapmeld
Thanks! You can find my name on GitHub and Google around to find more info /
e-mail address

------
antidaily
Finally!

------
ha470
An accomplishment, certainly, but...

[http://i.imgur.com/TnQRX6v.gif](http://i.imgur.com/TnQRX6v.gif)

