515 karma · joined Dec 27, 2017 (8y ago) · 421 submissions
comment 8y ago · link · parent
Totally agree. I tried some time ago, was quite hard to setup. If they can mypyc just work out of the box, it would be really nice.
Compiling python to C not only has obvious performance advantages but also the fact that it will enable a Web Assembly compilation target to be a thing.
comment 8y ago · link · parent
The `multiprocessing.Pool` uses a `multiprocessing.Queue` in the background to retrieve the results after completion.
The `multiprocessing.Queue` in turn uses `multiprocessing.connection.Pipe` and sends the pickled objects over to the wire.
So I don't see how this is any better than ZMQ.
Just because stuff has an API that doesn't look like message passing doesn't mean it can't be doing that in the background. Which is funny, because that's the whole point of ZProc.
I realize the subtle difference that Cpython uses pipes, not sockets, unlike ZMQ. But that doesn't really make a difference now, does it?
Proof:
Process Pool worker, returning the result by using `outqueue.put()`
https://github.com/python/cpython/blob/86b89916d1b0a26c1e77f...
multiprocessing Queue, initializing a Pipe
https://github.com/python/cpython/blob/86b89916d1b0a26c1e77f...
multiprocessing Queue serializing data to send it using that Pipe
https://github.com/python/cpython/blob/86b89916d1b0a26c1e77f...
comment 8y ago · link · parent
Please don't do this. Documentation isn't an rfc. It's meant to be a _content first_ WEBSITE!
- plain html with little styling. Use the standard documentation themes if possible ( like read the docs )
- lots of cross references. Each class/func should be referenced back to it's API. (Sphinx is really good for this)
comment 8y ago · link · parent
You could easily interpret that as -
Perfect _implies_ that it's easy to write and understand, but it's not the whole picture. It's just a feature that _he_ thinks is _crucial_ to it being perfect.
You get my point right?
Like sure, you could implemented a _perfect_, I don't know like gnome desktop in assembly language, but it wouldn't be easy to write and understand.
He thinks it's essential that it should be easy to read and write for it to be perfect.
Unfortunately, He's not with us now so can't even confirm :(
comment 8y ago · link · parent
How is catching bugs at runtime and dynamically typed language related?
In fact I've had (a lot) better experience debugging mpy apps than Arduino ones (that's the only low level embedded experience I have)
I mostly just let stuff fail, and have them restart gracefully (like the erlang guys)
comment 8y ago · link · parent
Won't argue about pyboard, because that's more of a gimmick. (Way too expensive for what it does)
I think the cost and time of developing on micropython vs a lower level language like C, would superseded the cost associated with wasted cpu cycles.
However, I agree with the fact that no real product would use mpy right now in production because of the infancy of the project.
It certainly looks promising.
It's definitely NOT a toy.
OTOH JS is just a bad choice for this kind of work IMO. ( I'm a firm believer that JS is just a bad choice for anything in general, but IOT is just madness)
comment 8y ago · link · parent
https://github.com/pycampers/zproc
I use it in a couple of my own stuff which I have open sourced yet.
I do plan to release them, and I hope I can prove the usefulness of the library using those...
professional (corporate) stuff would be a far fetch for me, obviously.
comment 8y ago · link · parent
http://zguide.zeromq.org/page:all#Multithreading-with-ZeroMQ
Thought linking it there would make it better, but I'll just remove it...
And you do make a good point. It doesn't really solve anything technically. But would you agree that it exposes a better API for doing much of the same stuff?
comment 8y ago · link · parent
If you could point out some stuff from ZProc's page, that would be nice!
> mpi is the grandfather of message passing libraries
Never heard of it before, but just a simple google search reveals that it _might_ be more performant than zmq, but not as fault-tolerant and flexible. It really looks like a niche thing, from this comment by peter hintjens
> Why smart cloud builders are betting everything on 0MQ. In detail, compare to the alternatives. Hand-rolling your own TCP stack is insane. Using any broker-based product won't scale. Buying licenses from IBM or TIBCO would eat up your capital. Supercomputing products like MPI aren't designed for this scale. There is literally no alternative.
(http://zeromq.org/docs:the-ten-minute-talk)
> Don't get me wrong, message-passing has some advantages, but they certainly aren't that it 'solves' parallelism.
Doesn't it? (For most people)
---
I can't believe I'm hearing words against zmq on HN, its wierd.
Even the guys over at Dask settled on ZMQ over anything - https://github.com/dask/distributed/issues/776
P.S. Seems like you know quite a lot about this topic. Do you have any projects of your own that I can see?
Bottom line, I think most people would be happy doing message passing parallelism in the real world. Sure, it doesn't look that good in theory but works damn good in practicality.
comment 8y ago · link · parent
Was a damn good read, Thanks!
comment 8y ago · link · parent
In fact, I think Performance centric development is a lesser known evil.
> have all your data before creating your processes/pool
Zproc exposes the required API for this (Nothing new, just the python API) :)
https://zproc.readthedocs.io/en/latest/api.html#zproc.Proces... (args and kwargs)
> a massive dataset
Wouldn't you be better off using a Database for that kind of work?
> Because of copy-on-write fork magic, many multiprocessing configurations (including the default) can "send" that data to child processes in constant
timeAny resources on how to implement that?