Skip to content

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
    • Help
    • Support
    • Submit feedback
    • Contribute to GitLab
  • Sign in
G
general-issue-tracker
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 47
    • Issues 47
    • List
    • Boards
    • Labels
    • Milestones
  • Merge Requests 0
    • Merge Requests 0
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
  • Analytics
    • Analytics
    • CI / CD
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • mu
  • general-issue-tracker
  • Issues
  • #36

Closed
Open
Opened Jun 23, 2015 by John Zhang@u5157779
  • Report abuse
  • New issue
Report abuse New issue

Metacircular Client Interface

Created by: wks

It has been proposed long ago that "everything the API can do should also be possible in the Mu IR".

This issue maintains a checklist of features not in the Mu IR. These functions should be gradually added to the IR.

Features in the API but not the IR:

  • bundle loading
  • stack introspection: current_func_ver, current_instruction, dump_keepalives
  • OSR: pop_frame, push_frame
  • Handle traps and undefined functions in Mu IR. It depends on how the Mu VM itself is implemented.
  • Handle watchpoint in Mu IR: an instruction which is a no-op when disabled, but a (maybe limited kind of) Mu function call when enabled.

Things that can be done dynamically via handles in the API, but can only be done statically in the IR. I am not sure how dynamic Mu should be, or need to be, because some of the items below can be worked around with some Mu IR code, such as maintaining a hash table implemented in Mu IR, or writing wrapper functions.

  • Opaque handle type: a handle that holds any Mu value. ref<T> can be a candidate for this purpose.
  • Getting a Mu constant value (including constants, globals and functions) by its ID. This is a kind of introspection.
    • This can be done with a type argument: %c = GET_CONST <@T> %id, %c is a @T
    • Or return a handle: %ch = GET_CONST_H %id, %ch is a ref<void>
  • Creating Mu heap objects by a type ID.
  • Calling a Mu function (or constructing a Mu frame) with both the callee and the arguments as handles. This allows calling a Mu function with a run-time-determined arity and arg types.
  • Dump keepalive variables.
    • This can be done with a type argument: %sixth_ka = GET_KEEPALIVE <@T> %frame 6
    • or return handle: %sixth_ka_handle = GET_KEEPALIVE_H %frame 6
  • Discussion
  • Designs
Assignee
Assign to
None
Milestone
None
Assign milestone
Time tracking
None
Due date
None
0
Labels
None
Assign labels
  • View project labels
Reference: mu/general-issue-tracker#36