Better HN
topnewbestaskshowjobs
Log inSign up

devxpy

515 karma · joined Dec 27, 2017 (8y ago) · 421 submissions

https://github.com/devxpy
Submissions

comment 8y ago · link · parent

Yes, but isn't it more CPU intensive?

(Speaking purely from experience. Don't have a fancy CS degree)

comment 8y ago · link · parent

That's not my claim man, its written in the zguide

http://zguide.zeromq.org/page:all#Multithreading-with-ZeroMQ

Maybe I should've just linked it there,sorry!

Okay, I will take that course and get back, thanks for the suggestion.

P.S. You just implied Pieter Hintjens is naive. You have to live with that now :(

comment 8y ago · link · parent

Great, now just "stating" how things work is equivalent to inventing them!

comment 8y ago · link · parent

> "high performance"

I never claimed it to be performant!

"Above all, ZProc is written for safety and the ease of use."

(Read here - https://github.com/pycampers/zproc?files=1#faq)

> It's not a revolution

I totally agree. It's just a better way of doing things zmq already perfected. Like, tell me if you've ever seen a python object that has a `dict` API, but does message passing in the background.

> central (pubsub?) server.

Central server, yes. It uses PUB-SUB for state watching and REQ-REP for everything else.

> you've just "discovered" message-passing

Guess you're right? 2 years is a peanut on the time scale...

P.S. Thanks for all the feedback, I've been dying to hear something for a while now.

comment 8y ago · link · parent

You must be some sort of programming GOD, I guess.

The problem is that its _hard_ to get right.

For example - It's not trivial to use locks when you're working at an abstraction level higher than operating systems. Most people don't even realise there is a race in their application, because locks are inherently non-enforcing. Code written in locks is also really hard to read and reason by.

Message passing just makes it a little more trivial to avoid the pitfalls associated with parallel programming.

I also found that it lets you avoid busy waiting in certain places, which is always a performance advantage :)

Can you shed some light on those "idiot-proof thread-safe datastructures"?

comment 8y ago · link · parent

I believe that since the Advent of zeromq, parallelism is possible in almost any language, including python.

My library lets you do parallelism in a unique way, where you do message passing parallelism without being explicit about it.

https://github.com/pycampers/zproc/

comment 8y ago · link · parent

> deal with serialization and communication

I thought a lot about this problem, for over 2 years, and came up with zproc

https://github.com/pycampers/zproc

Basically,

> It lets you do message passing parallelism without the effort of tedious wiring.

You'll be doing message passing without ever dealing with sockets!

Also, Shared memory parallelism is hard to get right irregardless of which language you use. I would recommend strongly against it, unless you're writing some really really really niche thing where message passing is a bottleneck (it isn't most of the time)

comment 8y ago · link · parent

I don't know man. Have used docopt, but click just feels right to me.

I never have to think about the "CLI" when using click, everything "just works"...

http://click.pocoo.org/5/why/#why-not-docopt-etc

comment 8y ago · link · parent

I have tried this before, and all I can say is that you should probably just use click over anything else.

http://click.pocoo.org/5/

comment 8y ago · link · parent

Don't leave out NAT PCP (RFC6887)!

It's a must for p2p communication

https://tools.ietf.org/html/rfc6887

comment 8y ago · link · parent

If you are using safari/chrome you can use reading mode.

For chrome there is a switche at settings > accessibility > show simpified view

comment 8y ago · link · parent

Yeah,the only sane way to do parallelism is message passing. (preferably using zmq)

comment 8y ago · link · parent

Are you using gnome?

And a slow hard disk is often the bottleneck, in case of windows.

comment 8y ago · link · parent

Maybe "pure" python can't do fast sound processing, I can accept that. You have to at least use scipy/numpy. But his claim of "Python can't keep up with real-time requirement of RTP, bursting out packets every few milliseconds" seems bogus to me.

comment 8y ago · link · parent

Oh, and ftr - I'm "bursting out packets" at 10ms intervals. I have tried 5 and the problem still wasn't speed, it was the cracking noise caused by such small samples

comment 8y ago · link · parent

Oh boy, I just wrote a 100 line client and another 100 line server that is able to do real time voice communication, comparable to the likes of telegram. (In python)

Albeit it uses portaudio (python-soundevice) for the audio IO which is not written in python, and opus which isn't written in Python either. But all the glue and udp communication is pure python.

And P.S. - pulseaudio uses more CPU than my thingy.

Talking about production, I suspect the guys at OnBeep are making use of python a lot, just looking at their GitHub repo

https://github.com/OnBeep

(The python opus bindings are created by them)

I'm just tired of people underestimating the speed of python. Its often a matter of not using it correctly...

comment 8y ago · link · parent

Can you please lay out the differences between this and Dask? https://dask.pydata.org/en/latest/

I work on a parallel programming framework for python myself. Not geared towards performance, but the ease of use. http://zproc.readthedocs.io/en/latest/

comment 8y ago · link · parent

https://docs.python.org/3/reference/datamodel.html#customizi...

comment 8y ago · link · parent

Wierd. Maybe it's just me, but I felt that way for the first 2 days.

I have made some really dynamic stuff (like 100 domains running off a single server with each of their data separate, and to add a new domain is a click away) . I can't imagine doing that with other frameworks

> get_attr

What the fuck is that?

Also, you might be interested in webpy

http://webpy.org

> “Django lets you write web apps in Django. TurboGears lets you write web apps in TurboGears. Web.py lets you write web apps in Python.” — Adam Atlas

comment 8y ago · link · parent

It is when you get to this part of python, that you achieve true Nirvana.

It's absolutely bonkers the extent to which you can be dynamic in this language.

It's the very reason why Django is so DRY.

comment 8y ago · link · parent

Did you stop to think that the reason you like dart so much is that you're coming from javascript?

JS is not a real language, coming from python.

comment 8y ago · link · parent

Thankfully, the community is really welcoming. Not like RN where issue are closed for no reason all the time..

comment 8y ago · link · parent

To add to this -

* Developing plugins (to use native code functionality) is fairly easy. I recently created a PDF viewer plugin for Android without any prior knowledge of java, in 2 days.

* Dart has smaller ecosystem but dart is a real language with a batteries included std library. I don't think I need to state the superiority of dart as a language.

* Flutter's non native components make it easier for you to customize them

* Flutter doesn't have an obvious way to use native views in apps. You can launch native views but compositing native and flutter views is a bit weird right now.

* The ease of use in the development cycle is phenomenal. Nothing like I've ever seen in UI dev.

comment 8y ago · link · parent

Thanks for the detailed explaination.

comment 8y ago · link · parent

Happens with me too. I sometimes don't realize how my words come out.

Anyway, is there any reason as to why one would not use more mature languages like erlang and recently, dart? They also have the concept of isolates, that can't share memory.

Apart from the written in rust part which is really cool.

comment 8y ago · link · parent

Honestly though, it Just a really fancy wrapper over zmq.

I just gave everything I learned from the zmq guide a pythonic interface. :)

comment 8y ago · link · parent

> data race conditions impossible.

Are you sure? Using message passing doesn't magically make stuff immune to races. You Still have to think about atomicity.

Here is an excerpt from the documentation on my multiprocessing library, zproc.

http://zproc.readthedocs.io/en/latest/user/atomicity.html

comment 8y ago · link · parent

We still have this in Indian colleges.

comment 8y ago · link · parent

> compose able by default

You're looking for click

http://click.pocoo.org/5/

It's the best framework across any programming language that I have found for building command line user interfaces.

I instantly know how to use an application made using click because it prevents you from making non-obvious GMO interfaces.

Even as a developer, I love using it. I often create CLIs for common chores in my projects using click. The applications always come out perfect, with little to no effort.

I wish there was something like this for GUI.

This makes me want to make a GUI framework like click, where you don't deal with the bare components, but "compose" your UI by just providing data

comment 8y ago · link · parent

being a CS major in India, I can't help but call bullshit.

Knowledge, maybe. But when you put them in front of a computer, they can't write code. (Your mileage may vary though)

I'm in my 2nd year, and it's incredible how these teachers teach computer science without computers. The ironic thing is that they have projectors in classes. They even have laptops. Most of my peers have laptops, I think. And still they teach with a blackboard.

Just yesterday, my shell programming teacher wrote out the output of `ls -l` manually, by hand. She literally had it memorized. And said that we have to memorize it too, because of course, computer science is a written exam :)

I never expected to see this kind of response on HN. Some of these people don't know how to turn on a computer, and keyboard typing is a long stretch. You really don't know what you're dealing with here!

The admission process is fully exam based (physics/chem/math). I wasn't asked once, in the entire admission process whether I had ever used a computer in my life. Most parents don't let their kids use computers because they think it will spoil their childhood. I was fortunate enough to have good access to Internet and computers in my home. I admit that I spent a lot of time playing games, but I totally have a better understanding of how computers work. At least I'll be a cs major who actually knows how to code...

1
1112131415