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

Switch to a native library for driver implementations #43

Closed
alexrp opened this issue Dec 13, 2021 · 5 comments
Closed

Switch to a native library for driver implementations #43

alexrp opened this issue Dec 13, 2021 · 5 comments
Labels
area: build Issues related to the build system. area: drivers Issues related to the terminal drivers. area: io Issues related to core terminal I/O. area: samples Issues related to the sample projects. area: signals Issues related to terminal signal handling.
Milestone

Comments

@alexrp
Copy link
Member

alexrp commented Dec 13, 2021

This would have a number of benefits:

  • Some unfixable race conditions relating to signals (e.g. SIGCONT) will be resolved.
  • No more duplicated code between Linux and macOS.
  • Significantly reduced metadata size from removing P/Invoke declarations.
  • Faster managed builds and editing as CsWin32 will no longer be needed.
  • Easier porting to new platforms.

The native library would probably be written in Zig or C. For this to be as painless as possible, we would need vezel-dev/zig-sdk#8 (and by extension dotnet/sdk#19929) to be implemented first.

@alexrp alexrp added type: feature state: approved Enhancements and tasks that have been approved. area: build Issues related to the build system. area: drivers Issues related to the terminal drivers. labels Dec 13, 2021
@alexrp alexrp self-assigned this Dec 13, 2021
@alexrp alexrp added state: blocked Issues that are blocked on some other issue or work. and removed state: approved Enhancements and tasks that have been approved. labels Dec 17, 2021
@alexrp alexrp added this to the v2.0 milestone Dec 20, 2021
@alexrp alexrp modified the milestones: v2.0, v3.0 Oct 28, 2022
@alexrp
Copy link
Member Author

alexrp commented Jan 22, 2023

Experience from Celerity and Ruptura shows that this should be fairly straightforward to do even in the short term.

The main annoyance will be working around dotnet/sdk#19929. We need to package the compiled native libraries in runtimes/<rid> folders in the Vezel.Cathode package; we do something similar for analyzers already, so this isn't too hard. We would also need some hacks to include the native libraries when building the sample projects.

@alexrp alexrp modified the milestones: v3.0, v1.0 Jan 22, 2023
@alexrp
Copy link
Member Author

alexrp commented Jan 22, 2023

(The native library will be written in C initially and ported to Zig once Zig reaches 1.0.)

@alexrp alexrp added state: approved Enhancements and tasks that have been approved. and removed state: blocked Issues that are blocked on some other issue or work. labels Jan 29, 2023
@alexrp alexrp changed the title Long term: Switch to a native library for driver implementations Switch to a native library for driver implementations Mar 17, 2023
@alexrp
Copy link
Member Author

alexrp commented Dec 14, 2023

This will run into the same problem as vezel-dev/celerity#101. Or not.

@alexrp alexrp added state: blocked Issues that are blocked on some other issue or work. state: approved Enhancements and tasks that have been approved. and removed state: approved Enhancements and tasks that have been approved. state: blocked Issues that are blocked on some other issue or work. labels Dec 14, 2023
@alexrp
Copy link
Member Author

alexrp commented Jan 4, 2024

This will mean temporarily dropping support for musl-based systems (e.g. Alpine) due to vezel-dev/zig-sdk#83, but that's probably not the end of the world. I doubt many people would use Cathode in Docker containers or whatever.

@alexrp
Copy link
Member Author

alexrp commented Jan 7, 2024

Turns out I was wrong about SIGCONT; that race condition just cannot be fixed.

https://stackoverflow.com/a/75084598

@alexrp alexrp added area: samples Issues related to the sample projects. area: hosting area: io Issues related to core terminal I/O. area: signals Issues related to terminal signal handling. labels Jan 7, 2024
@alexrp alexrp removed area: analyzers state: approved Enhancements and tasks that have been approved. labels Jan 7, 2024
@alexrp alexrp closed this as completed in d76fb8c Jan 7, 2024
@alexrp alexrp removed their assignment Jan 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: build Issues related to the build system. area: drivers Issues related to the terminal drivers. area: io Issues related to core terminal I/O. area: samples Issues related to the sample projects. area: signals Issues related to terminal signal handling.
Development

No branches or pull requests

1 participant