lfortran / lfortran/lfortran

Implement assumed-shape arrays (array descriptors)

Open
#176 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C++
Stars
1.2k
Forks
271
Avg merge
1d 2h
Merged PRs (30d)
173

Description

Original issue: https://gitlab.com/lfortran/lfortran/-/issues/50

Here is a nice explanation how gfortran does it:

https://thinkingeek.com/2017/01/14/gfortran-array-descriptor/

struct descriptor_dimension
{
  ptrdiff_t stride;
  ptrdiff_t lower_bound;
  ptrdiff_t upper_bound;
};
 
template <int Rank, typename Type>
struct descriptor {
  Type *base_addr;
  size_t offset;
  ptrdiff_t dtype;
  descriptor_dimension dim[Rank];
};

MR https://gitlab.com/lfortran/lfortran/-/merge_requests/125 shows how to work with structures in LLVM.

MR https://gitlab.com/lfortran/lfortran/-/merge_requests/126 shows how to use GFortran's assumed-shape arrays from another Fortran or C++ compiler.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading the linked explanation of gfortran array descriptors, then review merge requests 125 and 126 for the repository's existing structure and interoperability work. The issue provides no source files or tests; done means implementing assumed-shape arrays using array descriptors as described and validating the relevant Fortran/C++ interoperability behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, fortran
Domain
compilers
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.