modularml / mojo

The Mojo Programming Language
https://docs.modular.com/mojo/manual/
Other
23.28k stars 2.59k forks source link

[BUG] Global memory is not persisted across cells in notebook #232

Open Mogball opened 1 year ago

Mogball commented 1 year ago

Consider two separate cells:

var x: StringLiteral = "abcd"
print(x)

An empty string is printed, because string literals contain pointers to global memory, which are probably not getting persisted between cells as appropriate.

I'm not certain what the solution is: whether all global memory needs to be persisted or this is simply considered unsupported behaviour.

walter-erquinigo commented 7 months ago

Proper global memory handling should fix https://github.com/modularml/mojo/issues/638