Giter Club home page Giter Club logo

Comments (14)

kytrinyx avatar kytrinyx commented on September 2, 2024 2

@zbeekman Thank you so much for jumping in here, your experience and background are much needed and very welcome!

I think the largest overlap with Fortran programmers and some other language is likely to be one of C,C++, or Python.

This is the best argument, as far as I can tell, for using C, C++, or Python. If Fortran programmers are interested in helping out with the track, I'd love to have tooling in a language that they're familiar with so that the barrier to jumping in and fixing it is low.

No promises, but, would love to see more mainstream Fortran resources.

Likewise!

modern Fortran is 1) A parallel, PGAS language thanks to Coarrays and 2) fully object oriented if you choose to use the new language features.

I'd love to have this emphasized in the "about" documentation for the track.

Did you check the weather today before you got dressed? If so then you've already used Fortran, and it's had a very real, immediate impact on your day to day life.

You said this in another issue, and it's such a great statement. This might be the best opening (ever) for the about documentation.

from fortran.

kytrinyx avatar kytrinyx commented on September 2, 2024

Those are some pretty significant cons! Thanks for investigating this.

from fortran.

sentientmonkey avatar sentientmonkey commented on September 2, 2024

Thanks - going to keep implementing exercises today in funit for now until a better alternative is found.

This seems to be a good overview of the problems and options in Fortran unit testing frameworks. Ultimately, because Fortran doesn't have reflection, another language is typically used to generate a Fortran test runner, which can be implemented in Fortran.

Given the goals of exercism and not wanting to install additional languages to work on the exercises (which is the right approach), the existing options don't seem great. I might prototype out something similar to the existing options, but implemented as a simple binary that can easily be packaged and distributed to users.

That leaves the following language options IMHO:

  • Fortran
  • C / C++
  • mruby
  • Go
  • Rust

Given that I still don't know Fortran, implementing in the language itself might be rough. C/C++ is fine but not exactly something I'm excited about. Mruby could be cool, but last I tried the built toolchain is still kinda gnarly. I'm still a bit too table-flippy in Rust to be productive, so I think that leaves Go (which is a good fit for exercism anyway). The test driver will still be implemented Fortran, but the driver generator and test file parser will be in Go.

I'm open to any thoughts/feedback from anyone interested. 😄

from fortran.

kytrinyx avatar kytrinyx commented on September 2, 2024

I think either Go or Rust would be the best bet. We have people who are actively involved in Exercism who know one or the other or both—both contributors and maintainers.

from fortran.

zbeekman avatar zbeekman commented on September 2, 2024

Hi @sentientmonkey and @kytrinyx!

I don't know Go or Rust, but I DO know Fortran, and this project has peaked my interest. I am one of the developers of OpenCoarrays which is the official distributed shared memory runtime for GFortran. I also started the informal, and poorly documented Fortran F/OSS Programmers group.

I used to use FUnit in the past, but now I typically use CMake/CTest for my testing needs, but this is far less than ideal in most cases. One of the biggest PITA with Fortran is the compilation order for source files due to the non-standard binary module file format. (.mod files are kinda/sorta like precompiled headers.... but unfortunately, you can't even perform a successful syntax check unless you process the files in the correct order.)

In my opinion, this means that a build system with autmomatic dependency resolution is a must. In my opinion, the most robust and cross platform solution is CMake. It has first class Fortran support, but it is a complicated beast. You could potentially use the test harness/automation capabilities for CMake if you use ISO_C_BINDING and/or write wrappers in Fortran that maps arguments to/from ISO_C_BINDING types. I have done this in the past, but it's been a while, so I'll need to refresh my memory.

Another potential is FoBiS.py. Stefano, is a very nice and responsive guy. (Although I think he needs to rephrase/fix some of his talk about "Fortran poor people"... but anyway, I digress) FoBiS.py has automatic dependency resolution, and has added the ability to write "doc-tests" in the most recent release.

As far as languages go, I think the largest overlap with Fortran programmers and some other language is likely to be one of C,C++, or Python.

Anyway, I'm going to take a look at what you have now, and think about what needs to happen to get this up and running. No promises, but, would love to see more mainstream Fortran resources. We do have a burgeoning community of open source tools, libraries and utilities on GH, and modern Fortran is 1) A parallel, PGAS language thanks to Coarrays and 2) fully object oriented if you choose to use the new language features.

from fortran.

zbeekman avatar zbeekman commented on September 2, 2024

For anyone who wants to have a play with modern Fortran & Coarrays, I have a Jupyter kernel, that you can use in the cloud with Binder: https://bit.ly/CAF-Binder. Anyway I know you've got a lot on your plate, @kytrinyx, as do I so I'll probably refrain from posting again today, but I hope to find some time to help you guys get this off the ground.

FYI, I found exercism thanks to the GH post about Open Source Friday

from fortran.

kytrinyx avatar kytrinyx commented on September 2, 2024

I have a Jupyter kernel, that you can use in the cloud with Binder

Very cool! I wonder if that would make it easier for folks to get started—not sure how easy it is to get the exercises running in the cloud, though, so we'd have to figure that out.

from fortran.

pclausen avatar pclausen commented on September 2, 2024

Hi @kytrinyx , Hi @sentientmonkey

Sorry, for reviving an old thread....

I have been working with Fortran for 13 years and I would like to help out. I cloned the repo and Funit was a bit of a stumble block for me. I know C++, Python, Perl, ... but Ruby is not one of my go-to tools so it took some time figuring out how to even install funit on Windows. For anyone interested I used chocolatey and then ran choco install ruby and then gem install funit which seems to have done the job. I do have IntelFortran, but I thought I would use GFortran for this as it is accessible to all.

Setting FC, CXX and CC to the mingw compiler paths and then running funit I get this error:

:\> c:\tools\ruby25\bin\funit.bat hamming
Traceback (most recent call last):
        8: from c:/tools/ruby25/bin/funit:23:in `<main>'
        7: from c:/tools/ruby25/bin/funit:23:in `load'
        6: from c:/tools/ruby25/lib/ruby/gems/2.5.0/gems/funit-0.12.4/bin/funit:61:in `<top (required)>'
        5: from c:/tools/ruby25/lib/ruby/gems/2.5.0/gems/funit-0.12.4/lib/funit.rb:26:in `run_tests'
        4: from c:/tools/ruby25/lib/ruby/gems/2.5.0/gems/funit-0.12.4/lib/funit.rb:26:in `each'
        3: from c:/tools/ruby25/lib/ruby/gems/2.5.0/gems/funit-0.12.4/lib/funit.rb:28:in `block in run_tests'
        2: from c:/tools/ruby25/lib/ruby/gems/2.5.0/gems/funit-0.12.4/lib/funit.rb:28:in `each'
        1: from c:/tools/ruby25/lib/ruby/gems/2.5.0/gems/funit-0.12.4/lib/funit.rb:33:in `block (2 levels) in run_tests'
c:/tools/ruby25/lib/ruby/gems/2.5.0/gems/funit-0.12.4/lib/funit.rb:33:in `read': no implicit conversion of nil into String (TypeError)

Maybe Windows is not supported(?)

I would second @zbeekman that CMake and CTest seem to be the main place where most Fortran projects go, because Fortran is mostly only used for some inner numerical operations wrapped within C, C++, Python, R, ... or whatever. I did use CMake/CTest some years ago and in a mixed environment (Fortran, C++ on Windows and Linux) CMake/CTest was a very stable and usable tool. The exercism/cpp-guys also use CMake so we would be in good company.

If you are interested I would try to convert some tests into CTests in and see how it goes. It might take some months because I don't have too much time, but i would like to contribute.

It would be good if you could give some feedback if you think CMake/CTest makes sense or if you want to continue with Funit(?)

from fortran.

kytrinyx avatar kytrinyx commented on September 2, 2024

I have been working with Fortran for 13 years and I would like to help out.

That is wonderful!

I thought I would use GFortran for this as it is accessible to all

That's definitely the direction we're hoping to take things in.

Ruby is not one of my go-to tools so it took some time figuring out how to even install funit on Windows.

Yeah, in my opinion Ruby should only be used for the Ruby track. It's a pain to get installed (particularly on Windows), so it raises the bar for contributions in a way that is entirely unhelpful.

I would second @zbeekman that CMake and CTest seem to be the main place where most Fortran projects go

That makes two knowledgable votes. I'd say go for it. I've no experience with Fortran, so should not really be allowed to have an opinion, much less a vote :-) My general guideline for all the tracks is to use the tooling that is common among the people who use the language.

From @sentientmonkey's original post:

Ideally, I want something that allows you to write valid Fortran (so it can by syntax checked first), and requires as minimal setup for a user as possible (i.e. no new languages).

So it sounds like Funit was just one of several possible choices (and with plenty of cons). I'd say let's ditch Funit and go with CMake and CTest.

from fortran.

sentientmonkey avatar sentientmonkey commented on September 2, 2024

I am all for something other than funit! Mostly I went with it first because I'm pretty new to Fortran and not really familiar with what's best to use to unit test it. If CMake/CTest is what's used commonly, I'm down for that route. Do you have any good examples of Fortran unit testing in a project?

Sorry for falling behind on this one - I haven't been doing Fortran at work recently, so this fell a bit on the wayside.

from fortran.

zbeekman avatar zbeekman commented on September 2, 2024

Sorry I haven't been able to (and probably won't be able to) help out with this. Between having joined on as a Homebrew maintainer and all of my other commitments, this is unlikely to float to the top of my priority list any time soon. However, feel free to ping me with questions or if you want me to help out with a piece of the CMake puzzle.

Your comment about 13 years caused me to do some math, and, good lord, I've been writing Fortran since sophmore year of undergrad, since 2004, so for 😬 ~14 years. Where does time go?!

from fortran.

kytrinyx avatar kytrinyx commented on September 2, 2024

having joined on as a Homebrew maintainer

Congrats! I work with a couple of Homebrew maintainers and the pace of that project is staggering! Good luck with your work there :)

from fortran.

zbeekman avatar zbeekman commented on September 2, 2024

from fortran.

pclausen avatar pclausen commented on September 2, 2024

Change to use CMake and CTest has been done so I will close this issue.

from fortran.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.