mun icon indicating copy to clipboard operation
mun copied to clipboard

feature: early support for arrays

Open baszalmstra opened this issue 4 years ago • 4 comments

Adds support for arrays.

Missing feature:

  • [ ] Hotreloading of arrays and types in arrays: https://github.com/baszalmstra/mun/pull/20
  • [x] Using arrays from the runtime
  • [ ] Documentation in the form of a book entry

Out of scope

  • Adding and removing entries
  • Querying the length

baszalmstra avatar Jul 25 '21 15:07 baszalmstra

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%) :arrow_down:
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%) :arrow_down:
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.

codecov[bot] avatar Aug 22 '21 18:08 codecov[bot]

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 avatar Aug 25 '21 17:08 baszalmstra

Depends on #268

baszalmstra avatar Jan 23 '22 14:01 baszalmstra

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.

It took almost a year, but this is now possible in this branch!

baszalmstra avatar Jul 10 '22 16:07 baszalmstra

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

Wodann avatar Nov 18 '22 04:11 Wodann