Extend partial evaluator with common functions on arrays and (row)vectors
Nobody has claimed this yet.
- Dominant language
- OCaml
- Stars
- 160
- Forks
- 59
- Avg merge
- 21h 45m
- Merged PRs (30d)
- 26
Description
It would be useful to add support for statically evaluating functions like size, dims, num_elements, max, min, rows, cols when called on array, vector and row-vector expressions like
{4, 2, 1}
and
[123, 2, 46, 3].
Such functions are used, for example, to determine sizes of containers in Rstanarm, so it would be useful to be able to statically evaluate them in order to
- generate more efficient code for Rstanarm
- auto-generate datasets for testing Rstanarm.
A smarter implementation of this would even be able to evaluate dimensions and lengths of many containers that are not array or row_vector expressions: the sizes should often be stored in the type information. We can use a possibly_sized_type for this.
We can even evaluate indexed row_vector and array expressions.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the partial evaluator and its handling of array, vector, and row-vector expressions. Trace how the listed functions—size, dims, num_elements, max, min, rows, and cols—are represented and evaluated for the examples in the issue. Done means these functions can be statically evaluated for the stated expressions, with indexed expressions and type-based sizes considered as scope allows.
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
- Mostly clear
- Newbie friendliness
- 35/100