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

Full C calling convention #186

Closed
raviqqe opened this issue Aug 18, 2021 · 1 comment
Closed

Full C calling convention #186

raviqqe opened this issue Aug 18, 2021 · 1 comment
Labels
enhancement New feature or request

Comments

@raviqqe
Copy link
Owner

raviqqe commented Aug 18, 2021

Problems

  • High-level programming languages have FFI compatible with C calling convention and ABI.
  • If F-- is used as backend, people need to implement those by themselves as the LLVM backend doesn't implement this properly.
    • struct type arguments are not put on stacks and passed as pointers.
    • Values of struct types are not returned from functions through mutable memory which is allocated on the caller side.
  • In those high-level programming languages, it's also a solution to allocate heap always for struct types although that incurs extra overhead.

Solution

  • Implement C calling convention for the target calling convention.
  • It might make sense to add another c calling convention as the ABI requirements are only required in FFI.

References

@raviqqe raviqqe added the enhancement New feature or request label Aug 18, 2021
@raviqqe raviqqe changed the title C calling convention Full C calling convention Aug 15, 2022
@raviqqe
Copy link
Owner Author

raviqqe commented Oct 16, 2022

Closed by #349.

@raviqqe raviqqe closed this as completed Oct 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant