Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Ha, nice! I've used the Swift shebang before, but honestly once you have something that works as a "script," it's so easy to convert it to a real command line utility via Swift Argument Parser [0] that I usually spend the 5 minutes to wrap it up.

  [0]: https://github.com/apple/swift-argument-parser


That's pretty sweet the argparser

It's kind of nice to be able to access all native libraries. I usually use ruby, but having something compiled and strict is super nice. Shellscripting it one big minefield.

Compiling is a simple step ofc. But it's nice to only have the scriptfile and it's nice to not have your directory cluttered with binaries. I'll see if I can post it tomorrow. It's very small anyway


Yes, but then you have to compile it to use it, since scripts can’t use dependencies. Personally I just use getopt which sounds insane but it’s part of the standard library (imported from C).




Consider applying for YC's Fall 2026 batch! Applications are open till July 27.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: