Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dynamically Sized Arrays v0.1 #328

Closed
16 of 18 tasks
baszalmstra opened this issue May 8, 2021 · 1 comment · Fixed by #341
Closed
16 of 18 tasks

Dynamically Sized Arrays v0.1 #328

baszalmstra opened this issue May 8, 2021 · 1 comment · Fixed by #341
Assignees
Labels
tracking Tracking issue for an epic
Milestone

Comments

@baszalmstra
Copy link
Collaborator

baszalmstra commented May 8, 2021

This is a tracking issue regarding the implementation of dynamically sized arrays.

This reflects the work that is required for an initial release of Mun with array support (arrays v0.1). This will allow the construction and use of arrays but will still miss a lot of essential features to make working with them easier.

Out of scope

Things that are out of scope for this initial v0.1 version:

  • Querying the length of an array
  • Resizing an array
  • Appending to an array

Required work

  • Array types
    Mun must have support for array types so we can pass them around in code.

    • Syntax of array types must be parsable
    • The vscode grammar must be updated to support these types
    • Code generation to handle array types
    • ABI support for array types
    fn identity(arr: [int]) -> [int] { arr }
    
  • Array construction
    Enable the construction of arrays from mun code.

    let a = [1,2,3,4]
    
    • Syntax support for array literals
    • HIR support for array literals including type inferencing
    • Runtime support for allocation of array literals
    • Support arrays in the garbage collector
    • Support hot reloading of arrays.
    • Use arrays through the runtime.
    • Create arrays through the runtime.

    Open questions

    • What and how do we support the hot-reloading of arrays? Which operations are (not) allowed?
  • Array indexing support.

    let a = arr[i]
    arr[i] = 3.0
    
    • Syntax support for array indexing
    • HIR support for array indexing including type inferencing
    • Language server support for array indexing (proper completion in brackets)
    • Code generation for array indexing
@baszalmstra baszalmstra self-assigned this May 8, 2021
@baszalmstra baszalmstra added this to the Mun v0.4.0 milestone May 8, 2021
@baszalmstra baszalmstra added the tracking Tracking issue for an epic label May 8, 2021
@baszalmstra baszalmstra linked a pull request May 8, 2021 that will close this issue
11 tasks
@baszalmstra baszalmstra linked a pull request Jan 23, 2022 that will close this issue
3 tasks
@baszalmstra baszalmstra removed a link to a pull request Jan 23, 2022
11 tasks
@baszalmstra baszalmstra changed the title Dynamically Sized Arrays Dynamically Sized Arrays v1 May 14, 2022
@baszalmstra baszalmstra changed the title Dynamically Sized Arrays v1 Dynamically Sized Arrays v0.1 May 14, 2022
@baszalmstra
Copy link
Collaborator Author

I updated this issue to reflect all the work that I think is required for the first version. I dubbed this arrays v0.1 because it's still missing a lot of features. However, with the work specified above it should become possible to at least use them!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tracking Tracking issue for an epic
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants