This repository has been archived on 2024-05-26. You can view files and clone it, but cannot push or open issues or pull requests.
Go to file
Benedikt Peetz 61a62ed379
fix(example/main): Update to use the new result type
2024-05-20 15:21:45 +02:00
c_test fixup! docs(c_test): Add a poc regarding results in c 2024-05-20 15:15:07 +02:00
docs docs(grammar.pdf): Regenerate with new landscape ebnf2pdf script 2024-05-19 14:05:34 +02:00
example/main fix(example/main): Update to use the new result type 2024-05-20 15:21:45 +02:00
scripts
src feat(src): Add real and working support for results 2024-05-20 15:19:11 +02:00
tests tests(error_derive): Init 2024-05-19 14:02:12 +02:00
.envrc
.gitignore fix(gitignore): Don't ignore the `Cargo.lock` file 2024-05-04 10:22:46 +02:00
.licensure.yml
COPYING
COPYING.LESSER
Cargo.lock build(treewide): Update 2024-05-19 13:51:17 +02:00
Cargo.toml build(treewide): Update 2024-05-19 13:51:17 +02:00
LICENSE.spdx
NEWS.md chore(version): v0.1.0 2024-05-04 10:24:33 +02:00
README.md
cog.toml chore(version): v0.1.0 2024-05-04 10:24:33 +02:00
flake.lock build(treewide): Update 2024-05-19 13:51:17 +02:00
flake.nix build(treewide): Update 2024-05-19 13:51:17 +02:00
update.sh build(update.sh): Don't always perform the expensive `upgrade` 2024-05-19 14:06:04 +02:00

README.md

Trixy

A crate to generate a multi-language foreign function interface.

Features

  • Support for custom types, derived from a set of primitive types.
  • Support for callbacks, thought c function pointers.
  • Support for error handling, when checking a functions arguments (NULL pointer and such things).

Supported languages:

  • c

Dependencies

Trixy only needs:

  • clang-format to format the generated c header files.

The Trixy Language

The API to generate is specified in a Trixy file. The language of these files is an subset of rust and should thus be easy to learn and pick up.

A grammar file is provided here encoded in Extended Backus-Naur Form. The grammar file is rendered as railroad diagrams in PDF here, run ./docs/generate_docs to regenerate the PDF file.

Testing

Trixy contains integration tests in the ./tests directory. These are maintained with the ./scripts/tests.sh script. Take a look at it's --help output for further usage information.

This crate also contains a binary, which can help with manual testing and inspecting of the generated AST. The cargo run --features 'build-binary' -- --help output should provide all required information.

Tests are (as of now) only positive, i.e. they can only test successful situations. Failing test will probably be supported in the future.

Contributing

We have a nix flake, which provides the required dependencies to work with Trixy and the associated scripts in the ./scripts directory.

Please also make sure to run the ./scripts/renew_copyright_header.sh after you added a new file, to ensure that every file contains a license header.