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

extend obsidian with structure types #307

Closed
4 of 6 tasks
ivoysey opened this issue Mar 29, 2021 · 1 comment
Closed
4 of 6 tasks

extend obsidian with structure types #307

ivoysey opened this issue Mar 29, 2021 · 1 comment
Assignees
Milestone

Comments

@ivoysey
Copy link
Collaborator

ivoysey commented Mar 29, 2021

Original Description

A possible approach:

contract Foo {
   int x;
}

transaction t1() {
   Foo f = new Foo(42); // allocate space on a heap somewhere 
   f.x // looks in memory for x
   return f;
}

transaction t2() {
   Foo f = new Foo(42); // Want Foo to be allocated cheaply
   f.doStuff();
   // If f is owned AND there are no unowned aliases, want f to be freed here
}

If you assign a reference to a heap-allocated object to a field of a contract, then the object must be migrated to storage. At the end of the transaction, sweep the fields and move objects from memory to storage as needed.

Update

As of EOB on 6 August, here are some things that are different between our output and the analagous solc output that need to get addressed:

  • the output yul contains repeated objects and oddly duplicated ones, like x_deployed_deployed. this is because of the way that YulObject invokes the printer in a way that i don't quite understand. it's both redundant and is wrong enough to break solc.
  • we emit code like set(value : u256); type annotations are in the spec but not accepted by solc right now
  • write a bug report for the above in solc
  • the dispatch table needs to get rewritten so that it can handle functions that take arguments.
  • we have a lot of excess boiler plate (see clean up boilerplate generation #333, but also specific to the working example)
  • there are literal tab characters in the output rather than all spaces; i do not know how they get there, but they make it hard to reformat the file and read it. (it's fine for functionality in that it doesn't break solc but it is not ergonomic for working on the code)

This list is not exhaustive.

@ivoysey
Copy link
Collaborator Author

ivoysey commented Dec 1, 2021

This task has been broken down into enough smaller parts that the monolithic issue no longer really makes sense. Parts of it have been addressed and others are either small fixes that aren't on the critical path or no longer in scope. I'm going to close it to clean up the board instead of keeping it around kind of inactive forever.

@ivoysey ivoysey closed this as completed Dec 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants