Skip to content

More granular inclusions #1746

@LukeLongworth

Description

@LukeLongworth

Kia ora,

Following my seminar on the linear algebra contrib libraries @sangwinc and I got to chatting about the include mechanism. The existing system works fine for me but there are some slightly awkward hurdles:

  • Dependencies between inclusions require me to run several inclusion lines (we avoided this by putting linearalgebra_core.mac into the main installation). This would be worse if there were defined variables (such as return_vect in vectorcalculus.mac) that then required inclusions to happen in a certain order.
  • stack_include is a hammer and sometimes we want a scalpel. Just today I wrote a question in which I used 4 different inclusions to get access to 4 different functions and the load times when compiling spiked noticeably. Being able to include individual functions would avoid this, but keeping every function in a separate file is not feasible.
  • There are some code snippets I copy around all the time that aren't suitable for broader STACK use. For instance, I have a validator I call validate_set_of_vecs which checks that the student has precisely followed the input syntax I need, but that other institutions won't necessarily use. Local inclusion libraries would be wonderful for this and other applications.

Also noted in our brief discussion was that version control will eventually become a hurdle.

Chris's thought before suggesting we move the discussion here was to "develop a stack_depends function [or similar] which would auto-load (once) other libraries from the local contrib".

I recognise that this could be a substantial bit of reworking! I'm mostly curious to hear what other devs think about this sort of project first.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions