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

feat: early support for arrays #341

Merged
merged 52 commits into from
Dec 8, 2022
Merged

Conversation

baszalmstra
Copy link
Collaborator

@baszalmstra baszalmstra commented Jul 25, 2021

Adds support for arrays.

Missing feature:

Out of scope

  • Adding and removing entries
  • Querying the length

@baszalmstra baszalmstra added the type: feat New feature or request label Jul 25, 2021
@baszalmstra baszalmstra added this to the Mun v0.4.0 milestone Jul 25, 2021
@baszalmstra baszalmstra self-assigned this Jul 25, 2021
@baszalmstra baszalmstra mentioned this pull request Jul 25, 2021
11 tasks
@codecov
Copy link

codecov bot commented Aug 22, 2021

Codecov Report

Merging #341 (8e91402) into main (e14879c) will decrease coverage by 0.06%.
The diff coverage is 87.49%.

@@            Coverage Diff             @@
##             main     #341      +/-   ##
==========================================
- Coverage   87.16%   87.09%   -0.07%     
==========================================
  Files         271      275       +4     
  Lines       29356    31046    +1690     
==========================================
+ Hits        25588    27040    +1452     
- Misses       3768     4006     +238     
Impacted Files Coverage Δ
crates/mun_abi/src/lib.rs 96.36% <ø> (ø)
crates/mun_codegen/src/intrinsics/macros.rs 100.00% <ø> (ø)
crates/mun_codegen/src/ir.rs 38.02% <ø> (ø)
crates/mun_codegen/src/value/mod.rs 62.80% <ø> (-2.48%) ⬇️
crates/mun_hir/src/item_tree.rs 85.09% <ø> (ø)
crates/mun_hir/src/ty/op.rs 95.65% <ø> (ø)
crates/mun_memory/src/gc.rs 85.71% <ø> (ø)
crates/mun_memory/src/lib.rs 50.00% <ø> (ø)
crates/mun_memory/src/type/ffi/pointer.rs 80.83% <ø> (-8.34%) ⬇️
crates/mun_runtime_capi/src/gc.rs 100.00% <ø> (ø)
... and 69 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@baszalmstra
Copy link
Collaborator Author

I would really like to support creating arrays from a Rust iterator. Something like:

let mun_array: ArrayRef = runtime.construct_array::<i32>(vec![1,2,3,4,].into_iter())

However, this requires type references, because the type information of the array cannot be created. The type information has to be created and shared with the mun libraries. This requires type references.

@baszalmstra
Copy link
Collaborator Author

Depends on #268

@baszalmstra baszalmstra linked an issue Jan 23, 2022 that may be closed by this pull request
18 tasks
Copy link
Collaborator

@Wodann Wodann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Last comments :)

crates/mun_memory/src/gc.rs Show resolved Hide resolved
crates/mun_memory/src/gc/mark_sweep.rs Outdated Show resolved Hide resolved
crates/mun_memory/src/gc/mark_sweep.rs Show resolved Hide resolved
crates/mun_memory/src/gc/mark_sweep.rs Outdated Show resolved Hide resolved
crates/mun_runtime/src/lib.rs Outdated Show resolved Hide resolved
crates/mun_runtime/tests/arrays.rs Show resolved Hide resolved
@Wodann
Copy link
Collaborator

Wodann commented Nov 18, 2022

For the rocket and spaceship logic, can all of tr updates not just happen in Mun? In theory, we only need to query their positions from Rust to draw them

@baszalmstra baszalmstra marked this pull request as ready for review December 5, 2022 18:39
@Wodann Wodann changed the title feature: early support for arrays feat: early support for arrays Dec 5, 2022
@baszalmstra baszalmstra merged commit 37c2054 into mun-lang:main Dec 8, 2022
baszalmstra added a commit that referenced this pull request Dec 8, 2022
Adds early support for arrays in Mun!

Co-authored-by: Wodann <Wodann@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: feat New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Dynamically Sized Arrays v0.1
2 participants