20 votes

Topic deleted by author

15 comments

  1. [5]
    aphoenix
    (edited )
    Link
    I don't think this is a really effective question, to be honest. I think as with most things, there are pros and cons to most languages. But we can probably get some kind of answer. Consider the...

    high performance programming language would you recommend to any programmer?

    I don't think this is a really effective question, to be honest. I think as with most things, there are pros and cons to most languages. But we can probably get some kind of answer. Consider the general tiers of programming language speed (from http://forums.xkcd.com/viewtopic.php?t=108685)

    Tier 1 (fast-fast): C++, C, Ada, Fortran, ATS, Rust.
    Tier 2 (fast): Java, LuaJIT, Julia, Haskell, Scala, Ocaml, C#, Go, Common Lisp (SBCL), Pascal, F#.
    "Fringe" (fast-ish): Clojure, Racket, JavaScript (V8 and others), Dart, PyPy.
    Tier 3 (intermediate): Erlang HiPE.
    Tier 4 (slow): Erlang, PHP, Smalltalk (VisualWorks), Lua, Perl, CPython, Hack, Ruby.
    Tier 5 (very slow): R, Matlab, Octave.

    One of the things that is notable is that the higher up the list the more "difficult" the programming language becomes (though I'm not really sure about calling them difficult, hence the quotes).

    I think there are a few in Tier 2 that I'd be happy to recommend. Scala, Go, Lisp, Haskell.

    Edit: I would definitely recommend Rust - it's fast and pretty great for the programmer.

    Usually I recommend to people that they start (and end) in Python, but that's just because it's my favourite language, and it's generally beautiful.

    Edit: I updated the list. I actually copied this from an old comment, and in the intervening time Rust has moved from Tier 2 to Tier 1, so I moved it up accordingly.

    14 votes
    1. [3]
      dblohm7
      Link Parent
      Why have you placed Rust in tier 2?

      Why have you placed Rust in tier 2?

      4 votes
      1. [2]
        aphoenix
        Link Parent
        Oh interesting - since the last time I've copy and pasted this (admittedly a while ago) they've moved Rust up into Tier 1. When I linked it early, the forums were down, so I just went back to an...

        Oh interesting - since the last time I've copy and pasted this (admittedly a while ago) they've moved Rust up into Tier 1.

        When I linked it early, the forums were down, so I just went back to an old comment I'd made elsewhere and copy and pasted it.

        5 votes
        1. dblohm7
          Link Parent
          TBH, that was a mistake for them to have placed Rust in tier 2 to begin with; the entire point of Rust is to provide a systems language that may be used instead of C++, with memory safety...

          TBH, that was a mistake for them to have placed Rust in tier 2 to begin with; the entire point of Rust is to provide a systems language that may be used instead of C++, with memory safety guarantees along the lines of Ada.

          The fact that they had categorized Rust as tier 2 despite the fact that those former languages were tier 1 kind of baffles me. Oh well, at least it's fixed!

          2 votes
    2. Staross
      Link Parent
      Julia and LuaJIT should probably be Tier 1, they are as fast as C and Fortran and faster than both Go and Java. https://julialang.org/benchmarks/

      Julia and LuaJIT should probably be Tier 1, they are as fast as C and Fortran and faster than both Go and Java.

      https://julialang.org/benchmarks/

      1 vote
  2. [3]
    Comment deleted by author
    Link
    1. [3]
      Comment deleted by author
      Link Parent
      1. [2]
        Celeo
        Link Parent
        Honest question: how did you get past the ... weird procedure call syntax? It's kind of freaks me out with how many options there are; working on a project with multiple people seems like a ripe...

        Honest question: how did you get past the ... weird procedure call syntax? It's kind of freaks me out with how many options there are; working on a project with multiple people seems like a ripe opportunity for gross inconsistency.

        1. [2]
          Comment deleted by author
          Link Parent
          1. Celeo
            Link Parent
            Fair enough! I like that it's flexible; I guess I just have to pick a single option and stick to it.

            Fair enough! I like that it's flexible; I guess I just have to pick a single option and stick to it.

  3. arghdos
    Link
    Depends what you want to do really. I can pretty easily tell you the opposite however, AVOID OPENCL LIKE THE PLAGUE, unless you're lucky enough to be working on AMD hardware. NVIDIA's runtime is...

    Depends what you want to do really. I can pretty easily tell you the opposite however, AVOID OPENCL LIKE THE PLAGUE, unless you're lucky enough to be working on AMD hardware.

    NVIDIA's runtime is buggy, poorly documented, and there is lots of anecdotal evidence of them spiking CL to push people to CUDA.

    Intels' runtime is fast as hell, but gets segmentation faults during compilation if you even look at it the wrong way. Seriously, I've run into issues before where x + -1 * lid(0) (where lid(0) is a macro for the local id) will cause segfaults during compilation but x - 1 * lid(0) is totally fine. Their OpenCL forums are a ghost-town where bug-reports go to die.

    POCL is about the only halfway decent runtime in the bunch. It's robust, very responsive to bug-reports / issues, and has an active userbase of helpful people. But it has issues actually achieving vectorization -- it uses LLVM's auto-vectorizer, and which is pretty finicky.

    AMD's OpenCL runtime runs like a champ on their GPUs, haven't seen much (if any) speedup on my Intel CPUs unfortunately though.

    As an alternative, I've had fairly good experience with Intel's ISPC for CPU-vectorization.

    7 votes
  4. rib
    Link
    There's no one language to rule them all and there's more to a language than just speed. Often python is recommended for beginners because it's designed to be easy to read and learn. The...

    There's no one language to rule them all and there's more to a language than just speed. Often python is recommended for beginners because it's designed to be easy to read and learn. The performance of the language matters depending what you're writing for, sometimes the difference is negligible, other times not.

    5 votes
  5. [2]
    do_contra
    Link
    Lua is incredibly fast for a language that is high level as it is. It's even used in many videogames for this reason

    Lua is incredibly fast for a language that is high level as it is. It's even used in many videogames for this reason

    4 votes
    1. super_james
      Link Parent
      What video games use Lua for stuff that needs to be fast or memory efficient? EVE was written in python then optimized with c? c++? (I forget) bindings but that doesn't mean python is fast...

      What video games use Lua for stuff that needs to be fast or memory efficient?

      EVE was written in python then optimized with c? c++? (I forget) bindings but that doesn't mean python is fast...

  6. [2]
    Staross
    Link
    For numerical/scientific computing: Julia. Fast like C, easy like Python, expressive like Haskell.

    For numerical/scientific computing: Julia. Fast like C, easy like Python, expressive like Haskell.

    1 vote
    1. [2]
      Comment deleted by author
      Link Parent
      1. Staross
        Link Parent
        Julia is much closer to Python but you can also do some fancy pattern matching tricks # Haskell map _ [] = [] map f (x:xs) = f x : map f xs # Julia map(f,x) = f(x) map(f,x,xs...) = (f(x),...

        Julia is much closer to Python but you can also do some fancy pattern matching tricks

        # Haskell
        map _ []     = []
        map f (x:xs) = f x : map f xs
        
        # Julia
        map(f,x) = f(x)
        map(f,x,xs...) = (f(x), map(f,xs...)...)
        

        And there's a powerfull type system, you can easily say things like "this function takes a number that is a real or a complex, and a diagonal matrix of the same number type":

        f(x::T, M::Diagonal{T}) where T <: Union{Real,Complex}
        
  7. Noxium
    Link
    Any language is high performance if you use it right, so it really depends on your particular context. Assembly is a high performance language in terms of optimization but I would never use it to...

    Any language is high performance if you use it right, so it really depends on your particular context. Assembly is a high performance language in terms of optimization but I would never use it to implement complicated algorithms, OTOH Python is pretty good for complex algorithms but I would never use it for hardware level programming or in resource-strained environments. For a beginner seeking a language that is easy to learn and practical I would suggest learning python, but every good software programmer should probably know C/C++. Even though they aren't exactly the most widely used languages anymore, knowing them lets you understand the magic behind higher level languages a bit more imo

    1 vote
  8. jgb
    Link
    You can't just rank languages on a linear performance scale. It's way more complex than that, and few benchmarks do a good job of modelling real world applications. Besides, a language being...

    You can't just rank languages on a linear performance scale. It's way more complex than that, and few benchmarks do a good job of modelling real world applications. Besides, a language being theoretically fast is limited in its utility unless it is feasible for a developer in the real-world to consistently and efficiently produce code that is close to optimal in performance terms.