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

Kinda off that this is written in Python, and not Perl. If it was written in Perl, it'd have the portability that the underlying translated commands have!

I'd be happy to help you port it to modern, high-quality, readable Perl if that's something you're interested in. Being able to install this by dropping a single Perl file into ~/bin/ would be neat.



@bihla take this man up on his offer :-). I thought it was an April fools joke where it talks about perl and then implements everything in python. But no, its actually python. If you (peteretep) do port it to perl, please post a show HN: :-)


I agree, if it were entirely Perl it would have essentially no dependencies. Right now the audience is limited to those with a currently functioning Python3 environment or willing to configure one.

My only concerns are:

I do not know what the process of getting comparable tab completion would be in Perl. I depended on the argcomplete package for this feature which I consider to be essential...the clarity of the syntax depends on being a bit verbose, and this is only usable because tab completion makes it fast to use.

Also, I'm somewhat reluctant to develop in Perl, though I'm willing to do it provided the benefit + demand is there. It would be ironic to have learned Perl as a consequence of building a tool whose primary function is to prevent one having to learn Perl.

I'll send you an email to discuss further.


I haven't used the following (I simply never had to implement the shell autocompletion as try I avoid the shell as much as I can, preferring to organize my code in the actual files that I can reuse from my editor) but I guess it can be the best start to include significant parts of this code inside of your final script, if the goal can be to have a single easily usable script doing everything, as somebody mentioned that ideal here (still take care to keep the compatible/same license):

https://fastapi.metacpan.org/source/PERLANCAR/Complete-Bash-...

You can surely omit the lines between =pod and =cur (they are used to create the documentation) and most probably also the "description" parts.

> It would be ironic to have learned Perl as a consequence of building a tool whose primary function is to prevent one having to learn Perl.

It's less ironic than you think, I consider it the bigger irony that Python turned to be the major compatibility problem in all but single-user single-program environments (it's really not trivial to have to work with more Python variants as the dependencies for different code). You can be sure that any Perl 5 skills you obtain can remain quite portable and usable across the different environments.

I've also already written here, I consider Perl significantly "safer" language than Python: when I modify some big Perl scripts, very often the Perl compiler (when used with the "use strict" and -w option) will tell me early enough what is missing for a program to function correctly again, as Perl simply more explicit, in some weird way almost like the typed languages. I never have the same feeling of "it will work" with the modification of the Python scripts.

That "line noise" is actually meaningful, much more consistent than the shell languages, and safer in case of the changes than Python.


Forgot to say it in the other comment but regardless of whether we proceed with this, thank you for offering to help. It means a lot to get a positive response from people, especially to the extent that individuals will contribute to the project.




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

Search: