[ ... ]
I know of two kinds of programs that are easier to write in C than
Lisp: Those that mainly interface with the very C-centric operating
systems/environments, and some casese of special-purpose
number-crunching programs where the "portable assembly"-mode of C can
provide decent performance reasonably well (so, the program as such
isn't easier to write, but getting the expected performance is). Other
than this, I know of no such "typical engineering problems".
My guess is that in this case, you're either carefully maintaining
ignorance, or else for you Lisp is automatically simpler until/unless
it's _drastically_ more complex (e.g. 100 times as much code).
Just for example, I was recently looking at some C++ code for
designing FIR filters. It's part of SPUC, available at
spuc.sourceforge.net. As-delivered, the particular piece I'm looking
at (remez_fir.cpp) contains 282 lines of actual code (i.e. lines that
contain _anything_ other than white space or a comment).
I did a search for Lisp code that was apparently (about) equivalent,
and (to eliminate personal bias allowing me to pick a particularly bad
example) took the first thing Google turned up. The result was:
http://www.dxarts.washington.edu/docs/clmman/fltdes.lisp
Looking specifically at the code for Remes exchange. Using the same
criteria (lines, as delivered, that contain something other than
comment or whitespace) it's slightly longer (313 lines). Worse, while
I'm sure some people know Lisp enough better than C++ that they find
it easier to follow, it's difficult for me to imagine how that could
be. Nearly no name in the code is more than a couple of characters
long, and most are utterly meaningless, even to somebody who starts
out knowing what he's looking for.
Far worse, however, is the flow of control: the C++ code contains 9
functions, with a bunch of loops (I didn't try to count them) and the
only thing that qualifies as "unstructured" even from a completely
puritanical viewpoint is 2 break statements.
At least if I'm reading it correctly, the Lisp is a whole different
story. In fact, I'm scared to describe it -- I'd appreciate it if one
of the more frequent Lisp users would check, but are all those "go's"
what I think they are?
I have to admit that even I can hardly believe I could have stumbled
across such awful code by accident, but I've re-checked: I simply
typed "Lisp FIR filter" into Google, following the _first_ link it
came up with, clicked on "filter" in the "brief index" and then
clicked on the link to "fltdes" on about the sixth line (or so)
showing on-screen at that point. IOW, I'm pretty sure I didn't do much
where I could have influenced the choice of what code I looked at, but
unless I'm reading it entirely incorrectly, I'd be hard-put to blame
anybody for thinking I spent hours coming up with the worst piece of
garbage on the planet.
Let's say your bank balance is represented as an integer number of
1/100 units of some currency. In 32-bit C, you'd be able to represent
some 40 million.
What is this "32-bit C", you speak of? About all I can think of that
you might be talking about is "C prior to the current standard". The
current standard for C includes a 'long long' data type that has a
minimum of 64 bits. This isn't exctly a brand-new standard either --
it's been around for roughly 5 years now.
It'd be an interesting event to see Bill Gates come
deposit his money and you explain to him that unfortunately "the
integer wrapped around, so we can only tell you your balance modulo 40
million". And what when you need to calculate the bank's accumulated
deposits? Or the average of this over the last three decades? Would
you try to ensure that 64-bit integers are used throughout and cross
your fingers that nothing unforeseen happens?
If I want 64-bit integers used throughout, I won't _try_ do so -- I'll
use long long and it WILL happen.
As far as the rest goes, you're going back to exactly the kind of
examples I talked about before: things that are utterly remote from
what most of us care about or have any use for.
Let's face reality: I'm pretty sure my bank wouldn't tell me their
total deposits to the penny right now, not to mention for every one of
the last 30 years. Even if we assumed that it did, it would be an
amazingly large bank indeed for even a 30-year total of deposits to
exceed what fits into a 64-bit integer.
Even a ridiculous as those are, we're left with the final step, which
is the most utterly ridiculous of all: the notion that anybody in the
world cares at all about whether that number ends with 71 or 72 cents.
When you're dealing with an individual account, being accurate to the
penny matter. When (for example) large companies do their quarterly
SEC filings, they typically round to something like hundreds of
thousands of dollars -- even though they're NOWHERE close to exceeding
the range of a 64-bit integer.
[ ... ]
Funnily enough, I happen to have written a sort-of ethernet switch in
Lisp
I guess that might be a fun project, but there's really not a whole
lot to an Ethernet switch. A router is in a completely different
league. Some types of switches (e.g. ATM switches) are fairly complex,
but Ethernet switches are pretty trivial, almost regardless of the
language you choose.