Live data from Hacker News

Show HN: Xcnotary – a Mac app notarization helper made with Rust

github.com

21–30 of 32 posts

Re: Show HN: Xcnotary – a Mac app notarization helper made with Rust

#22
post #11

Very cool utility. Rust seems like an odd choice since there's little processing work to be done other than the zipping - which could be outsourced to the "zip" tool - but I guess a learning exercise is a learning exercise.

Rust is actually great for cli applications regardless of performance benefits because of its good ergonomics and package management once you get over the hump of learning it.

Re: Show HN: Xcnotary – a Mac app notarization helper made with Rust

#23

(The author.) I had originally written a version of this in Python for my own use, and recently thought of rewriting it in Rust as a learning experience. What I found is that writing a CLI in Rust is a absolute breeze, in part due to excellent documentation and the tooling, and also thanks to various well-maintained crates, such as StructOpt [1] to parse command line arguments of any complexity, or indicatif [2] to s…

[deleted]

Re: Show HN: Xcnotary – a Mac app notarization helper made with Rust

#24
post #13

Very cool work! I just manually implemented this in a python script. Does it support other platforms? Will it run on Linux?

The notarization service is opaque (uses Xcode's "xcrun altool" to submit/read status, instead of something like a REST API...) so unfortunately Mac-only at the moment.

That's too bad, I would've loved to do this from a docker container.

Re: Show HN: Xcnotary – a Mac app notarization helper made with Rust

#25
post #22
post #11

Very cool utility. Rust seems like an odd choice since there's little processing work to be done other than the zipping - which could be outsourced to the "zip" tool - but I guess a learning exercise is a learning exercise.

Rust is actually great for cli applications regardless of performance benefits because of its good ergonomics and package management once you get over the hump of learning it.

The comparison is against Python, which definitely has better ergonomics and includes everything needed for scripts like this (but does have package management too if the huge standard library is not enough).

Re: Show HN: Xcnotary – a Mac app notarization helper made with Rust

#26

Thank you for building this. The notarization process is navigable but baroque, especially from the command line. fish shell's notarization script: https://github.com/fish-shell/fish-shell/blob/master/build_t...

Strange that it’s written in Bash!

Re: Show HN: Xcnotary – a Mac app notarization helper made with Rust

#27
post #22

Earlier quoted context omitted.

Rust is actually great for cli applications regardless of performance benefits because of its good ergonomics and package management once you get over the hump of learning it.

The comparison is against Python, which definitely has better ergonomics and includes everything needed for scripts like this (but does have package management too if the huge standard library is not enough).

I disagree that Python has better ergonomics than Rust for scripts like this. For example, IMO python doesn't have anything as nice as Rust's structopt library for argument parsing (https://github.com/TeXitoi/structopt). Python does have package management, but it's a pain to use compared to Rust or JavaScript (have to setup virtual envs, etc - not very ergonomic!).

You also mostly don't hit into the tricky ownership issues that can make Rust less ergonomic in CLI apps. Because the code flow is usually quite linear, so you don't have multiple bits of code trying to access the same variables at once.

Note: Although Rust has static types, it has very good type inference such that you don't often have to explicitly state the types. IMO this brings Rust pretty close to dynamic language ergonomics for simple things like this.

Re: Show HN: Xcnotary – a Mac app notarization helper made with Rust

#29

Earlier quoted context omitted.

The comparison is against Python, which definitely has better ergonomics and includes everything needed for scripts like this (but does have package management too if the huge standard library is not enough).

I disagree that Python has better ergonomics than Rust for scripts like this. For example, IMO python doesn't have anything as nice as Rust's structopt library for argument parsing ( https://github.com/TeXitoi/structopt ). Python does have package management, but it's a pain to use compared to Rust or JavaScript (have to setup virtual envs, etc - not very ergonomic!). You also mostly don't hit into the tricky ownersh…

Python has argparse in the standard library which does everything you may need and more. You can even make Git-like interfaces with it.

For most CLI tools you do not even need third-party packages in Python to begin with. You cannot beat that. And if you do, you don't need virtualenvs, because your system package manager can do the job just fine for most cases, or you can use pip or you can locally deploy.

Python has no ownership issues to think about. You cannot beat that either.

Type inference is nowhere close to dynamic typing.

Then there are other things like no compile-edit cycle in Python. No binary distribution. No shenanigans like issues with missing libraries and dynamic linking.

So you may disagree, but your points are not valid. The actual advantage for going for a compiled low-level language is performance, so unless you need that, there is no point on using Rust or any other compiled language for the majority of the boilerplate code for small scripts and CLI tools.

Re: Show HN: Xcnotary – a Mac app notarization helper made with Rust

#30

Thank you for building this. The notarization process is navigable but baroque, especially from the command line. fish shell's notarization script: https://github.com/fish-shell/fish-shell/blob/master/build_t...

Strange that it’s written in Bash!

This is necessary for building fish. If we wrote it in fish script, we'd run into the bootstrapping problem, where you'd need fish to build fish.
Post reply on HN