colorls icon indicating copy to clipboard operation
colorls copied to clipboard

Clones in different language

Open scoiatael opened this issue 6 years ago • 7 comments

Reason: distributing executable as Ruby gem is notoriously hard to pull off.

Would it be ok if I tried cloning this idea (awesome one, btw) in Golang / Rust / Crystal / Haskell? Basically, any compiled language in which you can simply distribute binaries for different OSes.

scoiatael avatar Jul 08 '17 14:07 scoiatael

A clone/reimplementation that actually colorizes ls output instead of reimplementing ls would be interesting!

torarnv avatar Jul 08 '17 20:07 torarnv

@torarnv - Yes, but parsing ls is a discouraged approach. Hence, blindly colorizing ls output isn't done (it used to be like this, till commit 64d256efaded062efd7fede74807663400716b46). 😄

@scoiatael - There has been similar discussions (about clones) in issue #11 for a Python clone and with @sl regarding a JS clone which is installable by npm. However, all these were prior to colorls becoming a gem. :-/

This is (was) the architecture discussed by @sl and myself, regarding maintaining clones with a set of shared icons -

colorls (organization)
- colorls-icons repo # Acts as git submodule to all clones.
- colorls-ruby repo # The `colorls` ruby gem
- colorls-js # To be done by @sl 
- colorls-python # Because Pythonists love a python implementation
...

However, an organization for colorls with clones in multiple languages seems like a bit of an overkill to me at this point of time, especially when it's installation is as simple as gem install colorls. But, let me know if you're fine with this / have a better alternative in mind. 😄

athityakumar avatar Jul 10 '17 03:07 athityakumar

Yes, organization seems like a total overkill ;)

I agree that gem install colorls is simple enough, but it starts becoming problematic if:

  • you want to support more Ruby versions,
  • user has more gemsets,
  • user does not have Ruby.

The major advantage of compiled languages vs interpreted (like Ruby, Python or JS) here is that you can compile it to one binary with as little dependencies as possible and then distribute it very easily.

I don't have any good proposal in mind (yet) - I guess the best possible solution would be to check if Crystal can compile this project without major changes - but I doubt it.

I guess for now I'll just play around with Rust clone, make it compatible with colorls configuration files, and see if I can make it easily distributable as binary.

We can come back to this discussion after I have some results in Rust - is that ok?

Here's repo: https://github.com/scoiatael/colorls-rs

scoiatael avatar Jul 10 '17 08:07 scoiatael

@athityakumar I see, hmmm. I was hoping to alias ls=colorls 😢

torarnv avatar Jul 10 '17 10:07 torarnv

@scoiatael have you had a look at exa? It is a very feature-rich colorful ls replacement written in rust.

GladOSkar avatar Jul 10 '17 11:07 GladOSkar

Ha, no, I have not. Nice, thank you @GladOSkar :) Maybe adding icon support there would be a good next step then?

scoiatael avatar Jul 10 '17 14:07 scoiatael

Here's my javascript port for reference in case as we're considering how to best reduce redundancy seeing one of the implementations is useful. I look forward to seeing your rust implementation as well if you end up going that route!

https://github.com/sl/colorls-js

sl avatar Jul 10 '17 19:07 sl