Skip to content

Instantly share code, notes, and snippets.

@gerdr
Created September 18, 2012 10:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gerdr/3742384 to your computer and use it in GitHub Desktop.
Save gerdr/3742384 to your computer and use it in GitHub Desktop.
How many levels of indirection are necessary to implement Perl6 container semantics?

How many levels of indirection are necessary to implement Perl6 container semantics?

This is based on reading the spec and not looking at implementations.

  • lexical environment -> container

Perl6 features custom containers. In principle, the container could be inlined into the environment as its type is known statically. Another way to do this would be to always inline the default container and add a member referencing the custom one.

  • container -> container storage

Perl6 supports aliasing on the container level. However, in principle we cannot reuse the same container as they could come with different constraints on types or readability; binding containers thus can't share the container itself, but rather their storage only. It is unclear how the runtime ensures that assigment will satisfy all constraints. One way to do this is to add constraints to container and container storage both.

  • container storage -> object

While the container storage could hold primitive types (Java-speak) directly, object types will only be referenced.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment