Giter VIP home page Giter VIP logo

Comments (10)

everythingfunctional avatar everythingfunctional commented on July 25, 2024

Right now, if you want multiple executables you have to specify them manually. I'm open to enabling some auto-detection of multiple executables. I'll put together an outline of what that would look like.

from fpm.

certik avatar certik commented on July 25, 2024

from fpm.

LKedward avatar LKedward commented on July 25, 2024

I actually much prefer app to src/bin. In my mind a bin directory is for binary files only, not source code.

from fpm.

certik avatar certik commented on July 25, 2024

from fpm.

everythingfunctional avatar everythingfunctional commented on July 25, 2024

The app, src separation makes it much easier to determine what should be packaged up into the library, and what is just for use in executable(s). I also makes finding the executable(s) a bit simpler for the automatically detected case. If we switch to the src/bin approach I'll need to special case out of searching that directory when building the library.

from fpm.

certik avatar certik commented on July 25, 2024

I see, good point. Are we still doing src/main.f90 to mean an executable? If so, then you have to special case this anyway.

from fpm.

milancurcic avatar milancurcic commented on July 25, 2024

I think we should aim to minimize special cases in the UI, and implement accordingly. A good test for this is asking what design leads to the simplest user guide.

For example, if everything in src is considered a library component except src/main.f90 and src/bin/*.f90, then these are special cases that require additional clauses in the documentation.

On the other hand, app for programs and src for library is simplest to explain to a user, and is currently my favorite solution.

An even simpler UI than this (to explain to a user) is to have program files be programs, and module files be modules, regardless of where they are in the tree. However this complicates implementation because now fpm needs to parse the sources. A downside is that now there may not be clear separation between programs and module files if the user is just looking at the source tree. However if you have app and src, it's clear.

We should study Rust+Cargo model in detail, but we shouldn't assume that it's the optimal solution for us. This could be because of Rust's own history of the project, or because Rust and Fortran are different languages and have different cultures.

I agree with @LKedward about app vs bin.

from fpm.

certik avatar certik commented on July 25, 2024

Good points. Note that fpm has to parse the sources anyway to determine module dependencies and to enforce that each module name is named appropriately.

So looks like the most natural solution so far is:

  • src contains module files (or loose procedures / function --- we should not encourage it, but some existing projects do that and I think we can incorporate this without harm). Everything in src gets built into a library.
  • app, contains programs. Perhaps app/main.f90 could be the main program (by default executed by fpm run).
  • tests contains tests
  • bench contains benchmarks (we can do this one later perhaps --- although most of my projects contain some kind of benchmarks which are distinct from apps and distinct from tests)

from fpm.

everythingfunctional avatar everythingfunctional commented on July 25, 2024

I see, good point. Are we still doing src/main.f90 to mean an executable? If so, then you have to special case this anyway.

No, I didn't implement src/main.f90 to be an executable. If it sees that it will expect it to be a module named main.

from fpm.

LKedward avatar LKedward commented on July 25, 2024

Closing as this is now implemented.

from fpm.

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.