codewars / codewars-runner-cli

Old CodeRunner project. See https://github.com/codewars/runner instead.
GNU Affero General Public License v3.0
402 stars 141 forks source link

Update gfortran to support features from newer standards #768

Closed kazk closed 4 years ago

kazk commented 5 years ago

Need to update gfortran. Also use .f90 for file extension.


Request posted on Codewars:

Technetium_Phenol

It would be great if codewars incldued newer versions of Fortran, such as Fortran 2003/2008, which include more object oriented features and add more flexibility to the language.

Its been chalengnig to do the Fortran katas because very few people code in Fortran 95, or at least 90% of their code uses Fortran 95, while taking advantage of some of the newer Fortran 2003 features. (I often find code I write is rejected my the compiler because it does not work well with the compiler, even though it works fine on my computer).


:+1: reaction might help.

ScottBoyce commented 5 years ago

Haha, you are finally making me break down and get a GitHub account. I have been avoiding version management for years. Its the upside of being a sole developer that can keep track of versioning in my head ;)

I have to learn this in the coming year because my agency is requiring me to start using git for all my software projects.

--Technetium_Phenol

kazk commented 4 years ago

I'm working on gfortran 9 support (had it half completed for a month). I'll add a new language version that uses -std=f2008 -fall-intrinsics.

-fall-intrinsics This can be useful with -std=f95 to force standard-compliance but get access to the full range of intrinsics available with gfortran. https://gcc.gnu.org/onlinedocs/gfortran/Fortran-Dialect-Options.html

This should resolve the downside of using -std= you mentioned about not being able to use functions like RANDOM_NUMBER.

I believe it's better to force standardized Fortran for learning purposes. I'll keep the version without any flags for now for existing kata.

There's 2 kata that seems to fail with gfortran 9 (without any flags), but Fortran is still considered beta on Codewars so I'm going to do the update ignoring them.

kazk commented 4 years ago

Codewars now supports GFortran 9 with -std=f2008 -fall-intrinsics.

Existing kata except for these two that crashes have it enabled:

Voileexperiments commented 4 years ago

Both katas have been updated.

kazk commented 4 years ago

Awesome, thanks!