If it matters THAT much performance to you dopes. Python can deliver, Python is coded in C and is highly embeddable into C / C++ projects. This allows you to not just leverage the power of other libraries coded in C / C++ but also achieve such power without the drawbacks of the complexity of programming too much in those languages. You could code the server in Python 3.6 with types, and use UVLoop which drops in with asyncio and just gives it a boost. So if you use the standard Python networking libraries, you can benefit from others adding on to it, as well as having it as an optional import. If it doesn't import, just use the built in networking. If you really care about the speed you can go native. If you want the JVM you can have it. If you want the CLR, you can have that too.
Python UVLoop:
https://magic.io/blog/uvloop-blazing...on-networking/
If he ever drops this project from Python I would definitely find my own time to implement this server with completely modern approaches (starting with the latest stable version of Python 3) and build up from the standard libraries. Python is still my bread and butter, and it's used by real companies all over for all types of mission critical projects (not making this up).
https://www.python.org/doc/essays/comparisons/
See the C++ section. Python can achieve amazing speeds, the types of speed issues you're on about only matter in the IoT world, or in the 1990's. This is 2016, people have amazing hardware to run Python code off of. C++ is great for graphics development, but then embedding a scripting language like Python becomes sane once you've implemented the performance hungry portions. You could probably code a whole server in Python, create extensions in C / C++ and finish within months, long before a C++ programmer has much working without over 9000 memory leaks and bugs they can't seem to figure out because this sections full of kids.
Python is productive, and powerful, if you neglect the current standards you will miss out on it's beauty. I myself keep finding out better ways to do things in Python, and the nicer ways I find of doing Python code, the more I love it. I can run Python anywhere on any OS and not worry about much. I know if I truly need to extend it I can. I know plenty of Linux OS' use it internally. Hell I've seen Lua scale like crazy as a back-end web server language. itch.io is exclussively coded in Lua. :)
The only thing right now preventing me from creating this as a multi-platform application is because I'm using winsock, which can be easily swapped out.
Last edited by Quackster; 27-09-16 at 09:44 AM.
My interest in this project lives with the Python side, guess I'll have to feed that interest on my own time. :) Sadly your git repos aren't really available so I can't tinker with the Python as it was left.
Should've opted for Golang, fool
I noticed my links were messed up, here you go fam: https://github.com/Habbotard/Icarus-Python
If I wanted to use C++ I'll use C++, there's no "should've". Sorry.![]()
3rd time, what's next?
For me its:
C++ > Java > Python
When properly written, C++ will outperform both languages. But then again, every problem or application has its own best solution. Only reason I would write something in Python is for like a web api or some other web stuff that requires calls. No big programs. If I need high performance I would go with C/C++.
@Quackster:
Is your source code anywhere publicly available? I would love to see all the memory leaks you're creating! (No jk, just want to give some feedback)
Also, why Visual C++??? I mean out of everything you could've picked you pick THAT.
PS: Avoid this-> all together in C++. Except when you're having ambiousity (Or however you write it) or have to pass a pointer to a function. Its cluttering and the majority of the C++ community avoids this as much as possible. Use naming conventions.
Also you have atleast 2 memory leaks in your Request class.
Also you read a short but return it as an int. Int is platform depended and may not always be equally sized as a short. (My suggestion don't use int at all but use long (Or even better use int<bitsize>_t eg int32_t)
I don't think you have to cast the chars to unsigned char in readShort. (1: They keep their bit pattern anyways, 2: you already read from an char*)
I wish you luck, because you will need it.
Because the reason they picked python for it is because they can easily without too much hassle make it distributed. Something which is also possible in C++ but is a bit more difficult to implement and maintain.
Its also the reason why a lot of these services (reddit, paypal, google) moved from Java to Python. The JMS is just slower and it was easier to move to Python.
Last edited by The General; 27-09-16 at 11:11 PM.