Hacker News new | comments | show | ask | jobs | submit login

The importance of Cargo / crates.io cannot be understated, I think.

I've found myself using Rust for little one-off tools and scripts lately because it's so darn easy to type `$ cargo new --bin foobar` on any of the three operating systems I use daily.

There's already a pretty nice ecosystem of web servers, graphics libraries, crypto libraries, etc. -- Not to mention the bindings to existing libs.

At the end of the day I always end up with wicked fast binaries that I can run on Windows, Mac, or Linux with fairly minimal fuss.

---

I really haven't found a language that hits this niche the way Rust does, which is really strange to me considering Rust's mission statement.

No shell scripting language is that easily portable barring something like MinGW.

I've never had what I'd call a pleasant experience using Ruby, Python, or Javascript on Windows. Not to mention if the language runtimes / stdlibs don't demand it: many of the 3rd party libraries assume a *nix toolchain to build all the C extensions.

Go and Java probably come the closest to writing easily portable software, but I personally find writing Rust to be a more fulfilling endeavor.

---

The other day I wrote a tool to deduplicate my image library in Rust. The first binary to compile worked perfectly on both Mac OS and Windows, ran wicked fast (on my SSDs anyways), and it was really a pleasure to write. -- Rust's iterators alone really make for some beautiful code.

---

This was a really long-winded way of saying I love Rust, and thanks for all the hard work ^^,




I had somewhat of a similar experience setting up a build.rs for a crate.

I wanted to do some pre-build command execution/file moving/etc and was shocked at how little fuss was actually involved.

More work than bash/python? Sure. Worked first time barring logic bugs? Hell yes.

Also +1 on Rust iterators, they're a sublime mix of ownership semantics and functional constructs.


I've actually found python3 to be surprisingly pleasant on windows (10), while go has been just ok. I think it is mostly a culture thing: python has a long history of cross-platform, and I think the odds are better that some utility written in/ported to python3 will use the various facilities python provides for "just working" cross platform. It also helps that python3 made virtualenvs part of the standard library.

With go, I think it's easier to accidentally end up with some kind of not-quite-portable thing, despite the fact that go is a new language.

Interesting (and good!) that you have such a pleasant experience with Rust too.

> The other day I wrote a tool to deduplicate my image library in Rust.

Hm, did you by any chance share that somewhere? I'm planning to do some reinstalls and consolidation of storage, partly from having several machines, and partially from dual-booting (having extra file-systems). I'll probably figure it out with find and xargs or what-not, but a Rust-binary would be a welcome change of pace :-)


> No shell scripting language is that easily portable barring something like MinGW.

> I've never had what I'd call a pleasant experience using Ruby, Python, or Javascript on Windows.

Perl is probably the tool you are looking for. There are official technet articles about how to use Perl on Windows. Older, now that powershell exists, but they're there.

If you're already familiar with Ruby I imagine it's not too hard to pick up most most of what you would want to know (except context! Probably the most important thing in Perl to grasp coming from other languages).


Out of curiosity, what methods did you use for image dedupes? Simple file hash, or something more complex to find e.g. watermark vs no, different crops/scales, etc.?


At the moment it is just hash based, which actually remedied most of my immediate problem. (I have 8 drives in my workstation. Many of them are donors from computers long gone. [Portions of] my image library have just been copied around many times without much rhyme or reason. Now it's centralized and properly backed up.)

I did think about comparing images by similarity but ultimately tabled it for a later evening because:

- I quickly realized I had a lot of reading to do

- Resolving "similar images" conflicts is a fuzzier, more time intensive process since: (a) maybe the comparison is just plain wrong?, (b) maybe it's not strictly a worse crop, but rather two common aspect ratios which you'd like to keep, (c) maybe it's not actually "watermark" text but rather it's a meme or image macro, etc.

- Personally: my real problem with images of varying sizes is that I download thumbnails by mistake. That's just PEBKAC and no amount of software can fix that.

(Now that I think about it: it might be nice to have a script which iterates over low resolution images and tries to find a large resolution version w/ Google Image Search.)




Applications are open for YC Winter 2018

Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | DMCA | Apply to YC | Contact

Search: