mun
mun copied to clipboard
feature: early support for arrays
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
Codecov Report
Merging #341 (8e91402) into main (e14879c) will decrease coverage by
0.06%. The diff coverage is87.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.
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.
Depends on #268
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!
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