Skip to content

Explanation of PreInitialization, Language Instance, Contexts in the TruffleRuby language implementation #2323

Answered by eregon
petenorth asked this question in General
Discussion options

You must be logged in to vote

I'm sorry for the late answer, I missed this, the Slack GitHub plugin finally added support for Discussions.

It would be good if there was a high level explanation of when new RubyContexts and RubyLanguage instances are created.

A RubyContext is an execution context / isolate, e.g. each execution context has its own independent state, for instance its own set of global variables, constants, classes, etc.
The only objects which are/cam be shared between contexts are deeply immutable objects like Symbols, frozen string literals, nil, true, false, Regexps, Integers, Float, etc.

A RubyLanguage is what holds onto these are deeply immutable objects and on the AST, so on the representation of …

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by eregon
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants