[Chicago] Python/Mono slapdown [no pycon content]

Martin Maney maney at two14.net
Fri Mar 7 00:09:34 CET 2008


On Thu, Mar 06, 2008 at 11:34:39AM -0600, Ian Bicking wrote:
> Martin Maney wrote:
>> Having just been looking at SWIG and ctypes, I'm tempted to guess
>> that he might not be familiar with the latter, but as I know
>> literally nothing about how C# handles binding to extenal C code I
>> could be mistaken.
>
> I don't know what it looks like in C# either.  ctypes is about as good as 
> you can get for calling, except that it doesn't read header files.  I 

Having played with ctypes for a good part of the day (of the copious
free time part of the day, anywhow), I gotta say it's looking pretty
good.  I think I'm past the bit where I spend more time figuring out
how ctypes does things than puzzling out the not very documented
existing library I need to talk to; it didn't help that the very first
function I needed to call was one that takes *argc, *argv (and modifies
both as it consumes arguments)... yeah, it's a crappy interface, I can
understand why it hasn't changed much in years and years.  But if you
want to talk to the Netware servers...

> Some other things he says:
>
>> No lexical scoping.
>
> Well this just isn't true.  Nested scopes are writable.  But Python
> definitely as lexical scopes.

Yeah, that's an odd one.  I was hoping someone who'd at least dabbled
in C# might guess what he thought he was missing, but perhaps he's just
wrong, or using the wrong name for whatever it is he wants.

>> Hard (impossible?) to make cons-free structures. For this particular
>> program, this is a killer.
>
> You have to use Numeric.

I know enough to think "maybe Numeric could do something here".  But to
be honest I don't know if I'd have pursued that vague thought, since I
tend to think that Numeric is for, well, numeric (viz, floating point)
stuff.  At least that's how I remember it being described...

>> "enum Foo { Bar, Baz, Beep }" is just much nicer than "(Bar, Baz,
>> Beep) = range (oh-how-many-elements-again?)"
>
> There's an enum library that handles this reasonably (the range thing is 
> indeed lame).

I have to admit that I could sympathize with him if he replied to the
effect that chasing around after third party libraries didn't give him
a warm and fuzzy feeling.  BTW, Google found a bewildering assortment
of things for "Python enum" - which one did you have in mind?

-- 
In terms of utility rather than dollars, I can spend "nothing"
(which to a first approximation is the value of a dollar out of my
weekly budget) to get a non-zero chance of completely changing my
life.  Or, in yet other terms, I can just wait for them to send me
the check by mistake, which can't be *that* much less likely than
actually winning [the lottery].  -- David Dyer-Bennet



More information about the Chicago mailing list