rune icon indicating copy to clipboard operation
rune copied to clipboard

Before releasing 0.14

Open udoprog opened this issue 1 year ago • 0 comments

The following are items which are planned to be done for the 0.14 release:

Change execution model

  • [x] Structurally shared values #663
  • [x] Use a slot-based virtual machine #733

Every any value should be reference counted to allow for more complex compile-time optimizations to be valid, such as pattern optimizations below.

This can eventually be opted-out of through Gradual typing.

Support traits

  • [x] Add support for traits at the context level which can be accessed in bindings through trait objects. #774
  • [x] Make Iterator into a trait implementation rather than the hack it is today. #774

Direct arguments and -O function-body=true

  • [ ] Implement #777
  • [ ] Add the ability to set "globals", for function-body=true these are simply hidden arguments.

This allows scripts of rune to be run directly without having to wrap the entrypoint in an fn main() { <body> }.

Implement basic pattern optimizations

  • [ ] First implementation.

If the compiler can prove that an irrefutable pattern like this is used:

let (b, a) = (a, b);

This will not generate any instructions, instead the assigned slots for the names a and b will simply be swapped.

Note that because of the new memory model in git, this will be supported through arbitrarily complex patterns.

let a = 42;
let b = 84;
let object = #{ a, b };
let (a, #{ a: b, b: c }) = (10, object);

This could essentially be translated to:

let a = 10;
let b = 42;
let c = 84;
let object = #{ a: b, b: c };

Other

  • Formalise drop orders #778

udoprog avatar Jul 23 '24 13:07 udoprog