Skip to content
This repository was archived by the owner on Aug 2, 2019. It is now read-only.
This repository was archived by the owner on Aug 2, 2019. It is now read-only.

Native Interface (super issue) #24

@wks

Description

@wks

This is an outline of issues related to the native interface, that is, interacting with the native world. This topic includes but is not limited to object layout, pointer types, object pinning and foreign function calls. We should open other issues to discuss concrete problems.

  • Make a platform-specific Mu specification
  • Type system: (Extra types for the Native Interface #34)
    • Raw pointer types
    • Structure types with native/explicit object layout
    • Union types (unlikely to have in Mu)
    • Mapping Mu types to C types and native object layout: (in the Native Interface chapter in the spec)
  • Memory space beyond heap/stack/global
    • Memory spaces with various constraints
      • Is it movable, pinnable, has reference, can be referenced to, GC-traced, GC-collected, ...?
    • Object pinning: Object Pinning #28
      • If object pinning is allowed, what does "pin" mean?
  • Foreign function interfaces
    • Calling foreign functions from Mu: (The CCALL instruction. See the spec)
      • Calling C functions
      • System calls
    • Calling back to Mu from foreign functions: Call-back from native to Mu #39
      • From C functions
      • Signal handling

The following should be addressed by a higher-level abstraction:

  • Loading native libraries
    • The client loads libc and finds the address of dlopen, dlsym, dlclose and dlerror. Then the CCALL instruction takes care of the rest by calling them.
  • Loading "heavier-weight" Mu bundles (currently called MuLF): Mu Loadable Format (MuLF) #30

The following are not related to the native interface, but are related to raw memory:

  • How to expose the address of objects so that the user can analyse the memory behaviour? (This involves profiling, too. We may open a dedicated issue for profiling.)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions