From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-2.1 required=3.0 tests=ALL_TRUSTED,AWL,BAYES_00 shortcircuit=no autolearn=no version=3.3.2 X-Original-To: misc@80x24.org Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id 0ECB71F42D; Sun, 14 Sep 2014 22:36:49 +0000 (UTC) Date: Sun, 14 Sep 2014 22:36:48 +0000 From: Eric Wong To: misc@80x24.org Subject: why I prefer scripting languages Message-ID: <20140914223648.GA31961@dcvr.yhbt.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline List-Id: (totally genericized version because I've done the same thing countless times) Last night I encountered a weird (and annoying) warning message from a script I run occasionally. Said warning message was kind enough to tell me which file it was from, and it was not from the main script itself, but one of the libraries (also a script) it was using. I decided I wanted to prevent the main script from triggering the warning in the library script. Fortunately, I happen to be the administrator of the machine I was running on, so I: 1) opened the library script in my $EDITOR (requiring sudo) 2) find the offending warning message in the library script 3) lightly-edited the library script to dump a backtrace before the warning message, this is a one or two-liner[1] 4) rerun my main script to trigger the backtrace, and note how the main script triggered it 5) workaround the warning fix the bug in the main script 6) undo my edits (made as root) to the library script 7) send resulting the fix in the original script to the maintainer(s) The whole process took less than a minute and I never left the original terminal I was working on. No waiting for any source code to download, no waiting for building or linking, etc. Had I been using a compiled language, I would've done the same thing. However, it would've taken longer to download all the required components, wait for things to build, install the temporary package[2] So yes, keep your software easy for ordinary users to hack on. [1] in Perl: use Carp qw(cluck); cluck("warning here!") in Ruby: warn caller.join("\n") # sorry, haven't touched Python in over a decade, # comments greatly appreciated [2] That said, Debian GNU/Linux (my distro of choice) makes it easy (but still potentially time consuming) with: # install build-dependencies as root sudo apt-get build-dep $PACKAGE # download the source to $PWD (no need for root) apt-get source $PACKAGE cd $SRCDIR # the above command will tell you $SRCDIR # make edits (no need to be root) $EDITOR /path/to/file/with/warning/message # compile + link the package debian/rules build # package it up as .deb files fakeroot debian/rules binary # install resulting debs sudo dpkg -i $NEW_DEBS # the above command will tell you names