chicken-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Chicken-users] Unix Scripting in Chicken


From: Matt Gushee
Subject: Re: [Chicken-users] Unix Scripting in Chicken
Date: Fri, 11 Oct 2013 22:45:27 -0600

Hi, Danny--

Interesting question. I don't know that I have the expertise to give
you a whole lot of advice, but this is something I have been
interested in, and I also come from a Python background.

My short answer is that I don't feel that Chicken Scheme is a great
tool for this kind of thing, though it is not terrible either. One of
Python's strong suits in my experience is that it makes simple things
simple. Scheme, well, some things are very simple, like:

  (with-output-to-file "hello.txt"
     (lambda ()
         (print "Hello there!")))

I/O doesn't get much simpler (or safer) than that. On the other hand,
certain common tasks, like processing dates and times, can be a big
headache.

But anyway, I think much of the functionality you need is included in
the Chicken distribution, especially the posix, files, srfi-13 (for
string processing), and irregex modules. Regarding srfi-13, you should
be aware that it not internationalized, so you might want to install
the utf8 egg and use the included utf8-srfi-13 modules, which has
(with minor exceptions, I think) the same API. And if you use irregex,
I would recommend trying the SRE syntax--regular expressions
represented as S-expressions. It takes some getting used to, but I
think once you are familiar with it, it is much more readable than
PCRE-style string patterns.

Some additional eggs that might be useful include:

  posix-extras
  directory-utils
  log5scm

... and a command-line parser. I've tried args, easy-args, and
getopt-long, and have not found any of them very pleasant or
intuitive--this is one area where I'd say Python has a definite edge.
However, there's a relatively new one called
imperative-command-line-a, which I didn't know about until just now.
It seems to have good documentation.

I'd be interested to know why you are frustrated with Python. Also,
you might get better feedback if you could describe the kinds of tasks
you want to do. As you may have noticed, Chicken has a sizable
collection of extension libraries--not nearly as many as Python, but
enough that noone can be familiar with all of them.

HTH.

--
Matt Gushee



reply via email to

[Prev in Thread] Current Thread [Next in Thread]