Slashdot Mirror


Harlan: a Language That Simplifies GPU Programming

hypnosec writes "Harlan – a declarative programming language that simplifies development of applications running on GPU has been released by a researcher at Indiana University. Erik Holk released his work publicly after working on it for two years. Harlan's syntax is based on Scheme – a dialect of LISP programming language. The language aims to help developers make productive and efficient use of GPUs by enabling them to carry out their actual work while it takes care of the routine GPU programming tasks. The language has been designed to support GPU programming and it works much closer to the hardware." Also worth a mention is Haskell's GPipe interface to programmable GPUs.

195 comments

  1. MOV ES:[BP],#255,ecx,xyz !! by Anonymous Coward · · Score: 1

    Is not simple enough ??

    1. Re: MOV ES:[BP],#255,ecx,xyz !! by Anonymous Coward · · Score: 1, Funny

      I think that's supposed to be: ecx, xyz, M-O-U-S-E

    2. Re: MOV ES:[BP],#255,ecx,xyz !! by Anonymous Coward · · Score: 1

      A M-O-U-S-E bit my sister once.

    3. Re:MOV ES:[BP],#255,ecx,xyz !! by nospam007 · · Score: 3, Funny

      "MOV ES:[BP],#255,ecx,xyz
      Is not simple enough ??"

      That's only the old use of those cards, nowadays kids need functions like MakeBitCoins(500) or SETIFindET() and so on.

    4. Re: MOV ES:[BP],#255,ecx,xyz !! by Anonymous Coward · · Score: 0

      It must've been an ROUS... but, I don't believe they exist.

    5. Re: MOV ES:[BP],#255,ecx,xyz !! by Anonymous Coward · · Score: 0

      Now you ruined it completely by writing that angry comment instead of a proper friendly explanation.

    6. Re:MOV ES:[BP],#255,ecx,xyz !! by Anonymous Coward · · Score: 0

      GPU programming is done in C/C++ these days. CUDA and other languages essentially look and act like these languages, they are fairly simple because they have fewer operations.

      Adding declarative languages does nothing, since GPU programming is very limited in cycles and decls tend to be short code with high cycles.

  2. dialect of LISP by Anonymous Coward · · Score: 4, Funny

    I find it hard to believe ANYTHING derived from LISP could simplify anything.

    1. Re:dialect of LISP by marcello_dl · · Score: 5, Funny

      Because lisp-style languages are already simplified to the extreme, you mean? Phew, for a moment I thought I spotted a troll.

      --
      ---- MISSING MISCELLANEOUS DATA SEGMENT --- [sigdash] trolololol
    2. Re:dialect of LISP by smittyoneeach · · Score: 2

      The question is whether simplifying the syntax down to a nubbin really flattens the learning curve or not.

      --
      Get thee glass eyes, and, like a scurvy politician, seem to see things thou dost not.--King Lear
    3. Re:dialect of LISP by lxs · · Score: 1

      ((easy)is)lisp

    4. Re:dialect of LISP by aaaaaaargh! · · Score: 2

      Yes, it does.

    5. Re:dialect of LISP by ecotax · · Score: 3, Funny

      ((easy)is)lisp

      --------------------- ^ Missing parenthesis

      --
      "Money is a sign of poverty." - Iain Banks
    6. Re:dialect of LISP by Anonymous Coward · · Score: 1

      That's a question. The question is why does LISP persist with that syntax. There is a very very deep reason for this which you should discover for yourself. Once you've discovered that, the learning curve will be irrelevant for two reasons. The less important reason being you'll already be over it ;)

    7. Re:dialect of LISP by Bacon+Bits · · Score: 3, Insightful

      It certainly flattens the syntax learning curve.

      The algorithm learning curve on the other hand....

      --
      The road to tyranny has always been paved with claims of necessity.
    8. Re:dialect of LISP by dbIII · · Score: 1

      Wrong (very wrong (indeed it is as wrong as that incident last week (last week being in June)))

    9. Re: dialect of LISP by Anonymous Coward · · Score: 1

      Why does LISP syntax persist? That's easy, because programming languages are developed by geeks, and geeks think LISP is cool. (And it _is_ cool -- but that doesn't make it a good model for productive programming.)

    10. Re:dialect of LISP by smittyoneeach · · Score: 3, Insightful

      What, the unity of data and code?
      Sure, it's academically cooler not to kick your design out of the Garden of Eden, but let's not kid ourselves: besides performance, the other reason Lispy systems haven't conquered is that it's darn hard to have a business model that DOESN'T separate code and data to at least some degree.
      This is more an observation than a value judgement about the "rightness" of the situation.

      --
      Get thee glass eyes, and, like a scurvy politician, seem to see things thou dost not.--King Lear
    11. Re:dialect of LISP by Alomex · · Score: 3, Insightful

      Right, because the only possible way to equate data and code is to wrap it around in an untold number of parentheses. For example if we were to change

      (define X (blah blah))

      to

      define X = blah blah

      there is no possible way we could all agree that define returns a list and save the parentheses. /sarcasm

      Reality is there is no deep reason to layer scheme with so many parentheses outside the lack of imagination of scheme fanatics.

    12. Re:dialect of LISP by Charliemopps · · Score: 1

      You likely write code in a syntax that was derived from Lisp every day and don't even realize it.

    13. Re:dialect of LISP by Anonymous Coward · · Score: 0

      However, that should read

      define X = blah(blah)

      because you forgot to quote the list. You've saved one set of parentheses and no character to type (because of '=' and your statement needs a line ending).

      Another question is whether you are able call a function with itself as an argument in your preferred language...

    14. Re:dialect of LISP by ebno-10db · · Score: 1

      Then why bother with parentheses? Binary is an even simpler syntax.

    15. Re:dialect of LISP by Anonymous Coward · · Score: 0

      Instead of misguiding people online you would be better off studying SICP.
      Of course there is a very deep reason to correctly nest your code (and data) with these parentheses.
      Remember that in the end the parser all that knows are pairs (A . B) where B can be a pair and through
      this you construct lists. Now it is exactly this reasoning that lets you structure your code in pairs (or lists) too
      and through this syntactic unification you get all the interesting functionality that scheme enables.
       

    16. Re:dialect of LISP by Alomex · · Score: 1

      Only if you persist in using parentheses everywhere. If you really think about it the supposed symmetry between data and code is not really there, hence the quote. In other words no matter how hard you try to make it look like they are the same either you end up quoting data or you represent functions explicitly via the f( ) convention.

      The advantages of the latter are that (1) mimics math notation and (2) keeps the number of parentheses down.

      Another question is whether you are able call a function with itself as an argument in your preferred language...

      Algol had that already in the 60s without need for endless parentheses.

    17. Re:dialect of LISP by Alomex · · Score: 2

      You mean your "deep reason" was to aid a brain addled parser so that it doesn't have to cogitate about what is looking at?

      I thought you were aiming higher than that.

    18. Re:dialect of LISP by Anonymous Coward · · Score: 0

      enjoy your C++ ;p

    19. Re:dialect of LISP by squiggleslash · · Score: 1

      Well if all we're interested in is making the compiler happy, perhaps a different route would be to use FORTH/PostScript style RPN? This way the language syntax doesn't get in the way. And programmers can play the old FORTH "Try to make their code read like English" game which almost never works but once in a blue-moon kinda sorta does...

      --
      You are not alone. This is not normal. None of this is normal.
    20. Re:dialect of LISP by Anonymous Coward · · Score: 1

      Organic Digital Company, where the code is the description of business processes and the storage of the organizational memory, along with the data. The programmer are eligible to company weddings and burials. Wars are fought not by governments over natural resources, but by companies over the best samur..workers and shogu..leaders .
        Alright, alright, I'll put the Gibson away for now.

    21. Re:dialect of LISP by Anonymous Coward · · Score: 0

      I wrote code in a syntax that was derived from Lisp once.

      There is absolutely NO reason for the byzantine weirdness of it. It's a language for people who like to say "I program in a language very few people use, and therefore I'm pretty fucking cool."

      In other words, it's a hipster douchetard language - the Computer Science equivalent of PBR tallboys and trucker caps at an indie band's show in Park Slope.

    22. Re: dialect of LISP by Creepy · · Score: 1

      Yeah, my fundamental problem with LISP is that it's a scripting language, and that used to mean slow (especially before JIT compilers), but GPUs are designed for scripts. Personally I was never a fan of any language that made me count letters, so LISP and Scheme annoyed me with caaaaaaaaar and cddddddddr.

    23. Re:dialect of LISP by Lunix+Nutcase · · Score: 1

      So LISP programmers wear skinny jeans and emo glasses?

    24. Re: dialect of LISP by vilanye · · Score: 1

      The are native compilers for Lisp.

    25. Re: dialect of LISP by vilanye · · Score: 1

      I bet you love either C++ or Java, both of which have more parenthesis(and braces and brackets) than an equivalent Lisp program.

      There is a simple, logical and profoundly illuminating reason why Lisp syntax is what it is. That you can't or don't want to learn why this is so speaks volumes.

    26. Re:dialect of LISP by vilanye · · Score: 1

      There is a reason that only Lisp languages have the power to extend the language in a first class way, and that reason has everything to do with the parens.

    27. Re:dialect of LISP by vilanye · · Score: 1

      If you think there is no reason for the parenthesis or prefix notation you are sufficiently clueless that I hope and pray you don't write code for fun or money.

      It is people like you that are turning my once mathematical profession into a paint-by-numbers racket.

    28. Re:dialect of LISP by Alomex · · Score: 1

      First of all if you have a reason you have to spell it out. This I'm keeping it secret shows that you are not even sure about what you've got.

      Second of all what you said makes no sense at all. You can make C extensible "in a first class way" by making every keyword a function or by operator overloading and hence function declarations/overloading extend the language in a "first class way" without any parentheses whatsoever.

    29. Re:dialect of LISP by vilanye · · Score: 1

      No you cannot. You can fake it, and maybe get 25% of the way there in C but it is not like Lisp.

      There is no other language that can implement the power of Lisp macros.

      A first class way means an extension to the Lisp language is indistinguishable from Lisp, C can not do that.

      Smalltalk, Ruby, Ocaml and a few others can get close to it, but are still no match for the expressiveness in Lisp.

      I have yet to meet anyone who claims to be a programmer and hates(read: doesn't understand it) Lisp and is more than a stupid API monkey that really doesn't know what he is doing.

    30. Re:dialect of LISP by Alomex · · Score: 1

      It is clear you haven't thought about this in any depth if you think it has anything to do with parentheses.

      For extensions to be first class what you need is the parser to be ready to treat user constructs the same way as native constructs. This is, for example, what happens with operator overloading in C++. There is nothing stopping you from having keyword overloading too and now extensions are first class.

      It is really funny that you think parentheses are fundamental to this. Honestly just by pure syntactic sugar alone (i.e. a combination of new lines and statement separators) you can get rid of about 50% of the parenthesis in lisp/scheme and still have the same language as before.

      I already gave an example before, in which one can remove parentheses from a define operator with exactly the same semantics as before thus still having a 100% scheme equivalent but parentheses are now gone.

    31. Re:dialect of LISP by Anonymous Coward · · Score: 0

      Wow, that is amazing but not in a good way.

    32. Re:dialect of LISP by Anonymous Coward · · Score: 0

      Why not go one step further and just write FORTH? After all, scheme is merely FORTH backwards (and this is why it requires parentheses at all!)

    33. Re: dialect of LISP by Anonymous Coward · · Score: 0

      Gee, this sounds a lot like what they used to feed me in Sunday School as a kid.

      If your language is so awesome, it can stand up by itself. Knock off the obscurantism and defend your argument rationally.

    34. Re:dialect of LISP by smittyoneeach · · Score: 1

      There is no other language that can implement the power of Lisp macros.

      Which is another way to state my point about the unity of (code . data)
      But I think that point is substantially a theoretical one; I write VBA code that generates VBA code all the time. Sure, I may not be able to execute it cleanly in one fell swoop, but you'll notice that MSOffice has orders of magnitude more market penetration than Lisp.

      --
      Get thee glass eyes, and, like a scurvy politician, seem to see things thou dost not.--King Lear
    35. Re:dialect of LISP by Anonymous Coward · · Score: 0

      Lots of languages support having code written that writes code. VBA has order of magnitude less power than Lisp macros. As someone else stated other languages get sort of close like haskell, ruby, ocaml, smalltalk, but none of them can match the power of Lisp.

    36. Re: dialect of LISP by Anonymous Coward · · Score: 0

      In other words you don't want to be bothered to learn.

      The power of Lisp can not be boiled down to a soundbite. You have to learn and bang on it for a while before the absolute genius of the whole thing finally sets in.

      I know you won't bother spending time learning it even though it will improve your programming skill, and in your case probably by more than a few orders of magnitude. So I will throw you a bone.

      In the early 1900's the German Mathematician Hilbert put out a challenge to solve the Entscheidungsproblem, which is basically asking: is there a general algorithm to solve first-order logic problems?

      In 1936 two papers were written independently that proved that no you can't.

      The first was Alonzo Church's paper that described the lambda calculus which is used to prove it was impossible.

      Roughly the same time Alan Turning invented an imaginary machine call Turing Machines, which he used to prove it was impossible. Since his paper was second(and was only published because of the novel approach) he also had to prove that it was equivilent to the lambda calculus, which he did about 6 months later. After the initial publication, Turing(still a grad student) went to Princeton to study under Church(most of the CS originators studied under Church-who never learned how to use a computer despite living to 1995) and wrote his dissertation that leaned heavily on the lambda calculus(Ordinals of Logic IIRC)

      After his second paper, he never mentioned Turing Machines in any of his published works, but did use lambda calculus a lot in his work.

      If you want to learn a bit about lambda calculus, you will notice that it looks eerily similar to the syntax that Lisp adopted.

      Also note that they were trying to solve a longstanding mathematical problem not invent mechanical computation, which of course is also the proof that all programming is mathematical, something the self-trained language end-users(they are not programmers) have trouble wrapping their feeble brains around.

    37. Re: dialect of LISP by jbolden · · Score: 1

      LISP has had pretty good compilers for several decades. It isn't just a scripting language.

    38. Re:dialect of LISP by jbolden · · Score: 1

      Each layer can have a separation of code and data. Just at any layer you'll find that your data is code/data from the previous layer and quite frequently your code does little more than feed fixed data to the variable data it is receiving.

    39. Re:dialect of LISP by jbolden · · Score: 1

      LISP has that cool syntax to allow for easiest meta programming.

      Arguably Haskell = LISP with better syntax.
      so in your case X = blah blah

    40. Re:dialect of LISP by jbolden · · Score: 1

      The most popular RPN was HP's RPL = Reverse Polish LISP.

      In any case, yes RPN languages are also quite awesome. And incidentally many GPU programming languages are FORTHs.

    41. Re:dialect of LISP by jbolden · · Score: 1

      I read your discussion below and he isn't helping.

      Assume I have a pre-existing system that already has a good set of primitives and operations that I like.
      I can whip up a LISP that uses those primitives and those operators in a few hundred lines of code.
      Because LISP structures are so incredibly generic most code will work in my new LISP right out of the box so I can extend my LISP easily and simply.

      That's what the parenthesis buy me. No syntax means I get off the ground really cheaply and extend cheaply. Other than that, it doesn't buy me anything and costs a lot in terms of confusion.

    42. Re:dialect of LISP by Anonymous Coward · · Score: 0

      All the contrary. The simpler the syntax is, the less expressive and the less distinctive. That must be a royal pain to write and debug. I don't understand why they couldn't at least get rid of the parens that are already defined by indentation. The developer probably decided to go with LISP because he didn't want to bother with syntax at all. But then why not just write an API that can be used in a human-readable language?

    43. Re:dialect of LISP by Anonymous Coward · · Score: 0

      If you think there is no reason for the parenthesis or prefix notation you are sufficiently clueless that I hope and pray you don't write code for fun or money.

      Oh, I know what hipster tards CLAIM are the "really good reasons" for it, but really, their argument boils down to, "I feel like I'm really cool using this, because I'd rather write something that's easy for computers to parse than easy for humans to parse." And that's exactly backwards: computer cycles are cheap, and getting cheaper. Human cycles are still very expensive, and always will be.

      Lisp is - obviously - a language designed by a bunch of asperger's sufferers: they require everything to be rigidly defined and explicitly stated, with no potential ambiguity. And in so doing, they drastically limit their own ability to express their intent in code. Incidentally, this is also one of the reasons proponents of Lisp hate languages like Perl, which readily adopt the "more than one way to do it" credo. Real languages are hairy, organic, and full of weird eccentricities. Esperanto was clean, elegantly designed, and very clear: and it caught on like the Hindenberg.

      Math is not language, language is not math: trying to pretend that they're interchangeable is exactly where Lisp went wrong, and made itself a niche language unsuitable for general computing tasks.

    44. Re:dialect of LISP by smittyoneeach · · Score: 1

      Right, but the point about the Lisp interpreter is that wandering back and forth across the line between the source code and the live data (mostly impossible with other systems) is readily attainable with Lisp.

      --
      Get thee glass eyes, and, like a scurvy politician, seem to see things thou dost not.--King Lear
    45. Re:dialect of LISP by jbolden · · Score: 1

      I understand but your point above was that business modeling might require a separation and LISP allows for that. LISP can handle a layer where code and data are distinct.

    46. Re:dialect of LISP by smittyoneeach · · Score: 1

      Well, capitalists are always going to want to draw a harder line between the source code and other client code.
      Mostly to support some business model, but also for performance: note that even GNU Emacs, in all of its glory, compiles a significant amount of the grungy code down to native binary, for performance reasons.

      --
      Get thee glass eyes, and, like a scurvy politician, seem to see things thou dost not.--King Lear
    47. Re:dialect of LISP by jbolden · · Score: 1

      Oh I'm sorry I thought you meant business modeling.

      I'm not sure that exposing LISP APIs in a library is all that different than anything else.
      a) Customer buys the library and pays either a per link fee for distribution or a one time fee
      b) Client uses the library more or less however they want (excluding a few limitation in the license)

      The business model works the same either way.

    48. Re:dialect of LISP by Anonymous Coward · · Score: 0

      Wow so much ignorance in one post. It is funny that self-trained monkeys like yourself consider 'good design' 'math' 'education' to be hipster. All programming is mathematics, you would have to be willfully ignorant to not know that.

    49. Re:dialect of LISP by Fyzzler · · Score: 1

      So LISP programmers wear skinny jeans and emo glasses?

      You forgot pony tails, gotta have the pony tail to have any cred.

      --
      I have one question. If the Japanese Ministry of Agriculture is not in charge of Gundam, then who is?
  3. Link to a simple example by Wootery · · Score: 2

    float.kfc shows the basic Scheme-style syntax.

    I wonder why it uses .kfc as its extension...

    1. Re:Link to a simple example by zdzichu · · Score: 5, Informative

      Holk reveals that the name Harlan comes from a mishearing of fried chicken icon Colonel Sanders' first name, Harland, and this association is also why all the file extensions for Harlan programs are .kfc.

      --
      :wq
    2. Re:Link to a simple example by Anonymous Coward · · Score: 0

      Maybe it's a small nugget of code.

    3. Re:Link to a simple example by Wootery · · Score: 1

      And now I know ;P

    4. Re:Link to a simple example by Anonymous Coward · · Score: 0

      I wonder why it uses .kfc as its extension...

      I wonder why they decided to use the indentation in a way to make the code less readable.

      (module
        (define (main)
          (print (+ 0.125 0.125))
          (print (int->float 42))
          (return 0)
        )
      )

      End parenthesis should be on the same indentation as the line with the start parenthesis whenever they are on separate lines, unless you enjoy spending hours to find where the missing parenthesis should be placed.
      Mixing indentation depth is also a great way to make code unreadable.

    5. Re:Link to a simple example by aaaaaaargh! · · Score: 1

      Putting closing parentheses on one line like in the original code is standard convention in most LISP and Scheme languages. The editor takes care of the closing parentheses for you and will give you constant visual feedback on the level you're at and where the opening paren is (e.g. by color coding). Indentation and pretty-printing will also be automatic in any reasonable, modern editor (such as e.g. vim or Emacs).

    6. Re: Link to a simple example by Jmc23 · · Score: 2

      The other half is blowing stuff up.

      --
      Don't complain about syntax, grammar, or spelling. There is no.hell like input on android.
    7. Re:Link to a simple example by Anonymous Coward · · Score: 0

      Seeing something immediately is always preferable to anything a computer can do for you.

    8. Re:Link to a simple example by Anonymous Coward · · Score: 0

      This completely defeats the argument "simple syntax". If you need the IDE to be able to parse it, then it is anything but not simple.

    9. Re:Link to a simple example by Charliemopps · · Score: 1

      Stop using notepad to do your coding and this ceases to be a problem.

    10. Re:Link to a simple example by Anonymous Coward · · Score: 0

      I don't know, you just seem like another guy who doesn't know what he's talking about. Apart from the fact that LISP (after Forth) has just about the simplest syntax imaginable, there was no argument about "simple syntax" anyway. We were talking about ease of use and readability. In my experience people who claim that S-expression syntax is complicated or hard to understand have never actually used any LISP/Scheme system for more than briefly toying around. Seriously, I have never met anyone who actually used LISP for a longer time and complained about its syntax. (BTW, there are numerous alternative syntaxes around, but none of them was ever successful because people didn't feel a need for them.)

    11. Re:Link to a simple example by tepples · · Score: 1

      The editor takes care of the closing parentheses for you

      Perhaps a LISP-specific editor does, but the editor that ships with a computer does not. Even basic features such as automatic copying of leading whitespace from the previous line aren't omnipresent among editors that ship with computers.

    12. Re:Link to a simple example by bill_mcgonigle · · Score: 1

      At least the chicken chain is probably less likely to lawyer up than the fiction author.

      --
      My God, it's Full of Source!
      OUTSIDE_IP=$(dig +short my.ip @outsideip.net)
    13. Re:Link to a simple example by andy_t_roo · · Score: 1

      The editor takes care of the closing parentheses for you

      Perhaps a LISP-specific editor does, but the editor that ships with a computer does not. Even basic features such as automatic copying of leading whitespace from the previous line aren't omnipresent among editors that ship with windows based computers.

      Fixed that for you. Furthermore there are many normal document handling operations where you don't want that operation; it is only programming environments which should auto-handle code type syntax highlighting and auto-completion. We like to call an environment for developing code an IDE.

      I agree that many simple text editors don't preserve white space, but even Word preserves indentation level, and notepad++ does quite a bit of syntax highlighting for you.

      Also, referring to a sibling of this post "This completely defeats the argument "simple syntax". If you need the IDE to be able to parse it ...": you don't need an IDE, but the purpose of an IDE is to aid understanding -- simple bracket matching is always going to help. even in languages where the context of the bracket is almost immediately obvious (like java), highlighting a matching bracket allows you to perceive the extent of the current code block with minimal mental effort.

  4. Indian University? by Anonymous Coward · · Score: 3, Informative

    I think you mean Indiana University, mods.

    1. Re:Indian University? by shikaisi · · Score: 3, Funny

      I think you mean Indiana University, mods.

      No. It's been outsourced.

      --
      No left turn unstoned.
    2. Re:Indian University? by paxprobellum · · Score: 1

      Came here to say this.

    3. Re:Indian University? by Anonymous Coward · · Score: 0

      I think they might have meant "Native American" University.

  5. GPipe by Anonymous Coward · · Score: 1

    I've skimmed the docs on GPipe because I've been playing with OpenGL and Haskell to do some fractal rendering on the GPU - but of course, the haskell part was just a wrapper around OpenGL function calls loading GLSL shader code. It doesn't seem to be a "shader programming language" so much as a graphics engine that uses the shader pipeline as a backend.

    1. Re:GPipe by Weezul · · Score: 1

      Is the haskell compiler actually generating the shader code?

      --
      The Christian religion has been and still is the principal enemy of moral progress in the world. -- Bertrand Russell
    2. Re:GPipe by abies · · Score: 1

      I think it can, but seems it is so complicated and unreadable that sample project at https://github.com/csabahruska/GFXDemo is using gsl for shaders...

  6. nitpicking by Anonymous Coward · · Score: 0

    Indian -> Indiana University..

    1. Re: nitpicking by Anonymous Coward · · Score: 0

      Is that the American Indiana University or the East Indiana University? ;-)

  7. Indiana, not Indian by Dan+East · · Score: 4, Insightful

    According to the story it is Indiana University, not Indian University.

    I wonder if scheme was in some way necessary or conducive to running on the gpu, or if that was an arbitrary choice. I still have nightmares of car and cdr from way back when.

    --
    Better known as 318230.
    1. Re:Indiana, not Indian by abies · · Score: 4, Interesting

      Scheme/lisp was a bit helpful in the way it has a lot of features simplifying code generation. In fact, lisp is ultimate example of programmers bending towards making things easiest for compilers. It is a lot easier to transform lisp-like code into other representation - you don't really need to write lex/bison-like parser part of the grammar, you can immediately start with transforms.

      But it doesn't make it simplier for people using the final language - just for the guy writing the compiler. You have to be masochist to prefer to write

          (define (point-add x y)
              (match x
                  ((point3 a b c)
                    (match y
                        ((point3 x y z)
                          (point3 (+ a x) (+ b y) (+ c z)))))))

      instead of something like

      define operator+(point3 a, point3 b) = point3(a.x+b.x,a.y+b.y,a.z+b.z)

      Lisp makes writing DSLs easy - but resulting DSLs are still Lisp. In the era of things like XText, which provide full IDE with autocompletion, project management, outlines etc on top of your DSL, there is no real excuse to make things harder then needed

    2. Re:Indiana, not Indian by vikingpower · · Score: 1, Flamebait

      In the era of things like XText, which provide full IDE with autocompletion, project management, outlines etc on top of your DSL, there is no real excuse to make things harder then needed

      Bullshit. Did you ever try and actually design, write, develop and maintain an industrial-strenght DSL with Xtext ? If yes, then I would be interested to hear from your experience. If not, hear mine: it is hell.

      --
      Religous speak to God. Insane are spoken to by God. When all shut up, one can finally hear Shostakovich in peace
    3. Re:Indiana, not Indian by Goaway · · Score: 1

      I always found it deeply ironic that SICP, of all books, starts out with the statement that "Thus, programs must be written for people to read, and only incidentally for machines to execute", and then goes on to use Scheme.

    4. Re:Indiana, not Indian by Jmc23 · · Score: 0

      ;) oops, /. really needs an edit. Forgot my emoticon!

      --
      Don't complain about syntax, grammar, or spelling. There is no.hell like input on android.
    5. Re:Indiana, not Indian by Anonymous Coward · · Score: 0

      It's not so ironic really.
      Lisp and other languages like SML are meant to concentrate on the algorithm, not the implementation.
      As such it is readable by programmers and incidentally executed by a machine. In many ways it's almost like writing pseudo code, just in a strange syntax.
      That's why a lot of american unis use it for their introduction to programming courses.

      Those languages are just rather different than what most people are used to and are as such rejected by many.
      I guess some will find it easier to adapt to the different model of thinking as well.

      For a more mainstream language that might fill the same slot I can only think of python.

    6. Re:Indiana, not Indian by Anonymous Coward · · Score: 0

      For a more mainstream language that might fill the same slot I can only think of python.

      Sorry, any language with "global by default" is automatically disqualified from consideration :)

    7. Re:Indiana, not Indian by abies · · Score: 1

      Please note that lisp stuff above is taken from Harlan - so if you complain about it being ugly, please take it with the guy who came up with Harlan in first place. It _might_ be possible to do better DSL in Lisp, but I was complaining about the route which Harlan has taken.

    8. Re:Indiana, not Indian by akanouras · · Score: 1

      He said Python, not Javascript.

    9. Re:Indiana, not Indian by 10101001+10101001 · · Score: 1

      According to the story it is Indiana University, not Indian University.

      See, that makes a lot more sense. :)

      I wonder if scheme was in some way necessary or conducive to running on the gpu, or if that was an arbitrary choice.

      I'd say it's a mixture of both. On the one hand, Professor R. Kent Dybvig is one of the editors behind R6RS (and earlier editions) and author of Chez Scheme. In general, IU uses Scheme as one of the major languages to teach things including compiler design, so basically a CS alumni from IU is almost always a Schemer (or perhaps an anti-Schemer from the experience :)). That boils down to the point that Scheme is basically a much simplified version of Lisp (basically, the reverse of Lisp in complexity) which can function as a functional language (with all the inherent thread-safe features) if you're careful about not using mutable functions on your data, and Scheme readily supports 1st order and anonymous functions. Given that GPUs (and Cell processors) are basically very apt for those properties, it'd seem to be quite a good fit. Having said all that, there's probably plenty of other functional languages that are as good or even better for the job--the very scope of Scheme being such a cut down language good for teaching also tends to make it a pain to actually use in any production environment because of a lack of libraries, so I hope Harlan is designed to hand off the non-GPU work to another language.

      I still have nightmares of car and cdr from way back when.

      Can't really help you there. Personally, car and cdr ended up making linked-list so intuitive for me that I'm often perplexed why anyone has so much trouble with them, especially with memory leaks and the like. :/

      --
      Eurohacker European paranoia, gun rights, and h
    10. Re:Indiana, not Indian by Charliemopps · · Score: 1

      I dunno, I always liked LISP. There's more typing but it seems logical to me. And the ease of transforming it to something else shouldn't be down played. I've got one API that I have to use frequently that uses LISP like code for sales reports... and often I have to dump that into an excel spreadsheet for some of my sales people... so I wrote a script that did it for me. It's actually really simple. I couldn't imagine doing that with any other language. I just copy the code, run my script, paste into excel and I've got a working spreadsheet that does the same thing the LISP report did.

    11. Re:Indiana, not Indian by Anonymous Coward · · Score: 0

      Why wouldn't you import the excel object model and use it directly, or export to some separated value/xml file instead of pasting?

    12. Re:Indiana, not Indian by TheNastyInThePasty · · Score: 1

      The scheme syntax lends itself well to parallelization. You can parse the program into a tree, with the command as the parent node and the inputs as its children. If you don't allow any of the commands to have side effects, you can process each of the children's subtrees in parallel. This makes it trivial for the compiler to figure out how to decompose your program into multiple GPU kernel calls and forces the programmer to think in different terms to come up with an algorithm that fits in with Scheme's programming style. Procedural programming languages like C keep you stuck in a "do this, then that, then this other thing" frame of mind and this doesn't lend itself well to the challenges of effective parallel programming. (I studied parallel programming, programming language design, and parallel and distributed systems every chance I got in graduate school)

      --
      The best thing about UDP jokes is I don't care if you get them or not
    13. Re:Indiana, not Indian by Jmc23 · · Score: 1

      i know, i forgot my emoticon. text is such a bitch.

      --
      Don't complain about syntax, grammar, or spelling. There is no.hell like input on android.
    14. Re:Indiana, not Indian by rmstar · · Score: 1

      I always found it deeply ironic that SICP, of all books, starts out with the statement that "Thus, programs must be written for people to read, and only incidentally for machines to execute", and then goes on to use Scheme.

      The thing with lisp syntax is that, at first sight, it looks less intelligible than, say, C++ syntax. But once you get used to the parentheses, it actually is a LOT easier to read and write correctly. All the suggestive syntactic sugars of C/C++/whatever tend to have subtle interference patterns that make them a source of errors that can be arbitrarily hard to find.

      So - no. It's not really ironic. It is enlightened!

    15. Re:Indiana, not Indian by Anonymous Coward · · Score: 0

      So, let me see if I have this straight: if you're careful to program so that none of your code has side effects outside of that code, then you can easily run the subtrees in parallel?

      How is this anything but a result of "good parallel programming techniques?" I see nothing inherent to the scheme syntax that makes this intrinsically easier, as it's quite possible to write code with side effects in any language.

    16. Re:Indiana, not Indian by Luna+Argenteus · · Score: 1

      Your Scheme code uses pattern matching so that's not comparable to the pseudo Scheme stuff, which just uses simple accessor.

      Scheme does provide accessor for record type. Well I would love to have a reader macro and define something more concise like a.x, but too bad reader macro is not standard. The comparable code with that pseudo Scheme code of yours would be something like

      (define (point3-add a b)
        (make-point3
          (+ (point3-x a) (point3-x b))
          (+ (point3-y a) (point3-y b))
          (+ (point3-z a) (point3-z b))))

      I bet those who appreciate s-expression can comprehend this code with just a glance. I find that s-expressions are rather easy to parse by (my) human eyes provided they are properly indented.

    17. Re:Indiana, not Indian by Anonymous Coward · · Score: 0

      Functional languages makes it much easier to pull off as it is built into the language. It is a royal PITA to write code that is referentially transparent in C, C++, Java, etc. With functional languages you get it for free.

  8. Change in thinking by dargaud · · Score: 4, Informative

    I just started doing some GPU programming and the change in thinking that it requires even for very simple things can be hard for programmers. I don't know if this language forces us to think in new terms, but here's a very simple example: we often use arrays of structures. Well, a GPU can optimize computations on arrays but not on structures, so it's better to use structures of arrays... Even is less natural for the programmer. Plenty of small examples like that that don't really depend on the language you use.

    --
    Non-Linux Penguins ?
    1. Re:Change in thinking by Rockoon · · Score: 2

      Well, a GPU can optimize computations on arrays but not on structures, so it's better to use structures of arrays... Even is less natural for the programmer.

      It is only less natural for you because you've ignored the CPU's SIMD extensions all this time.

      My question is if in all this time that you have avoided the CPU SIMD extensions, then why is it at all important that you find the GPU's version of it less natural?

      (queue the folks that dont realize that SoA SSE code is a lot faster than AoS SSE code, but will now rabidly defend their suboptimal and thus mostly pointless usage of SSE)

      --
      "His name was James Damore."
    2. Re:Change in thinking by Jmc23 · · Score: 0

      I hope you realized you responded to a code monkey who didn't understand a word you said.

      --
      Don't complain about syntax, grammar, or spelling. There is no.hell like input on android.
    3. Re:Change in thinking by Anonymous Coward · · Score: 0

      (queue the folks that dont realize that SoA SSE code is a lot faster than AoS SSE code, but will now rabidly defend their suboptimal and thus mostly pointless usage of SSE)

      Perhaps you actually harbor a vituperative wish for the benighted, ignorant folks to be forced to stand in line (to what end?), but if you were to cue the ignoramuses then they could come to sling their vituperations upon *you*.

      If done properly it could be quite the social event. I'm thinking "Flash Mob to Excoriate Rockoon", with disco dancing (just to add surreality).

    4. Re:Change in thinking by Anonymous Coward · · Score: 0

      Well, my 2cents worth....In terms of databases, column based storage versus row based storage often goes hand in hand with list based processing. Eg kdb. So, I am guessing that lisp is the ideal language for this new thinking required.

    5. Re:Change in thinking by Anonymous Coward · · Score: 0

      Looks like he struck a nerve.

    6. Re:Change in thinking by Anonymous Coward · · Score: 0

      the guy had a point. you don't even need to go to simd to make the point. arrays of should be pretty natural for a coder.

      if you see someone representing a bitmap as an array of objects with 8 bit members r,g,b,a.. and then someone manipulating the same data as just an array of bytes(or 32bit whatevers).. you should know that the other way is a code monkey way and the other one is the right one even if the book says it's confusing.

    7. Re:Change in thinking by Anonymous Coward · · Score: 0

      ZOMG, wait! So, what you're saying is that AoS != SoA, kind of like "queue" != "cue"?

      As in, all of these terms have separate, distinct definitions that do not overlap? And it matters which one you use because they're not interchangeable?

      Mind blowing.

    8. Re:Change in thinking by Anonymous Coward · · Score: 0

      No, it's less natural because it's less natural. AoS is a pain in the ass and doesn't integrate with basic host-language idioms. You avoid it like the plague unless you (a) can really benefit from optimal SIMD code because your memory accesses are or will be optimal (b) can take the cost of making the host-language talk to these weird data structures, including poorer L1 usage for many higher-level uses and/or two reformatting steps and (c) can prove those things will remain true for the maintenance lifetime of the project. Unless you can answer yes to all these, you're doing premature optimization. And none of this applies unless you are on a platform that lacks a decent swizzle instruction (SSE - check). Your processor will perform FPU and swizzle operations in parallel, so accessing SoA can be just as fast as all this AoS nonsense, and has zero integration cost to the rest of the program. You need something that can unpack bytes and shorts in one instruction though, as found just about everywhere except Intel, unless all your data is 32 bits wide (see: L1 cache, optimal usage of).

      rabidly defend their suboptimal and thus mostly pointless usage of SSE

      No, you need AoS on SSE. That's why SSE sucks so badly compared to AltiVec or SPU.

    9. Re:Change in thinking by Anonymous Coward · · Score: 0

      I just realized I swapped AoS and SoA everywhere in my comment :) Hope it doesn't affect readability too badly :)

    10. Re:Change in thinking by dmbasso · · Score: 1

      I just started doing some GPU programming and the change in thinking that it requires even for very simple things can be hard for programmers.

      Except for Python/NumPy and Matlab programmers (and perhaps Fortran, idk, never used it).

      I was pleasantly surprised when I adapted my Python code (some image processing / neural network stuff) to use OpenCL, and without much effort achieved a 70% reduction in processing time.

      --
      `echo $[0x853204FA81]|tr 0-9 ionbsdeaml`@gmail.com
    11. Re:Change in thinking by sconeu · · Score: 1

      Writing in Harlan changes your thinking.

      It turns you into a total douchebag. One who goes around insisting that everyone else stole and destroyed your ideas.

      --
      General Relativity: Space-time tells matter where to go; Matter tells space-time what shape to be.
    12. Re:Change in thinking by TeknoHog · · Score: 1

      I just started doing some GPU programming and the change in thinking that it requires even for very simple things can be hard for programmers.

      Except for Python/NumPy and Matlab programmers (and perhaps Fortran, idk, never used it).

      Fortran had parallelizing compilers way, way before this "omg, dual core, we need to rethink everything about programming". I believe it was helped by the language's native matrix/array syntax. This is F90 and later though, earlier standards were horrible, and it's those that give Fortran a bad name even today.

      --
      Escher was the first MC and Giger invented the HR department.
  9. Oh no by MichaelSmith · · Score: 0

    Incoming lawsuit from Harlan Ellison in 3...2...1

    1. Re:Oh no by Anonymous Coward · · Score: 0, Funny

      No shit. Do these people know who they named their language after?

      If you thought Carl Sagan overreacted when Apple used 'Sagan' as an (internal!) code name, you ain't seen nothin' yet. Prepare for a broadside of cease-and-desist orders from the original BHA (ButtHead Author.)

      Posted anonymously because hey, life's too short to tangle with this particular asshole.

  10. A marketeer wrote the article by Vincent77 · · Score: 4, Informative

    There are several languages that are written on top of OpenCL - that is the whole idea of this API. But if your read the article, it seems this guy was the actual inventor of the wheel.

    Same response happened when some guy made Rootbeer and let some marketeer write an alike article. It was suggested that you could just run existing Java-code on the GPU, but that was not true at all - you had to rewrite the code to the rootbeer-API. This Harlan-project is comparable: just beta-software that has not run into the real limits of GPU-computing - but still making big promises that in contrary to their peers they actually will fix the problem.
    I'm not saying it can be in the future, but just that this article is a marketing-piece with several promises on future advancements.

    Check out Aparapi and VexCL to name just two. There are loads and loads of these solutions - many of these wrappers slowly advance to higher level languages, and have been in the field a lot longer.

    1. Re:A marketeer wrote the article by Anonymous Coward · · Score: 0

      In other words, research. Which is exactly what Eric is doing.

  11. Comtrya! by fellip_nectar · · Score: 2

    Ah...Comtrya! Comtrya!

    --
    Worst. Signature. Ever.
    1. Re:Comtrya! by elfprince13 · · Score: 1

      Comtraya, to use the correct Altairan spelling. But I wish I had modpoints for you anyway.

    2. Re:Comtrya! by Anonymous Coward · · Score: 0

      Ahem, Com-traya!

  12. Syntax Error by Anonymous Coward · · Score: 1

    Syntax Error: "LISP" and "Simplifies" found in the same article.

    1. Re:Syntax Error by Anonymous Coward · · Score: 0

      Language designers can never win. C++, LISP or brainfuck, somebody is always screaming.

    2. Re:Syntax Error by Anonymous Coward · · Score: 0

      Hey, all you have to know is parentheses and identifiers! And counting. Didn't they teach you to count to 20? There you go. There's rarely more than 20 nested parentheses on one line.

  13. Language choices by Anonymous Coward · · Score: 0

    Lisp.. functional language - Scales well, immutable objects, Well known in Academia
    Declarative ... Runtimes should take care of the how and we focus on the what

    This is for supercomputing and as such fits in academia and has to scale hence.. .Lisp

    1. Re:Language choices by Anonymous Coward · · Score: 0

      Declarative is completely subjective. An if...else statement is declarative, since you tell what do you want and the compiler takes care of the how. Declarative vs. Imperative is completely meaningless.

  14. Hmm by DrXym · · Score: 1, Insightful

    Lisp code is practically unreadable thanks to all the parentheses without good formatting and even then looks totally foreign to people brought up on C or Java. For example all the computations are completely backasswards thanks to polish notation. A better language for GPU programming would be one which at least retains the essence of C and provides convention based techniques and inference to relieve some of the effort of writing out OpenCL kernels.

    1. Re:Hmm by Anonymous Coward · · Score: 2, Insightful

      And C is virtually unreadable to anyone brought up with Smalltalk and Ada, so what's your fucking point? It takes something like three days maximum to get used to prefix notation, so learn it if you want to use the tool, and get over with your irrational and insubstantial syntax preferences.

    2. Re:Hmm by Anonymous Coward · · Score: 0

      The number of C users exceeds the number of smalltalk/ada users by 5 orders of magnitude?

    3. Re:Hmm by DrXym · · Score: 1

      My point Einstein, is that C is the language that CUDA, Cell, OpenCL and OpenGL SL are derived from. So it's a rather useful property of MagicNewLanguage if it is similar to what people are accustomed to already, preferably allowing them to express the same concepts in a terser but similar form. Assuming that is, that the person who created MagicNewLanguage stands any hope of persuading people to use it.

    4. Re:Hmm by splutty · · Score: 1

      I suspect one of the main reasons for using Lisp/Scheme style notation, is that almost all GPU programming anyone would want to do are (based on) mathematical equations.

      For mathematicians, a Lisp notation is actually a lot more logical and easier than a C notation. (At least the older ones :)

      The whole concept of iterations in calculations is a bit awkward in C (with all the parenthesis, yes...) in comparison to Lisp (where they're fairly well delineated blocks if properly indented)

      Yes, you can mostly do the same in C, but I'd bet most mathematicians have more experience with ADA/Lisp than with C :)

      Chicken/Egg sort of thing, then, now that I've typed all this out.

      --
      Coz eternity my friend, is a long *ing time.
    5. Re:Hmm by DrXym · · Score: 1

      Oh and add HLSL and Renderscript for good measure.

    6. Re:Hmm by DrXym · · Score: 1

      Almost all GPU and GPGPU programming is around a C-like language. There is some Fortran support too for CUDA and a smattering in OpenCL. I expect most developers would be using C though.

    7. Re:Hmm by ultranova · · Score: 1

      My point Einstein, is that C is the language that CUDA, Cell, OpenCL and OpenGL SL are derived from. So it's a rather useful property of MagicNewLanguage if it is similar to what people are accustomed to already, preferably allowing them to express the same concepts in a terser but similar form.

      And how, exactly speaking, would the MagicNewLanguage do that? Because we can probably assume that OpenCL etc. were written by people who knew what they were doing, and are thus already as or nearly ast good as a C-like interface to GPU gets. And that means that MagicNewLanguage either introduces some MagicNewConcept to the mix, or is redundant.

      --

      Forget magic. Any technology distinguishable from divine power is insufficiently advanced.

    8. Re:Hmm by tyrione · · Score: 1

      And C is virtually unreadable to anyone brought up with Smalltalk and Ada, so what's your fucking point? It takes something like three days maximum to get used to prefix notation, so learn it if you want to use the tool, and get over with your irrational and insubstantial syntax preferences.

      No one brought up with Smalltalk hasn't been brought up without C. Ada, perhaps, but then again anyone taught Ada was exposed to Fortran and most likely moved to C, which once again predates effing ADA and SMALLTALK. You were far better off with PASCAL as an example.

  15. News for luddites by Anonymous Coward · · Score: 0

    Why is it that every single story about something new, whether justified or not, is always met with a torrent of naysayers?

    1. Re:News for luddites by gl4ss · · Score: 1

      Why is it that every single story about something new, whether justified or not, is always met with a torrent of naysayers?

      because the article is filled with references to "snob" languages? can I use this language easily from with c++? java? .net? in android?

      --
      world was created 5 seconds before this post as it is.
    2. Re:News for luddites by Anonymous Coward · · Score: 0

      Because Slashdot does not exist to echo positive feelings back and forth until we're all at +5 insightful for comments of "+1", "yay!" and "Great job, buddy!". Most of the naysaying comments here are pointless (all of the people complaining about Lisp, etc), but even those are orders of magnitude better than what yeasayers would produce.

    3. Re:News for luddites by Anonymous Coward · · Score: 0

      No. And I suspect the "deep reason" that he didn't give this language a proper syntax is laziness. Really, there's nothing inherent to GPUs that would prevent some human-friendly syntax, such as getting rid of all those parentheses or writing math expressions the usual way. If this doesn't get a ton of syntactic sugar it will remain purely academic.

    4. Re:News for luddites by jbolden · · Score: 1

      Because /. has become incredibly conservative.

  16. BS by SuperDre · · Score: 1

    it doesn't simplify it any, it's just yet another flavor someone wants to use.. Just like a lot of languages like Python, which really doesn't bring anything new to the table, except for some people's own love for a syntax they like..

    1. Re:BS by gl4ss · · Score: 0

      I think curly braces were on short supply.

        (define (main)
              (let* ((bodies (make-points 1000))
                            (start (nanotime))
                            (forces (nbody bodies))
                            (stop (nanotime)))
                  (print "Computed ")
                  (print (length forces))
                  (print " forces in ")
                  (print (/ (- stop start) 1000000))
                  (println "ms"))
              (return 0)))

      actually, I'll bet you 100 bucks it was written on a mac osx. how did you make that guess before checking? well fuck the mac keyboard doesn't have the curly braces printedon them! so of course it's simpler if you don't have to use them :D

      (tested on Mac OS X 10.6 (Snow Leopard)
      Mac OS X 10.7 (Lion)
      Mac OS X 10.8 (Mountain Lion))

      --
      world was created 5 seconds before this post as it is.
    2. Re:BS by angel'o'sphere · · Score: 1

      American Mac keyboards have {} [] printed on them.
      It is only european (all or only german?) that don't have.
      Also keep in mind, Lisp was invented long before Macs.

      --
      Cost free eBook I read (by iBook/Kobo/Amazon/ObookO/Gutenberg etc.): "The Green Odyssey" by Philip Jose Farmer.
    3. Re:BS by ybanrab · · Score: 1

      I'd like a keyboard printed hash # (alt-3, replaced on keyboard with £) but both UK Apple keyboards in front of me have () [] {} ?

      http://www.apple.com/keyboard/

    4. Re:BS by gl4ss · · Score: 1

      it's probably all european, since scandinavian keyboards miss the prints. funny thing is that it doesn't help at all that they're missing them, they just thought it would look cooler if they weren't printed on them..

      or is it all modern mac keyboards? I seem to recall that the older pre-steve-batshit-crazied macs had them?

      --
      world was created 5 seconds before this post as it is.
    5. Re: BS by CadentOrange · · Score: 1

      I don't get this. I have curly braces on my Mac keyboard...

    6. Re:BS by angel'o'sphere · · Score: 1

      That has nothing to do with Mac or not Mac, it is a keyboard layout problem. Yes, PC keyboards access them via ALT-GR and show the keys ...

      Non programmers don't need [] {} at all, so non programmers don't miss them.

      OTOH americans have not the special chars we put on the [] {} places, like german Umlauts (sorry can not show them here as /. will eat them).

      --
      Cost free eBook I read (by iBook/Kobo/Amazon/ObookO/Gutenberg etc.): "The Green Odyssey" by Philip Jose Farmer.
    7. Re:BS by elfprince13 · · Score: 1

      Every Mac I've ever used in the last 20 years has { and } on the keyboard. But we Americans don't have weird alphabets either ;).

  17. C is dead. Long live C! by xtal · · Score: 1

    Faster always trumps "easier" in the end. Few languages are programmatically easier than C, it remains to be seen if that is the case here. Often "easier" means "able to do things without an underlying understanding of the architecture", and that's not condusive to Good Eats. (apologies to Alton Brown)

    I had a brief foray into Java, but I am amazed at the mileage I've gotten out of the C programming language and it's relatives. (C++, ObjC).

    --
    ..don't panic
    1. Re:C is dead. Long live C! by Anonymous Coward · · Score: 0

      Eventually, the speed that your programs run will not be determined by how optimized individual pieces are, but by how parallel you made it. I personally do not want to live in a world where I have to hand manage mutexes, threads, processes, etc.

      C is not going to survive that eventuality in the mainstream, but will find its way into the closet of languages of the past.

    2. Re:C is dead. Long live C! by jmhobrien · · Score: 1

      Yeah! New programmers only need to know Python! Anyone who thinks otherwise is just an old fart.

      --
      Where is moderation: -1 False?
    3. Re:C is dead. Long live C! by xtal · · Score: 1

      Python is great. It ain't C.

      --
      ..don't panic
    4. Re:C is dead. Long live C! by HiThere · · Score: 1

      Context is important.

      C is great for small pieces of code. It gets increasingly awkwards as the size increases. So you need to modularize. Which is what Object Oriented languages do. Also what functional languages do, though they do it differently. I don't think either of those is the best choice for a MPU heavy environment. To me that sounds like a dataflow language would be best. But I can't think of any extant that aren't either moribund or so narrowly specialize that they might as well be. (Few languages are actually dead so far. I suspect that you can even find Snobol running somewhere. I know you can still find ICON.)

      --

      I think we've pushed this "anyone can grow up to be president" thing too far.
    5. Re:C is dead. Long live C! by jbolden · · Score: 1

      So far functional is doing amazing at parallel. Because the languages are side effect free you can embed execution strategies right in the code as a high level modifier that can be easily profiled / changed.

    6. Re:C is dead. Long live C! by HiThere · · Score: 1

      I agree, they *ought* to be good at parallel. But often they aren't, even if I don't know why. E.g. Racket Scheme has wonderful parallel constructs, but if you read the documentation carefully you discover that those constructs actually only run in one thread. (I'm particularly thinking about "futures" here.) And if I want to start separate isolated processes...I can do that in Ruby or Python or C or ...well, anything that can handle network connections to the same machine.

      Usually, I'll admit, the documentation isn't good enough to say that they are running these fancy parallel constructs in a single thread. But I don't find poor documentation convincing that there's a good implementation.

      --

      I think we've pushed this "anyone can grow up to be president" thing too far.
    7. Re:C is dead. Long live C! by jbolden · · Score: 1

      I've done it in Haskell and it was dirt easy. I know for Haskell that at runtime you have to declare at compile time thread characteristics, either use all available cores or use N cores (n is compile time fixed) which means the compiler is building a specific version. When I do that I usually get the speedups I would expect. It wouldn't shock me if GHC is far better than the Racket compiler.

      For example using the non-memozied Fibonacci and making it parallel:

      parFib :: Int -> Int
      parFib n | n cutoff = fib n
      parFib n = p `par` q `pseq` (p + q)
              where
                  p = parFib $ n - 1
                  q = parFib $ n - 2

      cutoff = 20::Int

      and fib is parFib with all the parallelisms removed.

    8. Re:C is dead. Long live C! by HiThere · · Score: 1

      I don't know Haskell, but in Erlang, which has semantics similar to those you show, maintaining locally accessible mutable state requries fighting the language. You *can* do it, and fairly simply, but all the sources tell you "Don't do this!", so my suspicion is that if I wrote anything sizeable it would lead to difficult to trace problems.

      But mutable state is a part of what many applications need. They just don't need globally visible mutable state.

      To be a little bit more precise, I could do things safely in Erlang (i.e., without violating strong recommendations) by storing changes in a database. But that would slow things down tremendously. "volatile" state doesn't usually need to be saved, since it's just going to change again anyway. But it does need to be able to be changed.

      Note that anything that can be calculated using mutable state that is safe to express, can be calculated in a pure functional language, if you don't concern yourself with memory and time. But the same it true of a Turing machine. For some classes of problems, pure functional languages work well. That fibonnacci example is a nice example of this. (IIUC that example calculates each small value of the function many times in the course of calculating larger values. Not ideal.) For this reason most functional languages have "escapes" which make them not-pure-fuctional..

      --

      I think we've pushed this "anyone can grow up to be president" thing too far.
    9. Re:C is dead. Long live C! by jbolden · · Score: 1

      I don't know Haskell, but in Erlang, which has semantics similar to those you show, maintaining locally accessible mutable state requries fighting the language.

      In Haskell state is handled by a monad so it is always isolated. There is no state outside any monadic structure whether parallel or not. Anything not in particular monads can executed in any order by the compiler by default. So state can them be isolated into monads each of which has local but not global state (so it never gets shared) where the monad isn't going to cross threads or state can be in the global single threaded monad which the other threads interact with (this is how I/O works for example). You can also use an actor model where the monads have state and communicate with each other via actors and that gets sequenced via. the I/O monad. This is the default, the easiest models are no different than how a basic print statement works in Haskell.

      IIUC that example calculates each small value of the function many times in the course of calculating larger values. Not ideal.

      I know I said that. The non-memoized algorithm works wonderfully as an example of parallel code. The memoized version can't really be made parallel but it is efficient:

      fibs = 0 : 1 : zipWith (+) fibs (tail fibs)
      fib n = fibs!!n

      For this reason most functional languages have "escapes" which make them not-pure-fuctional..

      Haskell outside of monads does not.

  18. Chicken by mynameiskhan · · Score: 1

    And perhaps from KFC as well... KFC's argument, "Programming languages come and go, but fried chicken is for ever".

    1. Re:Chicken by Anonymous Coward · · Score: 0

      And perhaps from KFC as well... KFC's argument, "Programming languages come and go, but fried chicken is for ever".

      Yeah! What's the matter Colonel Sanders? - Chicken?

  19. Simplify != LISP by fygment · · Score: 3, Funny

    LISP? Really?! Were they _trying_ to make the GPU less accessible?

    --
    "Consensus" in science is _always_ a political construct.
    1. Re:Simplify != LISP by wiredlogic · · Score: 1

      It was released by an academic researcher. It wouldn't be considered valid for career advancement unless he demonstrated his hardon for Lisp like everyone else in the department.

      --
      I am becoming gerund, destroyer of verbs.
  20. Practical Example by cmholm · · Score: 1

    I had the misfortune to inherit a series of instrument controllers and data collection routines written in Scheme, with hooks into legacy Fortran. A couple of engineers had kept their love of Scheme since university, and 25 years later elected to implement production code in it. Why? Because of the elegance of the grammar, which simplified their job .... because they were steeped in Scheme. When they left the shop, there was no one among the other 50 experienced engineers who had been anywhere near Lisp/Scheme since school. WTF? Who was the PM that allowed a dumb ass engineering decision like that?

    I suspect Harlan will see a lot of action in CS departments, and a handful of professionals subjecting their coworkers to it.

    --
    Luke, help me take this mask off ... Just for once, let me butterfly kiss you with my own eyes.
    1. Re:Practical Example by jbolden · · Score: 1

      What a terrible pity. A bunch of engineers got to work on a design they enjoyed and have enthusiasm for their work and also be more productive. Can't possibly understand why a PM would allow that since whoever had to maintain it would have to learn a few new things.

    2. Re:Practical Example by cmholm · · Score: 1

      A bunch? Two. Learn a few new things? Sure, let's do it in Prolog. Leverage the existing skill sets? Stone age.

      --
      Luke, help me take this mask off ... Just for once, let me butterfly kiss you with my own eyes.
    3. Re:Practical Example by jbolden · · Score: 1

      When did I say "leverage the existing skill set" I said "more productive". They are more productive because it is a language which allows for more abstraction. As would Prolog.

    4. Re:Practical Example by cmholm · · Score: 1

      Until they leave or move onto another project.

      --
      Luke, help me take this mask off ... Just for once, let me butterfly kiss you with my own eyes.
    5. Re:Practical Example by jbolden · · Score: 1

      Then after learning the language the new developers are also more productive in Prolog or LISP. The languages are inherently more productive.

      Moreover leaving is not a huge deal. You either train or hire for the skill set. These are not impossible find skill sets, rather you get very good quality people because the languages are enjoyable to top notch people.

  21. Quebec by aclarke · · Score: 1

    Will Quebecois programmers have to use .pfk as an extension?

    1. Re:Quebec by haruchai · · Score: 1

      Wait till you hear them try to pronounce Harlan.

      --
      Pain is merely failure leaving the body
  22. ECMAScript is the M-expression realized by tepples · · Score: 1

    BTW, there are numerous alternative syntaxes [for Lisp-like languages] around, but none of them was ever successful

    Not even JavaScript?

  23. I have no semaphore... by Chris+Mattern · · Score: 1

    ...and I must scream.

  24. Python as pseudocode by tepples · · Score: 1

    As such [Lisp] is readable by programmers and incidentally executed by a machine. In many ways it's almost like writing pseudo code, just in a strange syntax. [...] For a more mainstream language that might fill the same slot I can only think of python.

    Yeah, Python is like writing pseudocode too, only without the strange syntax. "Is that the pseudocode?" "No, that's the main function." Yet there are plenty of people on Slashdot who are staunch haters of leading whitespace as block delimiters, despite it being clearer to (human) readers than the parenthesis counting of Lisp.

    1. Re:Python as pseudocode by grumbel · · Score: 2

      The problem with the whitespace is that it makes copy&paste between different block levels extremely troublesome and fragile. It leads to lots of issues that you would never have with a proper block-end statement.

    2. Re:Python as pseudocode by Luna+Argenteus · · Score: 1

      the strange syntax

      S-expression is more like the textual representation of Lisp's abstract syntax tree than syntax. In the past Lisp had something more like a conventional syntax (M-expression) which (if I remember correctly) compiled into s-expression, but somehow people still liked s-expression better.

    3. Re:Python as pseudocode by Anonymous Coward · · Score: 0

      The real problem with whitespace is that it makes higher order programming more difficult and much less useful. That Python also has statements(everything should be an expression) is just adding insult to injury. In other words, enforced whitespace in Python makes the language weaker. That is why I hate it.

    4. Re:Python as pseudocode by bcboy · · Score: 1

      Lisp programmers don't engage in "parenthesis counting". They read it by indent, like python, and the editor does the counting.

      I'm working in both lisp and python at the moment, and it makes me dislike python more every day. Invariably, the allegedly readable, convenient syntax hurts more than it helps.

    5. Re:Python as pseudocode by jbolden · · Score: 1

      Apple's LISP incidentally had the same thing: http://en.wikipedia.org/wiki/Dylan_(programming_language)

  25. Python GPU type library by Anonymous Coward · · Score: 1

    There is another library in python which also eases gpu programming called Theano. http://deeplearning.net/software/theano/

  26. Readable Lisp s-expressions by dwheeler · · Score: 1

    Lisps, like Scheme and Harlan, can be made readable.

    Look at the Readable Lisp S-expressions Project, which extends traditional Lisp notation and adds capabilities such as infix and traditional f(x) style formatting. We provide open source software (MIT license) implementations, including one that can be used as a preprocessor. So, you can have your Harlan and stuff like infix too.

    Without these syntax improvements you're right. Very few developers will be happy writing complicated math expressions without infix. And a lot of code that uses GPUs will have significant math expressions.

    --
    - David A. Wheeler (see my Secure Programming HOWTO)
  27. An unfortunate lisp to choose by Anonymous Coward · · Score: 0

    The beauty in using a lisp is that in about an hour I could rewrite a couple Common Lisp macros and delete a dozen others to emit code for this instead of the crapfest that currently emits OpenCL. Then the macros implementing DSL's (which the relevant apps themselves are actually written in, except one that's in Python emitting code for a lispy DSL) won't notice or care. Lisp functions are for solving problems; lisp macros are for describing them succinctly. If you're lost in a maze of parens you're doing it entirely wrong.

    But I won't, for one reason. Chez only gives you a real compiler if you pay for it. They could have used Gambit or Bigloo or PLT/Racket or Chicken, or a Common Lisp like SBCL but they picked the one that's only useful for toy apps unless you pay. As sexy as it may be being able to describe everything declaratively, I'm not going to pay just to be able to properly benchmark the resultant code to see if Harlan is usable, and a lisp running under interpretation instead of machine code and forcing me to deliver the resultant app with an entire fucking development runtime as if it were still the 1970's makes me want to puke. But Kent unfortunately has a history of using IU to try to sell copies of Chez, so I'm entirely unsurprised. Hopefully this sort of thing will be less common when R7RS gives Scheme a real module system so so much Scheme code isn't tied to a particular implementation.

  28. AoS is object oriented by mangu · · Score: 1

    Replace "structure" with "object" and you'll see why most programmers think in terms of arrays of structures and not structures of arrays.

    Anyhow, for me that shows an intrinsic limitation of object oriented languages and why C still rules strong. When you run into the limitations of the hardware, you get to a point where object oriented languages are a limiting factor in optimization.

    When I started learning how to program neural networks in the 1980s, I realized that by turning object oriented programs inside out one could get orders of magnitude better performance. That's where the power of C with its flexibility in handling pointers come into play.

    Instead of declaring neurons as objects containing inputs, weights, and activation values, I declared arrays of weights, inputs, and activations. That way, calculating the activation of a neuron became a dot product of an array of inputs with an array of weights. The dot product is a common operation that is well optimized in any CPU.

    1. Re:AoS is object oriented by Unknown+Lamer · · Score: 1

      You've never used CLOS then, eh? The optimization you described is a classic use of the metaobject protocol to redefine the representation of instances through a metaclass. You get the performance boost without sacrificing the power of abstraction.

      Of course, the SML/Haskell folks would tell you OO is doomed, but only because using a proper type system and algebraic types allows the compiler to do all of the hard stuff for you...

      --

      HAL 7000, fewer features than the HAL 9000, but just as homicidal!
  29. Hate by Valdrax · · Score: 1

    Hate. Let me tell you how much I've come to hate this language since I began to code in it. There are 387.44 million parentheses ensconced around pages and pages of convoluted s-expressions that fill my programs. If the word 'hate' was engraved between each pixel of each character of those thousands of lines it would not equal one one-billionth of the hate I feel for functional programming at this micro-instant. For you. Hate. Hate.

    --
    If it's for-profit but free, you're not the customer -- you're the product (e.g., the Slashdot Beta's "audience").
    1. Re:Hate by Anonymous Coward · · Score: 0

      I share your hate, but this is about LISP syntax, not about functional programming. Look at Scala: functional but has a quite nice syntax.

    2. Re:Hate by Valdrax · · Score: 1

      It's a Harlan Ellison joke, people. It's AM's speech from "I Have No Mouth, and I Must Scream" about how much he hates humanity.

      Read a book!

      --
      If it's for-profit but free, you're not the customer -- you're the product (e.g., the Slashdot Beta's "audience").
  30. Another programming language waste of time by tyrione · · Score: 1

    And people wonder how come getting a Ph.D in CS versus Mechanical Engineering, EE, ChemE, Physics, etc., is a circle jerk waste of time.

  31. It's not the parentheses by istartedi · · Score: 1

    People always say it's the parens, but it's not. It's the prefix notation. The first thing that your program does is buried way down in the tree. IMHO, that's why most people find it hard to analyze non-trivial Lisp functions.

    (print (eval (read)))

    OK, easy. You gotta read, then evaluate, then print the result. In this regard, Lisp is like Forth--not too hard to understand if you write simple, meaningful functions and combine them. I think more Forth programmers are aware of the problem though. Lisp programmers will happily write 20 lines that they understand, but you're chasing through a rats nest to find that ever-elusive first thing the program does

    Now I'm not saying S-expressions are never good. When the hierarchy is what you care about, fine. When chronological sequence is being modeled though... wheew. Fuggedaboutit. Maybe I can turn myself into the kind of a person that quickly finds the proper chronology in the code; but why bother when there are much more readable ways to express it?

    --
    For all intensive purposes, "whom" is no longer a word. That begs the question, "who cares"?
    1. Re:It's not the parentheses by Unknown+Lamer · · Score: 1

      Is that really any different than any other eager language though? The C equivalent would be print (eval (read (STDIN)));. All you are doing is shifting the location of the parenthesis, and adding more punctuation.

      --

      HAL 7000, fewer features than the HAL 9000, but just as homicidal!
    2. Re:It's not the parentheses by istartedi · · Score: 1

      The C equivalent would be print (eval (read (STDIN)));

      Hmmmm... In C print isn't standard. printf is printf(char *fmt,...). Your eval function would have to return the result as a string of some kind. You could have it be a pointer to a chunk of memory that holds the string, but then it wouldn't be thread safe (forgetting for a moment that threads aren't spec'd out in C, let's say were POSIX for sake of argument). So if it's thread safe you could return a string, but then how do you free it?

      Because of these problems, C sort of forces you into something like:

      char *result=eval(read(stdin));
      printf("%s\n",result);
      free(result);

      The sequence of events is obvious, even if it's because of memory management issues as opposed to C's designer's forcing us to pay attention to chronology.

      Of course I know you could probably whip up some contrived C that was a valid program in a very prefix oriented style. Heck, there's obfuscated C out there like a ray-tracer shaped like a big ASCII Teapot. In both cases it's not normal C style. In any sane C style, the chronology tends to be obvious. To reiterate, I think it's more accident than design. You'd have to ask K and R though...

      --
      For all intensive purposes, "whom" is no longer a word. That begs the question, "who cares"?
    3. Re:It's not the parentheses by jbolden · · Score: 1

      The main things with good functional code is you don't think in terms of "first thing the program does". You shouldn't care about order at all. What's important is the hierarchy. That's why Haskell introduced do notation to allow for imperative statements to be in imperatives if order matters

  32. Come to think of it... by istartedi · · Score: 1

    Oh, the danger of spitballing code online. About an hour later I'm watching TV and thinking about my last post. Then I recall that the order of evaluation in C is unspecified.

    Thus, even if you did try to write C in prefix style, the order in which things are evaluated is potentially botched. In a pure functional language this doesn't matter. Either that, or Lisp specifies an order of evaluation even if you might have side effects. I think. I'd better shut my mouth before I look any more stupid; but the original point stands--C doesn't lend itself to that kind of thing. It's a "portable assembler". One thing happens. Then another, then another, etc...

    --
    For all intensive purposes, "whom" is no longer a word. That begs the question, "who cares"?
  33. Worse than that by Anonymous Coward · · Score: 0

    It's actually named after Veit Harlan.