Stories
Slash Boxes
Comments

News for nerds, stuff that matters

Slashdot Log In

Log In

[ Create a new account ]

Processing Visualization Language Ported To Javascript

Posted by kdawson on Friday May 09, @12:24PM
from the time-to-buy-stock-in-noscript dept.
Manfre writes "On his birthday, John Resig (creator of jQuery) has given a present to developers by releasing Processing.js. This is a Javascript port of the Processing Visualization Language and a first step towards Javascript being a rival to Flash for online graphics content. His blog post contains an excellent writeup with many demos."

Related Stories

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.
  • by Uncle Focker (1277658) on Friday May 09, @12:28PM (#23351576)

    This is a Javascript port of the Processing Visualization Language and a first step towards Javascript being a rival to Flash for online graphics content.
    Whoever wins, we lose.
  • 'polished turd' (Score:3, Insightful)

    by teknopurge (199509) on Friday May 09, @12:32PM (#23351636) Homepage
    This is some great work....

    but this is like a polished-turd. Flash doesn't exist anymore to do animation or dynamic graphics, it exists to run fast. JS engines were not designed to process this kind of data efficiently, as seen by your CPU graph when running the demos.

    I don't want to take away from the work, because it's a slick hack, but it's not the right tool for this job.

    Regards,
    • Flash doesn't exist anymore to do animation or dynamic graphics, it exists to run fast.

      Wait, are we talking about the same Flash? Because I've done a lot of Flash and Actionscripting, and "Fast" is not even in the vocabulary. Software rendered graphics pipeline? Check. Slow VM interpreter that makes Java 1.0 look fast? Check. Lack of direct rendering APIs? Check. Focus on animation at the expense of dynamic scene creation? Check.

      Granted, Flash 9 is a major improvement, but it is arriving rather late in the game.
        • Check out http://varriastudios.com/ [varriastudios.com] for a site that illustrates what I'm talking about.

          A user interface? I think you have a very odd definition of "Fast". All you've proven is that Flash is designed to do pretty animations. Well, that's kind of the point. Not to run "Fast". "Fast" was never a part of the design. Just look up the "Actions" portion of the Flash 8 spec sometime and you'll be utterly horrified.

          That being said, Flash does do animations well. That's what it was designed for. As a result, it has even been used to create games [newgrounds.com]. It never did games all that well, but Moore's law eventually made it possible to come up with some fairly decent stuff.

          Of course, if you're referring to "my Flash animations move faster than my DHTML animation", that's just plain user-error. The Flash animations work better because Flash Studio works out all the timings of the motions for you. If you Actionscripted your motions, they'd come out about the same as they would in Javascript. (And being nearly the same language, it's possible to try the same motion code in both.)

          This issue is what the Javascript PVL is intended to solve. i.e. A standard framework for providing animation/motion with minimal input from the developer.
            • JS interpreters are not optimized to do image manipulation, DOM updates, etc.

              Whiskey Tango Foxtrot. Optimized for image manipulation? You do absolutely ZERO image manipulation in Javascript. Same with Actionscript. All that is pushed down into the Canvas and Flash rendering engines, respectively. Same thing with DOM manipulations. Sure, you say "insert this item" or "delete this object", but it's the C/C++ engine under the covers that does the heavy lifting.

              People haven't done their own image manipulation since Amigas stomped the earth.

              Right now it's always faster(CPU %) to do an animation in Flash then it is to do the same animation in JS.

              You make that statement, yet you posted a benchmark that showed Javascript to be faster than Flash. I'm rather confused. You do realize that the benchmark you posted below was in millisecond and not operations per second, right? i.e. Lower is better.

              You have zero evidence for your statements. Listen to someone who actually knows something about these platforms. There's no reason why Javascript can't perform the same function as Flash using the Canvas APIs. And you know what? That's not a bad thing. :-)
            • I mentioned this above, but I'll reiterate it here. In that benchmark, LOWER IS BETTER. The brand-new Flash 9 VM engine did excellent (as I expected it would), but the Flash 7 and 8 engines were generally creamed by the Javascript engines. Which I don't think is what you're trying to prove at all.

              The secret to the performance of Flash 9 is this little beauty: http://www.mozilla.org/projects/tamarin/ [mozilla.org]

              A fully modern, high-performance, Just In Time compiler that gives the JVM a run for its money. It's an amazing piece of Javascript technology that Adobe has donated to the Mozilla project for inclusion in the next major revision of FireFox. Wonderful, wonderful engine that absolutely no one is using yet.

              See, if you compiled to Flash 7 or 8, you're still triggering the Flash 8 engine. The Flash 9 engine is a complete rewrite that only works with Flash 9 content. So the next chapter of performance wars has yet to be written.

              Q.E.D.
    • Flash doesn't exist anymore to do animation or dynamic graphics, it exists to run fast.
      So when is Adobe finally going to get around to meeting that goal?
    • by Anonymous Coward on Friday May 09, @12:41PM (#23351786)
      Flash itself uses a dialect of ECMAScript (the common parent language of Javascript and ActionScript). So your assertion that Javascript engines were not written to do this is flat out wrong.

      All this shows is just how terrible most browser's Javascript engines really are. Notice, modern browsers do considerably better on these demos than older ones, mainly because so much of the web has shifted to using Javascript and dynamic content, such that JS becomes a limiting factor in usability. Once JS engines have caught up to ActionScript in speed, what more use do we have for Flash? We already have Mozilla working to make use of the Tamarin byte-code engine, which will turn JS from being a slow, interpreted language into being a byte-code compiled language (speed on the order of modern scripting languages such as Python/Ruby and to some extent Java/C#).

      So sorry, Javascript is the right tool for the job. It's the only tool for the job as far as Open Standards are concerned.
    • Re:'polished turd' (Score:4, Interesting)

      by kestasjk (933987) on Friday May 09, @01:11PM (#23352252) Homepage
      JS engines aren't currently designed for it, but this is what Canvas (and a lot of HTML5) is all about..

      If you prefer think of this as Processing on Canvas, rather than Processing on JavaScript, because Canvas is the enabling technology here.

      And I don't know where you get off calling it a "polished turd". (Makes me want to poke around your homepage-vertisement, and see if you have a right to make those judgements)

      The Java requirement was always a pain to deal with before, and this "polished turd" removes that and makes visualizations much more portable and easier to play around with.

      Also the moving visualizations have always been CPU intensive, that's the nature of what they are; they're supposed to be easy to create visualizations of data, it's not a video game. It was like this on Java too.
      Note that the static practical visualizations, which take dynamic data, draw the visualization and then end, need much less CPU than dynamic ones like you might see in a flashy demo.

      This is a very good thing, and a very welcome surprise; Processing really does offer something that's pretty unique, and I look forward to seeing more of it. Kudos Resig
  • This is a Javascript port of the Processing Visualization Language and a first step towards Javascript being a rival to Flash for online graphics content.

    Second step, actually. Apple and the WHATWG [whatwg.org] took the first step by introducing the Canvas API to the HTML 5 spec. That gave web developers the ability to do Flash-like content. This language is the second step, in that it gives programmers a standard framework from which to create impressive animations.

    Kudos to Mr. Resig on a job well done! I can't wait to play around with this project more. :-)
  • The primary strength of Flash is its single vendor, rigorously portable, rigorously backwards compatible runtime. Javascript is far too fragmented to be a competitor to flash.
    • by ozamosi (615254) on Friday May 09, @01:13PM (#23352278) Homepage
      I know, and so does everyone else.

      You know, I recently heard about a project by John Resig (creator of jQuery) called Processing.js. It's a Javascript port of the Processing Visualization Language, which means it could be viewd as a rival to Flash for online graphics content.

      You should check out his blog post [ejohn.org]

      In case the sarcasm wasn't obvious enough: that's one of the most important things that Javascript libraries solve
  • Eric (Score:5, Insightful)

    by erickhill (1235704) on Friday May 09, @01:05PM (#23352140)
    Regardless if this is usable today for client work, this is insane stuff. The first iteration of Flash eons ago had plenty of nay-sayers. He made this over the course of seven months? Bow down, I say. Very impressive.
  • Thus, anything outside of the above (images, pixel processing, and text) should work "ok" everywhere.
    Is it just me or does graphical language that does not fully support image, pixel, or text processing seems a bit.... silly.

    Don't get me wrong, I think its a cool toy I will be playing with, but until it actually works in more than one beta browser, its is no threat to Flash at all.

    -Em
    • Re:My Post (Score:5, Funny)

      by LighterShadeOfBlack (1011407) on Friday May 09, @12:34PM (#23351676) Homepage
      First of all... you got second post. Second of all, TFA is about Javascript, not Java.

      Other than that your post was completely relevant.
    • Re: (Score:3, Informative)

      by Anonymous Coward
      I am sick and tired of people confusing Java and javascript. They are not the same language. They are not even related languages. javascript is crappy scripting language for use with HTML. It is run my the browser and aids in display time processing.
      • Re:My Post (Score:5, Funny)

        by truthsearch (249536) on Friday May 09, @01:49PM (#23352752) Homepage Journal
        Jules: Whoa, whoa, whoa, whoa... stop right there. Javascript and Java ain't even the same fsckin' thing.
        Vincent: It's not. It's the same ballpark.
        Jules: Ain't no fsckin' ballpark neither. Now look, maybe your method of programming differs from mine, but, you know, writing a web page, and coding for the JVM, ain't the same fsckin' ballpark, it ain't the same league, it ain't even the same fsckin' sport. Look, Javascript don't mean shit.
      • Re:My Post (Score:5, Insightful)

        by fuzzy12345 (745891) on Friday May 09, @02:24PM (#23353164)

        javascript is crappy scripting language for use with HTML. [...] Java is a full blown object oriented programming language
        I think you meant to say "Javascript is a full blown power-users' language, basically Lisp but with syntax problems, whereas Java is a crappy low-level language; the COBOL of the millenium."
        • Re:My Post (Score:5, Interesting)

          by compro01 (777531) on Friday May 09, @02:46PM (#23353380)
          COBOL is still alive and kicking in the financial sector and it's fairly decent for what it's designed to do. i really wouldn't want to use it for general programming, but i wouldn't want to write a payroll app in C++ either.
    • Re:Rival?! (Score:5, Informative)

      The article submitter has clearly never actually used the HTML canvas object.

      Oh? I have, and I don't disagree. Of course, I've USED Flash quite a bit too, so I know how God-aweful slow that platform was up until version 9. ;-)

      There's no way in HELL canvas & javascript together could ever approach the render and execution performance of Flash.

      Why not? Flash == Software renderer. Canvas == Software renderer. Actionscript == ECMAScript engine. Javascript == ECMAScript engine. I'm not seeing the issue.

      Hell, once FireFox is on the Tamarin engine, the two platforms will be practically the same!
    • by grahamd0 (1129971) on Friday May 09, @01:18PM (#23352340)

      Can someone please explain to me why anyone would regard jquery as a black mark on John Resig's work?

      I've found it very useful for anything but the most mundane js tasks. Certainly better than the piles of other libraries that all seem to be based around the fallacy that javascript needs classical inheritance. (Hint: It doesn't. It has prototypal inheritance.)