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

Compile to machine code instead of byte code #497

Closed
wants to merge 1 commit into from

Conversation

yorickpeterse
Copy link
Collaborator

In GitLab by @yorickpeterse on Nov 4, 2022, 24:12

This changes the compiler and VM to compile to machine code, making the VM a runtime library bound to the machine code. Thus the runtime is essentially the libc of Inko.

TODO

  • Port all instructions to runtime functions
  • Port all built-in functions to runtime functions
  • Re-enable the various commented-out tests
  • Implement the new backend using LLVM
    • We'll likely stick with the current memory layout, i.e. floats are always boxed and integers use tagging. This is something I want to change, but it's probably too much work to also combine in this MR. The only viable alternative is fat pointers, and I'm not ready to commit to 128 bits pointers everywhere just yet.
    • Integer and float arithmetic is to be implemented using LLVM, not runtime functions (i.e. a + b translates to similar native code, taking into account tagged pointers)
  • Change the various _INKO intrinsics to use the appropriate native functions
  • Figure out what to do (if anything) with https://gitlab.com/inko-lang/inko/-/issues/295 as part of this work
  • Fix the assembly on Windows, as it currently crashes with an access violation
  • Remove Pointer in favour of typed *const / *mut pointers
  • When producing an increment on a statically known Int or Float, emit a clone instead

@yorickpeterse yorickpeterse added this to the 0.6.0 milestone Mar 15, 2023
@yorickpeterse yorickpeterse added compiler Changes related to the compiler runtime labels Mar 15, 2023
@yorickpeterse

This comment was marked as outdated.

@yorickpeterse

This comment was marked as outdated.

@yorickpeterse

This comment was marked as outdated.

@yorickpeterse
Copy link
Collaborator Author

In GitLab by @yorickpeterse on Nov 14, 2022, 22:35

added 1 commit

  • 3de05ce - Implement some integer operations in C

Compare with previous version

@yorickpeterse
Copy link
Collaborator Author

In GitLab by @yorickpeterse on Nov 15, 2022, 01:26

added 1 commit

  • 445b5a5 - Implement some integer operations in C

Compare with previous version

@yorickpeterse
Copy link
Collaborator Author

In GitLab by @yorickpeterse on Nov 15, 2022, 15:58

added 2 commits

  • 3de05ce - Implement some integer operations in C
  • e0766fd - Refactor MIR result instructions

Compare with previous version

@yorickpeterse
Copy link
Collaborator Author

In GitLab by @yorickpeterse on Nov 15, 2022, 22:12

added 1 commit

  • d454bb2 - Compile to machine code using LLVM

Compare with previous version

@yorickpeterse
Copy link
Collaborator Author

In GitLab by @yorickpeterse on Nov 16, 2022, 20:36

added 1 commit

Compare with previous version

@yorickpeterse
Copy link
Collaborator Author

In GitLab by @yorickpeterse on Nov 17, 2022, 24:34

added 1 commit

Compare with previous version

@yorickpeterse
Copy link
Collaborator Author

In GitLab by @yorickpeterse on Nov 17, 2022, 22:07

added 1 commit

Compare with previous version

@yorickpeterse
Copy link
Collaborator Author

In GitLab by @yorickpeterse on Nov 18, 2022, 20:42

added 1 commit

Compare with previous version

@yorickpeterse
Copy link
Collaborator Author

In GitLab by @yorickpeterse on Nov 19, 2022, 21:42

added 1 commit

Compare with previous version

@yorickpeterse
Copy link
Collaborator Author

In GitLab by @yorickpeterse on Nov 20, 2022, 20:12

added 1 commit

Compare with previous version

@yorickpeterse
Copy link
Collaborator Author

In GitLab by @yorickpeterse on Nov 21, 2022, 01:44

added 1 commit

Compare with previous version

@yorickpeterse
Copy link
Collaborator Author

In GitLab by @yorickpeterse on Nov 21, 2022, 21:01

marked the checklist item Remove Pointer in favour of typed *const / *mut pointers as completed

@yorickpeterse
Copy link
Collaborator Author

In GitLab by @yorickpeterse on Nov 21, 2022, 22:16

added 1 commit

Compare with previous version

@yorickpeterse
Copy link
Collaborator Author

In GitLab by @yorickpeterse on Nov 22, 2022, 23:36

added 1 commit

Compare with previous version

@yorickpeterse
Copy link
Collaborator Author

In GitLab by @yorickpeterse on Nov 23, 2022, 01:00

added 1 commit

Compare with previous version

@yorickpeterse
Copy link
Collaborator Author

In GitLab by @yorickpeterse on Nov 25, 2022, 24:25

added 1 commit

Compare with previous version

@yorickpeterse
Copy link
Collaborator Author

In GitLab by @yorickpeterse on Nov 25, 2022, 24:37

added 1 commit

Compare with previous version

@yorickpeterse
Copy link
Collaborator Author

In GitLab by @yorickpeterse on Nov 26, 2022, 01:01

added 1 commit

Compare with previous version

@yorickpeterse
Copy link
Collaborator Author

In GitLab by @yorickpeterse on Nov 26, 2022, 21:33

added 1 commit

Compare with previous version

@yorickpeterse
Copy link
Collaborator Author

In GitLab by @yorickpeterse on Nov 27, 2022, 21:46

added 1 commit

Compare with previous version

@yorickpeterse
Copy link
Collaborator Author

In GitLab by @yorickpeterse on Dec 2, 2022, 23:35

added 1 commit

  • 42bbd57 - Tweak passing value types

Compare with previous version

@yorickpeterse
Copy link
Collaborator Author

In GitLab by @yorickpeterse on Dec 11, 2022, 23:39

added 1 commit

Compare with previous version

@yorickpeterse
Copy link
Collaborator Author

In GitLab by @yorickpeterse on Dec 15, 2022, 18:49

added 3 commits

  • 79d3cf1 - Maintain uni types when defining variables
  • 2b53ea7 - Fix various built-in names
  • 16a91cb - Remove std::ffi

Compare with previous version

@yorickpeterse
Copy link
Collaborator Author

In GitLab by @yorickpeterse on Mar 6, 2023, 21:45

added 1 commit

  • ea8047e - WIP: method and mutability bounds

Compare with previous version

@yorickpeterse
Copy link
Collaborator Author

In GitLab by @yorickpeterse on Mar 7, 2023, 02:13

added 1 commit

  • 8b426e0 - WIP: method and mutability bounds

Compare with previous version

@yorickpeterse
Copy link
Collaborator Author

In GitLab by @yorickpeterse on Mar 7, 2023, 20:55

added 1 commit

  • c5355e8 - WIP: method and mutability bounds

Compare with previous version

@yorickpeterse
Copy link
Collaborator Author

In GitLab by @yorickpeterse on Mar 8, 2023, 24:36

added 1 commit

  • e7a6581 - Replace the interpreter with an LLVM compiler

Compare with previous version

@yorickpeterse
Copy link
Collaborator Author

In GitLab by @yorickpeterse on Mar 8, 2023, 20:11

added 1 commit

  • 009b4e1 - Replace the interpreter with an LLVM compiler

Compare with previous version

@yorickpeterse
Copy link
Collaborator Author

In GitLab by @yorickpeterse on Mar 8, 2023, 22:24

added 1 commit

  • 8ac27cc - Replace the interpreter with an LLVM compiler

Compare with previous version

@yorickpeterse
Copy link
Collaborator Author

In GitLab by @yorickpeterse on Mar 9, 2023, 21:15

added 1 commit

  • 7aee06e - Replace the interpreter with an LLVM compiler

Compare with previous version

@yorickpeterse
Copy link
Collaborator Author

In GitLab by @yorickpeterse on Mar 9, 2023, 23:49

added 1 commit

  • 6e5c0e4 - Replace the interpreter with an LLVM compiler

Compare with previous version

@yorickpeterse
Copy link
Collaborator Author

In GitLab by @yorickpeterse on Mar 10, 2023, 20:52

added 1 commit

  • a916b84 - Replace the interpreter with an LLVM compiler

Compare with previous version

@yorickpeterse
Copy link
Collaborator Author

In GitLab by @yorickpeterse on Mar 10, 2023, 22:59

added 1 commit

  • 481ae58 - Replace the interpreter with an LLVM compiler

Compare with previous version

@yorickpeterse
Copy link
Collaborator Author

In GitLab by @yorickpeterse on Mar 11, 2023, 01:12

added 1 commit

  • 435beb1 - Replace the interpreter with an LLVM compiler

Compare with previous version

@yorickpeterse
Copy link
Collaborator Author

In GitLab by @yorickpeterse on Mar 12, 2023, 02:12

added 3 commits

Compare with previous version

@yorickpeterse
Copy link
Collaborator Author

In GitLab by @yorickpeterse on Mar 13, 2023, 19:37

added 1 commit

  • d15a4fc - Replace the interpreter with an LLVM compiler

Compare with previous version

@yorickpeterse
Copy link
Collaborator Author

In GitLab by @yorickpeterse on Mar 14, 2023, 01:09

added 1 commit

  • 692cdeb - Replace the interpreter with an LLVM compiler

Compare with previous version

@yorickpeterse
Copy link
Collaborator Author

In GitLab by @yorickpeterse on Mar 14, 2023, 17:52

added 2 commits

  • 34ac09e - 1 commit from branch master
  • 8197b3e - Replace the interpreter with an LLVM compiler

Compare with previous version

@yorickpeterse
Copy link
Collaborator Author

In GitLab by @yorickpeterse on Mar 14, 2023, 20:25

added 1 commit

  • 2900194 - Replace the interpreter with an LLVM compiler

Compare with previous version

@yorickpeterse yorickpeterse added feature New things to add to Inko, such as a new standard library module and removed runtime labels Mar 15, 2023
@yorickpeterse yorickpeterse modified the milestones: 0.6.0, 0.11.0 Mar 15, 2023
@yorickpeterse yorickpeterse force-pushed the native-compiler branch 3 times, most recently from 9ba4585 to 5d39b8a Compare March 16, 2023 22:26
@yorickpeterse yorickpeterse marked this pull request as draft March 17, 2023 21:23
@yorickpeterse yorickpeterse changed the title Draft: compile to machine code instead of byte code Compile to machine code instead of byte code Mar 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compiler Changes related to the compiler feature New things to add to Inko, such as a new standard library module
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant