show icon indicating copy to clipboard operation
show copied to clipboard

Conditional compilation (Windows, Mac, Linux)

Open mre opened this issue 7 years ago • 4 comments

What?

The original plan was to write a command line tool, that opens a file with the default program on the given operating system, but that already exists. Therefore I'll need to find something else, where I can show conditional compilation on. Maybe a tool I can port from Golang?

Why?

Show how to structure commands in separate modules.
Build platform-dependent code using cargo. Show how to use dependency injection or a simple plugin system in Rust? Explain different idioms in Golang and Rust.

How?

~~Port open-golang.~~ I don't know yet.

mre avatar Mar 09 '18 13:03 mre

https://doc.rust-lang.org/book/first-edition/conditional-compilation.html

mre avatar Mar 09 '18 23:03 mre

Needed that recently and https://github.com/Byron/open-rs did a nice job. It's also is a bit more robust on linux :)

(Not saying that to stop you from doing an episode on this, just so you know it's out there)

killercup avatar Mar 19 '18 15:03 killercup

Thanks for the heads-up. Looked at the code an it's intimidatingly good. No surprise, @Byron style. Plenty of fish in the sea, so I'll close this, I guess. 😅

mre avatar Mar 19 '18 15:03 mre

No! On second thought, the gist of the show might be conditional compilation. It's just the example that is ill-fitting. I guess I'll simply rename the issue and wait for inspiration (hint, hint) on what might be a good fit for the topic. 😁

mre avatar Mar 19 '18 15:03 mre