Announcement

Collapse
No announcement yet.

PlayOnLinux 5 To Switch From Being Written In Python To Using Java

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • #41
    I know this isn't a wish-list and the move to Java is already decided... but anyway:

    I'd choose a typed language over an untyped any time, if the program is going to be larger than a few 100 LOC.

    If there is really a problem with code quality, I'd go with something like rust(*). You'll also get rid of memory leaks at the same time, too. Coming from C++, I'm using it for new stuff and so far, I like it a lot. The compiler is very helpful and like C++, you can code for any machine out there (I've even seen examples of ?c-programming using that language).

    When using rust, you can create the GUI in Qt/QML. That yields a nice separation of core and GUI stuff.

    For the user scripts, I'd probably investigate the usage of lua. It's quite embeddable and compiles to a few 100 kiB. So in total, I estimate the resulting binary to be around a few megs + sizeof(Qt).


    (*) I know, it's still young, but it has convincing features and there is already a working version of PlayOnLinux so there is no pressure to release something *now* in case developments takes a bit longer.

    Comment


    • #42
      Originally posted by nikiiv View Post
      Huh?
      Someone also commented that Java is notorious for memory leaks.. Every language that depends on reference counters is as prone to memory leaks as Java.. Refresh my memory, does Python depend on that..
      FWIW, Java doesn't mysteriously leak memory. The cases that cause memory leaks are PEBKAC. Java's memory management is actually more efficient than normal reference counting. Sure, it requires 2x memory to work optimally, but it's not really a leak. You can also write Java code in such a way that it doesn't allocate constantly. I'd blame stupid libraries and OOP coding practices.

      Comment


      • #43
        Originally posted by nikiiv View Post
        Frankly if I didn't hate Java in the guts I would join the project, but Java doesn't excite my anymore... Still Java is a great choice, rock solid and dependable for this project.. As would be Mono/C# for example..
        I am the first who would support the decision for Mono/C#, since this is what I've been using for many years (nearly since the beginning). C# is an awesome language, and the language features are excellent, but in the case of POL, the Mono runtime probably was the wrong decision, since there is no comparable cross-platform UI like JavaFX or Swing. There is only gtk-sharp which seems to be somewhat abandoned (when you look at the commit-history of gtk-sharp - at least there was a huge pause).
        And QtSharp, which is underway, but unfinished - at least for Linux.
        I will not talk about Windows Forms, which is just ridiculous.
        Last edited by seijikun; 05 June 2015, 07:32 AM.

        Comment


        • #44
          Originally posted by nikiiv View Post
          Someone also commented that Java is notorious for memory leaks.. Every language that depends on reference counters is as prone to memory leaks as Java.. Refresh my memory, does Python depend on that..
          CPython uses reference counters, but periodically goes through and cleans up otherwise unused reference loops. You can force this using the "gc" module. Not all python implementation use reference counters, though.

          Comment


          • #45
            Originally posted by oleid View Post
            If you'd have said haskell, I'd agree. But what's wrong with Python on Gentoo? Python stuff is working just fine, here...
            Yeah, when it's running, everything is just fine. But I often have to run the python-updater because during system updates, the compiling just crashes with some fishy compiler error in some python-libraries. The same problem I've got with perl.

            Comment


            • #46
              A pointless discussion I belive. Same way they could just write the POL in COBOL as it is ultra good for handling large batch of info moving though it. But why? POL is supposed to be just a GUI application in front of Wine to make installing and uninstalling stuff easy. Thats it! There is no need to write a ultra optimized application for such a task. What is important is that the code that will be written would be easily maintainable.

              To those people saying Java GUI application are bad, please download a product from Jetbrains and use it a bit. The thing is written using Swing for it's GUI and it is fast and works well.
              What I want to say with this is that you can make a very polished GUI application in Java also. It all depends of the developers making it. A bad developer will make a bad application in any language.

              Comment


              • #47
                Originally posted by nikiiv View Post
                Huh?
                Albeit technically valid (well beside the lack of patter matching, as it has) the rest is syntactic sugar. Every one choosing a language over syntactic sugar should .. well I am not going to put a label on that, cause generally I try to avoid putting bad labels on people...
                I'm not sure what you're confused about. Everything I stated in that list is true. In particular, (and forgive me if I'm misreading your comment), Java does not have pattern matching. Unless you count "switch", I guess...?

                Oh, and anything more than (for example) the SKI combinators or raw Turing Machines, is syntactic sugar. The thing is... syntax actually matters if you want to get anything practical done. There's a reason we don't program using the TM model. (Or Brainfuck for that matter. That's also Turing Complete, I believe.)

                Comment


                • #48
                  Originally posted by fabdiznec View Post

                  I'm not sure what you're confused about. Everything I stated in that list is true. In particular, (and forgive me if I'm misreading your comment), Java does not have pattern matching. Unless you count "switch", I guess...?

                  Oh, and anything more than (for example) the SKI combinators or raw Turing Machines, is syntactic sugar. The thing is... syntax actually matters if you want to get anything practical done. There's a reason we don't program using the TM model. (Or Brainfuck for that matter. That's also Turing Complete, I believe.)
                  I think that you are mixing up syntactic sugar and abstraction

                  Comment


                  • #49
                    Originally posted by caligula View Post

                    FWIW, Java doesn't mysteriously leak memory. The cases that cause memory leaks are PEBKAC. Java's memory management is actually more efficient than normal reference counting. Sure, it requires 2x memory to work optimally, but it's not really a leak. You can also write Java code in such a way that it doesn't allocate constantly. I'd blame stupid libraries and OOP coding practices.
                    It doesn't leak at all.. It is always a developer bug. In the history of JDKs there were several cases where a bug in the runtime caused memory leaks, but I can't remember a case like that in the past several years.. When i said prone, I meant that developers usually rely on automatic garbage collections and sometime create strong circular references that cannot be automatically released when the execution goes outside the scope of the declaring method/class. I like the way Sift added they syntactic sugar for weak references

                    Comment


                    • #50
                      Originally posted by qparis View Post

                      I think that you are mixing up syntactic sugar and abstraction
                      I don't think so. However, I'll state that I think both are important. (Which is why the lack of higher-kinded types and such in Java is annoying to say the least. There are even types in Java that can be inferred by the compiler, but which actually cannot be written in Java -- the "escape types" which are sometimes given in error messages for generics. This is madness.)

                      For example, A TM supports any kind of abstraction you want to build (that what Turing Completeness means), but the point is that you have to do so from scratch every time unless everybody agrees on a higher-level language and a semantics for said language. Hence C, C++, Java, Haskell, Scala, Ruby, Python, JavaScript, etc.

                      You still wouldn't want to program directly (if there were such a thing) for a TM simply due to the lack of syntactical convenience. Instead, you'd have a "standard TM library" which could be plopped onto any old TM and would bootstrap your own language first. This is also why almost nobody programs directly in assembler or direct machine code except people who have very specific needs and/or are masochists .

                      EDIT: Just to clarify: I'm not saying Python is better than Java, FWIW. What it does have is a lot less boilerplate. I'll pick strong typing over un(i)typed languages any time I have the choice. I do have extensive experience maintaining large code bases in both -- Java/Scala/Haskell on the typed side, JavaScript on the un(i)typed side. C# does away with a lot of the absurdly lacking syntactical convenience of Java (manually written getters/setters in 2015? Seriously?), but I don't have any practical experience with that and there might be cross-platform issues, so...

                      EDIT#2: A simple way to declare pure data structure objects (like Scala has) and a way to do local type inference (like e.g. "auto" in C++) might make Java a half-way decent language, but by today's standards it's not.
                      Last edited by fabdiznec; 05 June 2015, 08:35 AM.

                      Comment

                      Working...
                      X