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

[tls] Add a single Rust binary (gen-certs) that does the work of the 2 fish scripts #81

Open
nazmulidris opened this issue Dec 2, 2024 · 0 comments · May be fixed by #83
Open

[tls] Add a single Rust binary (gen-certs) that does the work of the 2 fish scripts #81

nazmulidris opened this issue Dec 2, 2024 · 0 comments · May be fixed by #83

Comments

@nazmulidris
Copy link
Owner

nazmulidris commented Dec 2, 2024

Related issue

Rewrite fish scripts

I don't like using fish scripts to do run external commands and perform even simple orchestration of external commands.

An external command is a binary on the OS that can be run on the command line with some arguments.

Here's why:

  • fish is a great shell; I use it & its being rewritten in Rust! However, is not a general purpose programming language. The syntax is confusing and difficult to remember. I don't have confidence in the correctness of the code that I write or read in fish.
    • There are too many strange rules around arguments being empty or formatted as lists, and fundamental confusions like that. Take a look at my fish scripting manual for confusing syntax specifics.
    • This erodes confidence that my intuition about what my script will do, matches what it actually does.
    • It does not have multiple module support, ie, support for many source files that can be reused or even published as binaries or libraries. There is no npm equivalent for fish. To fake using modules ("pseudo modules") it requires too much hacking and erodes further confidence that the script does what I think it does.
  • No debugging.
  • No type checking.
  • No testing.
  • Terrible IDE support for syntax highlighting and auto completions.
  • Copilot gets confused with simple syntax, like matching the value of a variable to a set of string literals.

This issue represents the first step in rewriting all fish scripts, and scripts in other scripting languages like nu and bash, in the repos in the r3bl-org organization into Rust.

I expect there will be some shared modules that will be migrated to r3bl_core crate as this matures.

Since the YT video is already recorded for the live coding of this project, I will keep the fish scripts around. And add the option to use the Rust binary instead.

Hot topics to review in the YT live coding video

  1. Designing proper descriptive error states for fs operations (FsOpResult and FsOpError)
  2. Testing each of these states above to make sure that the mental model for the design maps to reality (std::fs apis) ... includes happy paths and exhaustive unhappy paths.
  3. Adopting naming conventions to manage so many different functions that are closely related (eg: try_* for fns that produce an error) and good module structure for organization
  4. testing "process change directory" operations carefully as these are global! related to the use of the create_global_singleton! macro
@nazmulidris nazmulidris changed the title [tls] Replace two fish scripts with a single Rust binary (gen-certs) [tls] Replace fish scripts with a single Rust binary (gen-certs) Dec 2, 2024
@nazmulidris nazmulidris changed the title [tls] Replace fish scripts with a single Rust binary (gen-certs) [tls] Add a single Rust binary (gen-certs) that does the work of the 2 fish scripts Dec 2, 2024
@nazmulidris nazmulidris linked a pull request Dec 4, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant