Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

C runtime #1554

Closed
lukaszcz opened this issue Sep 28, 2022 · 0 comments · Fixed by #1580
Closed

C runtime #1554

lukaszcz opened this issue Sep 28, 2022 · 0 comments · Fixed by #1580
Assignees
Labels
Milestone

Comments

@lukaszcz
Copy link
Collaborator

lukaszcz commented Sep 28, 2022

Basic version of the C runtime necessary to run compiled Juvix programs.

Runtime components

  • Page allocator.
    • Manages allocation and deallocation of pages (64K by default), resorting to direct memory allocation from the OS / WebAssembly when needed.
  • Object allocator.
    • Manages allocation of objects (constructors, boxed integers, etc).
    • Uses the page allocator to obtain more memory pages.
  • Global call stack.
    • Functions for manual management of the call stack.
  • Function call interface.
    • Macros for calling functions, saving & restoring live variables, allocating & extending closures.
    • Trampoline (dispatch loop) to implement JuvixAsm CallClosures.
  • Memory access interface.
    • Macros for accessing constructor tag & fields, temporary variables & function arguments.
  • Integers implemented by unboxed 31 bit ints, at first without overflow check.
  • Structural equality on runtime values.
  • Static storage of information about functions and constructors (e.g. for pretty-printing).
  • Pretty-printing of runtime values.
  • Error handling (stacktraces).
  • Interpreter for IO actions.

Literature

@lukaszcz lukaszcz added this to the 0.3 milestone Sep 28, 2022
@lukaszcz lukaszcz self-assigned this Sep 28, 2022
@lukaszcz lukaszcz mentioned this issue Oct 6, 2022
20 tasks
@paulcadman paulcadman modified the milestones: 0.3, 0.2.7 Oct 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants