Paul Rubin wrote:
> Les Cargill <
lcarg...@comcast.com> writes:
>> Threads are absolutely no problem but it's nicer to have options.
>
> The Python community seems to mostly hate threads and prefer Twisted, so
> I'm in a bit of a minority. I found Twisted confusing and too Java-like
> the one time I tried to use it. It has better performance than threads
> so I've figured I'd have to get familiar with it someday, but have
> avoided it so far and now I have hopes that the new asyncio library may
> make it unnecessary.
Huh. Well, I'd expect them to catch up. Thread aren't *bad*; thy're
better when the system is run-to-completion, which isn't common these
days.
> There are also alternative languages like Erlang,
> Haskell, and Go, that have high-performance concurrency that looks like
> threads/processes to the user but are implement as async under the hood.
>
Those are on the list too, but it's a real Tower of Babel out there :)
>> I've been repetitive about this because I sometimes get to evangelize
>> in real life about testing frameworks for embedded stuff.
>
> I'm pretty interested in this and would be happy to hear about any
> recommendations you might have.
>
It's all good, really. The main thing will be what you're comfortable
with and you won't know that until you try.
I've glommed onto Tcl because you just open a serial port or a socket
and whale away. If you have, say, a USB device, I'll write 'C' to
operate it and load up a pipe in Tcl to drive it.
This goes back 20 years to a hard-to-find bug on a relatively simple
system where we actually built an exhaustive test jig that got run
continuously for days every release. Put in instrumentation at every
branch point and worked on the jig until we proved we executed every
path. We generated all the permutations of events and made that into a
"script" that would run repeatedly.
There are prepared frameworks but they can be tricky and they're
targeted at bespoke test as a job function, but at developer testing.
This is harder for things that implement, say, layer 1 comms stuff. But
those are often tractable by connecting to both ends and writing pattern
generators, or setting up and tearing down cross connects. If you can
buy COTS testers it's arguably better, but sometimes you can't.
>> One thing I've clarified with this thread ( thanks, guys ) is that
>> Python is closer to a replacement for 'C' than other roles I was
>> trying to hammer it into.
>
> Yeah, most of my stuff in the past decade or so has been in Python.
> When I write anything in C these days, as I've written elsewhere it
> feels like a "back to nature" experience.
>
For anything complicated, I end up writing C++ wrappers for freely
available 'C' libraries, generally. This is domain-dependent, of course.
This is purely to make the programs shorter; it's
not very "OO". I did this for the leverage, not the methodology.
FFTW and libsndfile both got this treatment.
Since my day job is embedded, I don't use a whole lot of Python. Perhaps
that will change.
--
Les Cargill