A method for implementing higher-level instructions by generating and executing corresponding lower-level instructions, the method comprising: receiving one or more higher-level instructions specifying to assign a value of a particular value type to a particular container of a plurality of containers, wherein the particular value type represents a user-defined aggregate type without identity, wherein the plurality of containers represent a data structure for storing local variables and/or an operand stack; generating one or more lower-level instructions that assign the value to the particular container based on applying one or more assignment rules to the one or more higher-level instructions based on the particular value type, including applying an assignment rule that selects between loading, into the particular container, an unboxed representation of the value of the particular value type, or a reference to a second container that holds the value of the particular value type, wherein the plurality of containers is stored in a memory location reserved for a particular thread of a plurality of threads and the second container is external to the plurality of containers in a memory location shared by the plurality of threads; wherein the assignment rule that selects between loading, into the particular container, the unboxed representation of the value, or the reference to the second container that holds the value is based on one or more of: whether the value is immutable, whether the value can fit within the particular container, whether the value exceeds a particular size threshold, or whether another container of the plurality of containers already stores the value; in response to determining to load the unboxed representation of the value in the particular container and determining that the particular container is not able to fit the value, resizing the particular container to fit the value; executing the one or more lower-level instructions; wherein the method is performed under control of an interpreter of a virtual machine by one or more computing devices. receiving one or more higher-level instructions specifying to assign a value of a particular value type to a particular container of a plurality of containers, wherein the particular value type represents a user-defined aggregate type without identity, wherein the plurality of containers represent a data structure for storing local variables and/or an operand stack; generating one or more lower-level instructions that assign the value to the particular container based on applying one or more assignment rules to the one or more higher-level instructions based on the particular value type, including applying an assignment rule that selects between loading, into the particular container, an unboxed representation of the value of the particular value type, or a reference to a second container that holds the value of the particular value type, wherein the plurality of containers is stored in a memory location reserved for a particular thread of a plurality of threads and the second container is external to the plurality of containers in a memory location shared by the plurality of threads; wherein the assignment rule that selects between loading, into the particular container, the unboxed representation of the value, or the reference to the second container that holds the value is based on one or more of: whether the value is immutable, whether the value can fit within the particular container, whether the value exceeds a particular size threshold, or whether another container of the plurality of containers already stores the value; in response to determining to load the unboxed representation of the value in the particular container and determining that the particular container is not able to fit the value, resizing the particular container to fit the value; executing the one or more lower-level instructions; wherein the method is performed under control of an interpreter of a virtual machine by one or more computing devices.