Live data from Hacker News

Show HN: tere – A Faster Alternative to cd+ls

github.com

91–100 of 206 posts

Re: Show HN: tere – A Faster Alternative to cd+ls

#91
post #78
post #18

Earlier quoted context omitted.

I tried to avoid bloat as much as possible, and I would argue that the non-transitive deps are pretty essential. I'l look into tweaking some features as suggested in sibling to trim it further down. But you're right that it could always be simpler, in fact I wrote tere originally in C with curses as the only dependency, and it compiles >10x faster. But there I had to manually write some (pretty certainly buggy) unico…

I wonder, have you considered D? Seems almost ideal to me for this kind of small tooling, and it's unlikely to break because of dependency version changes caused by the thirty-seventh party.

Not really. The main reason for choosing Rust was to try it out, because it's the new cool thing. And I do find it really enjoyable. Rust is also trying very hard to keep dependency-related breakage to a minimum, and I think the Cargo ecosystem is doing a great job at that.

Re: Show HN: tere – A Faster Alternative to cd+ls

#92
post #91
post #78

Earlier quoted context omitted.

I wonder, have you considered D? Seems almost ideal to me for this kind of small tooling, and it's unlikely to break because of dependency version changes caused by the thirty-seventh party.

Not really. The main reason for choosing Rust was to try it out, because it's the new cool thing. And I do find it really enjoyable. Rust is also trying very hard to keep dependency-related breakage to a minimum, and I think the Cargo ecosystem is doing a great job at that.

Fair enough; "I wanted to try out X" is always a valid reason. It's just that compared to C, things like Unicode support, argument parsing and JSON support are already part of D's standard library so no dependencies should be required for those.

Re: Show HN: tere – A Faster Alternative to cd+ls

#93
post #6

curl https://raw.githubusercontent.com/mgunyho/tere/master/Cargo.lock | grep source | wc -l 51 How come that such a simple tool has more than half a century of dependencies? This is terrifying.

The "too many dependencies" meme is far too often an example of Chesterton's Fence. The answer to your question "How come a simple thing is more complex than I first thought?" is: "Because you've spent less time thinking about it than the author".

This isn't true, though. If this had been an older GNU utility, the dependencies likely would have been libterm and libc. Not because it would have been less complex, but because of the ecosystem choice in C applications to have larger, fully-featured libraries versus the micro-libraries Rust seems to have inherited from JavaScript conventions.

Whether this is better or worse seems to be a matter of contention for a lot of people, but it certainly poses a challenge for supply-chain auditing. I suspect for Rust to truly ever replace C++ in its domain, the ecosystem is going to need to come up with something like boost so you can grab one library that does all the things nearly any program wants (regex, serialization, cli opts, etc) but that don't get included in the core language's stdlib.

Re: Show HN: tere – A Faster Alternative to cd+ls

#94
post #37

Congrats for getting this out! > I also wanted an excuse to learn This is the best reason ever, and not just for you: seeing your GIF I thought "could I achieve that with fzf?". Turns out, yes I can: function fcd() { local dir; while true; do # exit with ^D dir="$(ls -a1p | grep '/$' | grep -v '^./$' | fzf --height 40% --reverse --no-multi --preview 'pwd' --preview-window=up,1,border-none --no-info)" if [[ -z "${dir}…

FYI: I think you meant "contagious" rather than "contaminating". The latter means to make something impure whereas the former means more to spread something. :)

(I'm beginning to think auto-correct should be called auto-malaprop.

The best one I've seen recently was a fellow enthusing about the descendant of Plan 9 who wrote, "I'll always singe the praises of Inferno!".)

Re: Show HN: tere – A Faster Alternative to cd+ls

#95
post #6

curl https://raw.githubusercontent.com/mgunyho/tere/master/Cargo.lock | grep source | wc -l 51 How come that such a simple tool has more than half a century of dependencies? This is terrifying.

Cargo.lock is the wrong place to be looking, there really are only 7 direct dependencies, https://github.com/mgunyho/tere/blob/master/Cargo.toml#L14-L...

The deps for each of these packages is really out of the authors hands, this is really the same for any programming language though which need to pull in dependencies of their own.

Re: Show HN: tere – A Faster Alternative to cd+ls

#96
post #37

Congrats for getting this out! > I also wanted an excuse to learn This is the best reason ever, and not just for you: seeing your GIF I thought "could I achieve that with fzf?". Turns out, yes I can: function fcd() { local dir; while true; do # exit with ^D dir="$(ls -a1p | grep '/$' | grep -v '^./$' | fzf --height 40% --reverse --no-multi --preview 'pwd' --preview-window=up,1,border-none --no-info)" if [[ -z "${dir}…

[deleted]

Re: Show HN: tere – A Faster Alternative to cd+ls

#97
post #76
post #55

Earlier quoted context omitted.

Well, that's Rust for you. They somehow think that having a boatload of dependencies with nondescript names (smawk, parking_lot_core, serde, clap - I feel like I'm having a stroke) is a feature. I'm not even joking.

Serde is a common term meaning "serialization/deserialization," seems pretty descript to me.

You're saying it's "a common term", but I'd literally never heard it before a Rust library with this exact name appeared. Isn't this by any chance circular reasoning? That it became "a common term" because of this library? In that case you couldn't justify the name of the library by saying that it was "a common term" at that time.

Re: Show HN: tere – A Faster Alternative to cd+ls

#98
post #37

Congrats for getting this out! > I also wanted an excuse to learn This is the best reason ever, and not just for you: seeing your GIF I thought "could I achieve that with fzf?". Turns out, yes I can: function fcd() { local dir; while true; do # exit with ^D dir="$(ls -a1p | grep '/$' | grep -v '^./$' | fzf --height 40% --reverse --no-multi --preview 'pwd' --preview-window=up,1,border-none --no-info)" if [[ -z "${dir}…

This is great, thank you! Just a couple of minor changes to handle softlinks to folders...

  function fcd() {
    local dir;
  
    while true; do
      # exit with ^D
      dir="$(ls -a1F | grep '[/@]$' | grep -v '^./$' | sed 's/@$//' | fzf --height 40% --reverse --no-multi --preview 'pwd' --preview-window=up,1,border-none --no-info)"
      if [[ -z "${dir}" ]]; then
        break
      elif [[ -d "${dir}" ]]; then
        cd "${dir}"
      fi
    done
  }

Re: Show HN: tere – A Faster Alternative to cd+ls

#99
post #6

curl https://raw.githubusercontent.com/mgunyho/tere/master/Cargo.lock | grep source | wc -l 51 How come that such a simple tool has more than half a century of dependencies? This is terrifying.

`cargo tree` output: tere v1.0.0 ├── clap v3.0.10 │ ├── bitflags v1.3.2 │ ├── indexmap v1.8.0 │ │ └── hashbrown v0.11.2 │ │ [build-dependencies] │ │ └── autocfg v1.1.0 │ ├── os_str_bytes v6.0.0 │ │ └── memchr v2.4.1 │ ├── strsim v0.10.0 │ ├── terminal_size v0.1.17 │ │ └── libc v0.2.126 │ └── textwrap v0.14.2 │ ├── smawk v0.3.1 │ ├── terminal_size v0.1.17 (*) │ ├── unicode-linebreak v0.1.2 │ │ [build-dependencies] │ │…

I don't know much about Rust, but I have a hard time believing python's standard library wouldn't have all the required functionality covered (whether performance would be adequate is different question). I for one, really really like python for its comprehensive standard library.

Re: Show HN: tere – A Faster Alternative to cd+ls

#100
post #76
post #55

Earlier quoted context omitted.

Well, that's Rust for you. They somehow think that having a boatload of dependencies with nondescript names (smawk, parking_lot_core, serde, clap - I feel like I'm having a stroke) is a feature. I'm not even joking.

Serde is a common term meaning "serialization/deserialization," seems pretty descript to me.

But... what and how does it serialize/deserialize?
Post reply on HN