Comparing programmable tab completion in bash, zsh, tcsh, and fish

My adventure in shell tab completion continues. (A bit of background: I got interested in tab completion around two years ago when I realized that it is a significant UX element, if not one of the most important ones, in a CLI environment. Since then I've created, among other things, a couple of command-line frameworks that make it easy to do custom tab completion in Perl, as well as a bunch of modules in Complete::* namespace for generic completion which can be used in other environments like GUI and web).

This week, I added tab completion support to my frameworks for several other shells other than bash: tcsh, zsh, and fish. This blog is an observation of the different ways of doing programmable tab completion in those shells, especially from the viewpoint of a programmer who wants to do it using Perl (or other programming languages) instead of using built-in shell functions.

20 years and counting

So myself and I think most of the Perl world missed an important date on October 12th

Well that day marked the first release of DBI to CPAN.

It is hard to judge how much an impact this hunk of code has had on dare I say it the world. IMHO it was the first killer app for the web and still with us today being actively developed and improved on and has kept its place just quietly sitting in the background doing its job.

If I sit back and think of 20 years ago I had just upgraded to a 12k modem from a 1.2k, browsed the internet, (If you could call it that) with text browser, Netscape was only release 1 day later, (By the way it too me 19+ hours to download it) a few week later one used something call web-crawler

WebCrawler.png

Managing Boilerplate with Import::Base

Boilerplate is everything I hate about programming:

  • Doing the same thing more than once
  • Leaving clutter in every file
  • Making it harder to change things in the future
  • Eventually blindly copying without understanding (cargo-cult programming)

In an effort to reduce some of my boilerplate, I wrote Import::Base a module to collect and import useful bundles of modules, removing the need for long lists of use ... lines everywhere.

Inline Grant Weekly Report #1

Just finished up week #1 of the TPF Grant for Inline Modules with DAVIDO++. We've been having a blast, making great progress, all while trying to push the boundaries of open/public/televised/pair/perl programming!

Here's our weekly status report (using our new homemade blogging system (thinking about you, Tony Bowden!)): http://inline.ouistreet.com/

We'll be writing up a report each Saturday, just in time for Gabor's http://perlweekly.com/

Stop by #inline on irc.perl.org and say HAI, if you are so inclined.

Where is Brent?

Does anybody know Brent B. Powers, the author of (amongst others) Tk::FileDialog and Tk::Waitbox?

I tried to contact the author my e-mail but every address I tried returned an error like undeliverable or unknown user etc.

Open source clone of search.cpan.org

I have started to write an open source clone of search.cpan.org. In case you are interested, see more details and links in that article. It is currently hosted here. The front-page is already there, but of course most of the parts don't work yet.

Strawberry Perl 5.20.1.1 invalid MSI signatures

Unfortunately I have managed to release strawberry-perl-5.20.1.1-32bit.msi and strawberry-perl-5.20.1.1-64bit.msi files with wrong MSI signature. The installer will very likely complain about revoked certificate (although I do not know why my laptop have not complained when I tested these MSI).

I am sorry for any inconvenience this might caused you.

The trouble is that although I have sent scanned copy of my passport to Certum CA approx. a year ago they claim that they do not have it. Unfortunately the reminder they sent me was probably "swallowed" by cpan.org's spam filter and they simply revoked my certificate. I have submitted a new request for code signing certificate, unfortunately cpan.org's spam filter struck again and block an e-mail with verification URL I have to click on.

I am tired of dealing with Certum CA and I am fed up with cpan.org's spam filter, therefore I am considering to stop signing MSI packages.

Alpine Perl Stint, Part 2 of 2

It's been over a week now since the Austrian Perl Workshop of 2014. It took place in Salzburg for the second consecutive year. On Thursday, the day before the conference started, Mozart's home town greeted the attendants with glorious summer weather and amazing 26 degrees Celsius.

Inline Granted

This news is a couple of weeks old now, but the Inline-for-XS-Modules TPF Grant Proposal was accepted! A big Thank You to the Perl Community and the TPF.

David and I have just returned from vacations and we started work on the project today. Our first order of business was to create this web site, to which we will be posting regular updates on our progress, and other interesting information about the project.

A fast pragmatic test runner

After breaking the build twice in the space of a week for more or less the same reason each time, I figured that my team needed a continuous integration rig, and we needed it now.

For web application stuff it's not that unusual to have tests that collide with each other, at least in the short term due to the conflict between the need to "do it right' and the need to "do it now". And generally it's desirable to run your test suite in parallel wherever possible. At the moment, our tests are generally inadequate, so I'm only saving around 2 minutes on a parallel versus series run. However I'm doing bulk changes (with the help of PPI) to this largeish existing codebase at the moment, and get into situations where I want to run the whole test suite every 10 minutes or so, at which point saving 12 minutes in an hour becomes significant.

Reviewing gitolite modules from the puppet forge

When a million flowers bloom in the world of open source, with no clear winner in the popularity contest for wide-spread use, sometimes the options can overwhelm. What follows is a summary of what I learned spending a day reviewing my options for a tool I could perhaps have written myself in that time, if I had felt free to ignore the prior art. It relates to yet another great tool written in perl, gi‪tolite by sitaramc.

-----

If you manage your infrastructure with puppet, your source code with git and have need of an in-house git repository providing user and group access control lists, this article may be relevant to your needs.

So I went to Mongolia and rode a Camel

For some reason I just felt this deserved to be posted here.
I went to Mongolia and rode this bactrian camel. As a JAPH this was a special event for me worth sharing :)

1978841_10152342517411771_6701857937254181945_n.jpg

Language Identification, Neural Networks and Perl

I will not write much, but just would like to let you know there is a new Perl module for Language Identification (Lingua::Identifier). It uses a neural network for the task (read this for details), with Math::Matrix::MaybeGSL, that will use Math::MatrixReal or Math::GSL::Matrix if it is installed. An extended version of the paper is being reviewed, and therefore I am not allowed to publish it here.

Q: Nestoria Dev Blog and comments

On Nestoria Dev Blog I tried to post a comment+script about smart match.

  • I log on via Google
  • Everything looks ok.
  • I post text + script
  • The page refreshes
  • Everything looks ok

But the post is not afterwards visible.

OK, so it’s possible the blogger just zaps my post :-(, but it there another explanation?

Fatpacking your scripts with fatten

"Thank you for a freakin awesome app. Seriously, fatten is great! <3" --Paul J. Fenwick

fatpack is a utility created by MST to pack a script along with its dependencies (required Perl modules) into a single file. It differs from PAR in that it does not create an archive that must be extracted into the filesystem at the start of program run. Thus, a fatpacked script is simpler and faster to run.

The command-line utility is a bit cumbersome to use, though. Producing the final result involves several invocations of fatpack, and often the final result still misses some required modules. If you want a more turnkey solution to fatpacking a script, you might want to check out fatten.

Using fatten could not be easier:

% fatten /path/to/myapp

Parsing of anime reviews on rec.arts.anime.misc

I have been collecting posts from rec.arts.anime.misc newsgroup, mostly related to anime reviews to prioritize which one to see. The format is more or less the same of (collection of) reviews ...

  • title
  • a paragraph of comments
  • ending with some kind of quality statetment (a second paragraph is rare)

Take ca6u74F3g1tU1@mid.individual.net message for example by GeoffC (Wed, 15 Oct 2014 10:48:16 +0100) ...

Gundam G no Reconguista:
Another Gundam, still with young characters piloting giant robots in space. Not badly done, but I was confused about who was who and what was going on in the first episode, and did not feel sufficiently involved to continue with further episodes.

...

Donten ni Warau:
Meiji Restoration period drama. I saw the first episode in raw. So far, it has not interested me enough to encourage further investigation.

Visualizing the McNaugthon-Yamada-Glushkov Construction

Once in a while I poke in my old Perl stuff to find something interesting. Luckily, this is usually the case.

Today, I found a script that draws an annotated syntax tree of a regular expression. The annotation shows the state sets calculated when applying the McNaugthon-Yamada-Glushkov algorithm to construct a finite automaton from the regular expression.

You can read about it in "Bruce W. Watson. Taxonomies and Toolkits of Regular Language
Algorithms. PhD thesis, Faculty of Computing Science Eindhoven
University of Technology, The Netherlands, 1995".

Here is an image:

myg.png

I just thought about sharing this bit because there once was a thread about how we could improve marketing for Perl and one of the answers was to write (more) Perl applications.
So, here is one :)

Sydney Perl Mongers Thursday Night

Sydneysiders are invited to join us this Thursday night for yet another Sydney-PM meet.

SiteSuite have offered to host us. Thanks to Cees for setting the wheels in motion for us to use the venue.

What: Sydney PM
Date: Thursday, 16th October 2014
Time: 6-9:30pm
Where: SiteSuite, Level 3, 1 Bay Street, Broadway Shopping Centre, Sydney
Who: Anyone with any level of experience with Perl. Please bring friends, family and co-workers!

The building locks it's doors at 6pm, so one of their staff will let us in. On the day a contact mobile number will be posted for stragglers. Please jump on the sydney.pm.org email list for that detail on the day.

Cees will be giving a talk about Rose::DB and we have a guest speaker giving us this talk live from San Francisco...

Title: I've Got 99 Problems But CPAN Ain't One

Celebrating Perl 5’s 20th birthday at MadMongers.



Celebrating Perl 5’s 20th birthday at MadMongers.

[From my blog.]

Pod::Readme v1.0.2 released

I released a new version of Pod::Readme yesterday. It's a module for "Intelligently generate a README file from POD" by using POD =begin/=end and =for commands to control what parts of a module's POD are included/excluded in the README. For example, you don't need the details of method calls in the README, nor do you need installation instructions in the module's man page.

This is a major rewrite using "modern Perl" that supports the following features:

  • Generating a README in various formats such as plaintext, POD, markdown, HTML;
  • Support for plugins to add new features.
  • Support for (via plugins) inserting the module version, recent changes and prerequisites in the README.

It should still work with existing software that uses it, such as Module::Build.

The next steps will be to write modules to integrate this with other release tools, such as Module::Install or Dist::Zilla.

Feedback as always would be appreciated. The module is on GitHub.

Thanks to everyone who commented on previous blog posts about this, and to CPAN Testers for test reports on previous dev releases.

About blogs.perl.org

blogs.perl.org is a common blogging platform for the Perl community. Written in Perl with a graphic design donated by Six Apart, Ltd.