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

refactor!: rewrite it in rust #3766

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft

Conversation

scarf005
Copy link
Member

@scarf005 scarf005 commented Nov 27, 2023

Warning

This PR is a proof-of-concept, heavily WIP, and is not the consensus of BN core dev team and/or contributors.

Purpose of change

Sorry for the shill; also this is obligatory.

currently the codebase has its core engine logic, hardcoded behavior and util functions amalgamated together. using rust FFI gives us the improved toolings of rust, such as

Easy dependency management

A wealth of safe and ergonomic libraries are a keyboard's type away (e.g crate add <package>)

Testing

rust's built-in test module makes it easy to write tests.

Describe the solution

  1. setup a simple rust interop using cmake, cxx
  2. extract and rewrite utility modules into rust modules.

TODO: add docs on how it works and migration guide

Describe alternatives you've considered

getting stuck in legacy code purgatory

Testing

image

the program doesn't segfault.

TODO

  • migration
    • url_utility.h
    • name.h
    • language.h
  • docs
  • setup CI/CD
  • merge build systems into cmake

Additional context

  • a lot of help from reading Rewrite it in Rust fish-shell/fish-shell#9512
  • this PR is in no way complete, and will likely be draft for a long time, e.g 6 months.
  • As mentioned earlier, it currently serves no purpose other than POC.
  • This approach only works on CMake, thus CMake migration must be done first to support other platforms such as windows/mac/android.

also rewrite `url_utility` for smoke test
@github-actions github-actions bot added the src PR changes related to source code. label Nov 27, 2023
@chaosvolt
Copy link
Member

I am going to screm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
src PR changes related to source code.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants