Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
big app in python
#11
The "memory issues" could mean a lot of things. If it's the "stop the world" stuff that you get from Java's type of garbage collection, Python does not have that issue and instead there's constant overhead around GC (which many of us find fine, but Java is often considered "faster" because of this). If it's memory leaks, then Python is at least on par with Java in that regard.

Without more information it's hard to tell. It really doesn't sound like an issue though.

He should also check out PyPy or something if performance is a concern, or Jython (which I'm personally not a fan of) or using ctypes or other ways of binding lower-level code to a Python program when it's necessary. Not sure that PyPy optimizes for memory but it's just another example of Python's ecosystem being constantly improved, unlike Java, which is struggling hard to keep up with modern languages. The upcoming Java 9 has some cool stuff coming in it but still doesn't have things that, after using Python and Scala, I really miss when using Java.
Reply
#12
(Feb-10-2017, 03:46 AM)micseydel Wrote: The desktop software I use is written partly in Python

nice.  i wonder if that can run under xtightvnc.  i am wanting to set up a multi-X (about 16 to 20 instances) system accessed by vnc.  i am using unity right now but not really committed to it.  the other day i tried to start up unity under xtightvnc but it crashed every time.  maybe another DE will be the one to use.  my plan is to make a vnc multiplexer that gives me buttons to click on to switch desktops (that run as different users).
Tradition is peer pressure from dead people

What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
Reply
#13
I really like Python, that's a fact.

Personally, since I have done a lot of embedded work, I would have to see a real example.

Let's say for an example, a 4x4 keypad matrix (membrane where de-bounce is simple),
totally interrupt driven, in both 'C' and Python with a fail rate of no more than 1 in 100,000.
Or, critical waveform generator with changing (yet controlled) pulse width, nothing difficult,
simple high and low switching using a timer.

If I could see that, perhaps I'd write the code in Python.

More likely, I'd write a hybrid, with time critical operations in 'C' and everything else in Python.
Reply
#14
(Feb-10-2017, 02:01 PM)sparkz_alot Wrote:
(Feb-10-2017, 01:20 PM)Ofnuts Wrote: he is telling me about some major shutdowns caused by out of memory issues.

I would think that is the least of fracking's issues

he has told me of many.

i have seen no memory issues.  but i have not yet written any complex stuff that is also long-time running.  he does point the finger at windows a lot, too.  i think i have talked him into using linux, more.  he has run it before.  i just want to make that big argument why he should get into python as opposed to something like perl or go or lua.
Tradition is peer pressure from dead people

What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
Reply
#15
(Feb-11-2017, 03:20 AM)Larz60+ Wrote: More likely, I'd write a hybrid, with time critical operations in 'C' and everything else in Python.

If you have time-critical stuff, then you won't be on Windows or Linux... Or you are gong to write a lot of device driver code. Otherwise your process can remain on the execution queue for a god part of a waveform period. But C(*) on an Arduino controlled from Linux, possibly.

(*) At least the Arduino flavor ...
Unless noted otherwise, code in my posts should be understood as "coding suggestions", and its use may require more neurones than the two necessary for Ctrl-C/Ctrl-V.
Your one-stop place for all your GIMP needs: gimp-forum.net
Reply
#16
Quote:If you have time-critical stuff, then you won't be on Windows or Linux

True, but the display portion may be on windows, or linux ... That would be in Python.
A perfect example was a production test program for a marine fish finder keypad (actual application)
In the actual application, I wrote the display in C++ (wasn't using python at the time)
Reply
#17
This might be heresey on a python forum, but python isn't good for everything. If the #1 issue is memory management, and the java garbage collector is a big issue, then I'm not convinced that python would solve the problem.

I'd suggest rust.

Unless they're not looking to rewrite what they already have, and are just looking for other projects. In that case, absolutely go with python.
Reply
#18
(Feb-13-2017, 01:06 AM)nilamo Wrote: This might be heresey on a python forum, but python isn't good for everything. If the #1 issue is memory management, and the java garbage collector is a big issue, then I'm not convinced that python would solve the problem.
I don't mind reasonable criticisms / critiques (e.g. trade-offs) of Python. Could you elaborate though? What does Rust have or Python that you think has been brought up in this thread?
Reply
#19
If there's a large project, written in java, and it somehow has memory leaks, then I think rust would be a great fit. The language itself would make leaks very difficult to get, and all resources are freed when the go out of scope (without a garbage collector). And if he, or his team, is used to static type checking tools, it would fit right in with that, as well.

I think python is a great language, that can be used to solve a large number of tasks, but sometimes, the hardest problem to solve is the people you're working with.
Reply
#20
I think the original issue is poorly defined. It's not necessarily memory leaks, it could for example be Java's "stop the world" garbage collection. Memory leaks are very rare in Java in and a bit rarer in Python. I wasn't familiar with Rust's style, but I just read this and it seems to be a slightly optimized version of what Python does (note: smarter implementations of Python than CPython could accomplish the same thing as Rust already does; I wouldn't be surprised if PyPy already does it, though I haven't looked).

Rust seems great but I don't think it's any safer than Python at memory leaks or stop-the-world issues. Since it's lower level and compiled, there will be less overhead but I wouldn't recommend a lower level language because of overhead unless the overhead is actually a problem.
Reply


Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020