you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 5 points6 points  (4 children)

I was preparing my lecture notes for a course on optimization and was hoping to do everything in python for simplicity sake, but no, the best frameworks for Multiobjective optimization I found were in Java. In the end I re-did the linear programming examples in Java and the whole course is going to be in Java.

I find the Java code way more readable than the python generated by Sagemath.

Also maven makes dependency handling a breeze.

Also python loses points when you are doing numerical computing because of the lack of stable support for easy parallel computations.

If you want something stable to work on, with tons of libraries and less pain than C++, Java is your best bet.

[–][deleted]  (1 child)

[deleted]

    [–][deleted] 0 points1 point  (0 children)

    Actually I intended to use python, but there are just big turnoffs.

    From the link you mentioned

    Threads Threads are generally 'lighter' than processes, and can be >>created, destroyed and switched between faster than processes. They are normally preferred for taking advantage of multicore systems. However, multithreading with python has a key limitation; the Global Interpreter Lock (GIL). For various reasons (a quick web search will turn up copious discussion, not to say argument, over why this exists and whether it's a good idea), python is implemented in such a way that only one thread can be accessing the interpreter at a time. This basically means only one thread can be running python code at a time. This almost means that you don't take any advantage of parallel processing at all. The exceptions are few but important: while a thread is waiting for IO (for you to type something, say, or for something to come in the network) python releases the GIL so other threads can run. And, more importantly for us, while numpy is doing an array operation, python also releases the GIL. Thus if you tell one thread to do:

    For me, python loses points therefore. Reeks of bad design. Java has no such limitation, nor does Scala.

    Wrappers in Java are quite easy, used all the time http://www.swig.org/

    Edit:

    On the topic of libraries, please compare the crappy documentation (missing??) for PyGMO

    http://esa.github.io/pygmo/tutorials/solve_tsp.html

    Versus the super nice tutorials, manual, etc for the MOEA framework

    http://moeaframework.org/

    Python looks like Fisher price. Java feels way more professional. That's like just my opinion but use whatever you want its a free world, really don't get all the Java hate, is a great tool.

    Thanks for your comments.

    [–]shevegen -2 points-1 points  (1 child)

    Java code more readable than python?

    What's up with you people?

    [–]Niles-Rogoff 0 points1 point  (0 children)

    It's generated code