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.

134 of 195 comments (clear)

  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.

  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 ebno-10db · · Score: 1

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

    14. 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.

    15. 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.

    16. 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.
    17. 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.

    18. 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.

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

      So LISP programmers wear skinny jeans and emo glasses?

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

      The are native compilers for Lisp.

    21. 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.

    22. 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.

    23. 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.

    24. 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.

    25. 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.

    26. 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.

    27. 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
    28. Re: dialect of LISP by jbolden · · Score: 1

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

    29. 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.

    30. 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

    31. 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.

    32. 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.

    33. 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
    34. 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.

    35. 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
    36. 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.

    37. 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 Wootery · · Score: 1

      And now I know ;P

    3. 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).

    4. 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.
    5. Re:Link to a simple example by Charliemopps · · Score: 1

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

    6. 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.

    7. 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)
    8. 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.

  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. 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 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.

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

      He said Python, not Javascript.

    6. 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
    7. 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.

    8. 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
    9. 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.
    10. 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!

    11. 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.

  7. 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 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
    3. 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.
    4. 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.
  8. 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.

  9. 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.

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

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

  11. 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 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.

    3. 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.
    4. Re:Hmm by DrXym · · Score: 1

      Oh and add HLSL and Renderscript for good measure.

    5. 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.

    6. 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.

    7. 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.

  12. 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 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.
    2. 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/

    3. 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.
    4. Re: BS by CadentOrange · · Score: 1

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

    5. 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.
    6. 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 ;).

  13. 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.
  14. 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 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?
    2. Re:C is dead. Long live C! by xtal · · Score: 1

      Python is great. It ain't C.

      --
      ..don't panic
    3. 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.
    4. 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.

    5. 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.
    6. 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.

    7. 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.
    8. 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.

  15. 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".

  16. 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.
  17. 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.

  18. 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
  19. 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?

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

    ...and I must scream.

  21. 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 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.

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

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

  22. 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/

  23. 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)
  24. 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!
  25. 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 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").
  26. 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.

  27. 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

  28. 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"?
  29. Re:News for luddites by jbolden · · Score: 1

    Because /. has become incredibly conservative.