stan-dev / stan-dev/stanc3

Check sizes/bounds symbolically at compile-time

Open
#225 2 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

optimization
Dominant language
OCaml
Stars
160
Forks
59
Avg merge
21h 45m
Merged PRs (30d)
26

Description

I think we should be able to do some neat bounds checking even though we often only know the sizes of various containers in terms of variables. For example, we could have the compiler alert the user that something like this won't work at compile-time:

data {
  int N;
  vector[N] y;
}
model {
  for (i in 1:N+1) {
    y[n] ~ normal(0, 1);
  }
}

Contributor guide

No contributing guide indexed for this repository

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

No files, tests, or entry points are named. Start by locating the compiler's handling of symbolic container sizes and index bounds, then determine how the example should be diagnosed at compile time and what tests would define the completed behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
ocaml
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.