Slashdot Mirror


Processing Visualization Language Ported To Javascript

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

171 comments

  1. Heh AvP comes ot mind here by Uncle+Focker · · Score: 4, Funny

    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.
    1. Re:Heh AvP comes ot mind here by Anonymous Coward · · Score: 4, Insightful

      You lose anyway. You and the rest of the "ASCII text forever" crowd don't speak for me.

    2. Re:Heh AvP comes ot mind here by edalytical · · Score: 5, Funny

      Score one for the "UTF-8 text forever" crowd. Thanks for the support!

      --
      Win a signed Stephen Carpenter ESP Guitar from the Deftones: http://def-tag.com/?r=0008781
    3. Re:Heh AvP comes ot mind here by Uncle+Focker · · Score: 2, Interesting

      You lose anyway. It comes with the territory.

      You and the rest of the "ASCII text forever" crowd don't speak for me. And this crowd, whose membership I've been forced into against my will, doesn't speak for me either.
    4. Re:Heh AvP comes ot mind here by rbanffy · · Score: 2, Insightful

      All we need is a decent and fast implementation of JavaScript. Apple seems to have a nice one in Safari that appears decent in Midori/Webkit.

      And, BTW, we need one badly, because the Flash (I don't trust Adobe) and Silverlight (I don't trust MS) crowds are coming and won't wait for a fast JavaScript engine.

    5. Re:Heh AvP comes ot mind here by Dachannien · · Score: 1

      That's okay. Your vote only counts if you log in.

    6. Re:Heh AvP comes ot mind here by Paradise+Pete · · Score: 4, Funny
      And this crowd, whose membership I've been forced into against my will, doesn't speak for me either.

      4F682079657320776520646F2E

    7. Re:Heh AvP comes ot mind here by Uncle+Focker · · Score: 2, Funny

      4F682079657320776520646F2E You do not!!! Damn you hex text bastards!
    8. Re:Heh AvP comes ot mind here by Chris+Burkhardt · · Score: 2, Funny

      You lose anyway. You and the rest of the "ASCII text forever" crowd don't speak for me.

      The don't speak for me either. I'm really getting into this UTF-8 stuff lately.

      --
      "And there be unix which have made themselves unix for the kingdom of heaven's sake." - Matt. 19:12
    9. Re:Heh AvP comes ot mind here by Anonymous Coward · · Score: 0

      Some Ruby to translate:

      "4F682079657320776520646F2E".scan(/../).collect {|s| s.hex.chr}.join

    10. Re:Heh AvP comes ot mind here by tigersha · · Score: 1

      RIght on the money. While the OSS crowd is full of "I hate all things graphical" morons the rest of the world is not. What will happen in the end is that the web WILL turn ito an application platform, but it needs much more than the current crop of browsers. The world will embrace Silverlight and/or Flash simply because the OSS crowd will not support and always infighting about the whole idea of graphics in a browser.

      Here is a hint for the ASCII über alles crowd: Substance is better than style, yes. But the presence of style does not imply a lack of substance. Ok? Can we get over that??

      Microsoft is waiting the background to design a REAL application platform that will work on the web and it WILL eat your lunch. Instead of claiming that the world does not want graphics and therefore Microsoft is evil for forcing it down, rather think that the real world want this and Microsoft is providing something you are not.

      And no, knowing how to be a l33t hax0r d00d on a terminal commandline does no make your dick grow either.

      --
      The dangers of excessive individualism are nothing compared to the oppressiveness of excessive collectivism
    11. Re:Heh AvP comes ot mind here by Anonymous Coward · · Score: 0

      Some Python to translate:

      import binascii
      binascii.unhexlify("4F682079657320776520646F2E")

  2. Creator of WHAT?! by Anonymous Coward · · Score: 0

    I was a bit excited to read about a JS library that can potentially compete with Flash, but then I saw the writer is the same person behind JQuery. I'll still play around with it a little, but my hopes are somewhat tempered now.

    1. Re:Creator of WHAT?! by grahamd0 · · Score: 5, Insightful

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

    2. Re:Creator of WHAT?! by Anonymous Coward · · Score: 0

      I never said there's anything wrong with JQuery, it's just that, like you said, it's only useful for the most mundane of website-related tasks (not to mention it'll be more-or-less obsolete as support for CSS3 becomes more widespread).

    3. Re:Creator of WHAT?! by grahamd0 · · Score: 4, Insightful

      Actually, I said it was useful for anything except the most mundane tasks (where the overhead of loading a library is not justified by the task).

    4. Re:Creator of WHAT?! by hkgroove · · Score: 0, Offtopic

      You can now draw Homer Simpson with CSS and Javascript

      http://nedbatchelder.com/blog/200805/css_homer_animated.html

    5. Re:Creator of WHAT?! by Anonymous Coward · · Score: 0

      Are you and I talking about the same JS library here? Uses a wrapper for GetElementsByTagName and GetElementByClass, has syntax that allows methods to be "chained" in order of execution, does mostly DHTML stuff with a little AJAX tacked on for hype? I have to concede, it's extremely clever, but it's not really useful for anything beyond blinging up your site.

    6. Re:Creator of WHAT?! by IdeaMan · · Score: 1

      Yes but will it run without turning off NoScript?

      --
      They ARE out to get you simply because They are in it for themselves and they don't care about you.
    7. Re:Creator of WHAT?! by fredrik70 · · Score: 1

      try mochikit. having said that, they both play nicely together, so you can have the best of both worlds

      --
      if (!signature) { throw std::runtime_error("No sig!"); }
    8. Re:Creator of WHAT?! by thePowerOfGrayskull · · Score: 1
      The original renders: http://www.romancortes.com/blog/homer-css/

      Beyond that, I don't understand the point of the question? If you're turning on NoScript, you doubtless have NoFlash or something similar anyway.

    9. Re:Creator of WHAT?! by Fatalis · · Score: 1

      it's useful for everything that a js framework can be useful for.

      --
      Deus est fatalis
    10. Re:Creator of WHAT?! by tcr · · Score: 1

      Ooh, enigmatic.
       
      Your bit of insight failed to mention what's you think is wrong with it.
       
      I've worked with many popular JS libraries and frameworks, and find jQuery indispensible.

      --


      Information wants to be beer.
    11. Re:Creator of WHAT?! by IdeaMan · · Score: 1

      My point is that active content is being comprehensively blocked due to abuse.
      Designing your site to require it for navigation or critical content is completely FUBAR.

      --
      They ARE out to get you simply because They are in it for themselves and they don't care about you.
  3. 'polished turd' by teknopurge · · Score: 3, Insightful

    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,

    1. Re:'polished turd' by AKAImBatman · · Score: 5, Insightful

      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.
    2. Re:'polished turd' by Uncle+Focker · · Score: 2, Funny

      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?
    3. Re:'polished turd' by Kenoli · · Score: 1

      Agreed. The life demo is especially laggy. ( http://ejohn.org/apps/processing.js/examples/topics/conway.html )

    4. Re:'polished turd' by teknopurge · · Score: 1, Informative

      Flash, when used non-gratuitously, has always run fast for me. Check out http://varriastudios.com/ for a site that illustrates what I'm talking about.

    5. Re:'polished turd' by teknopurge · · Score: 1

      no idea - I'm not a flash guy by trade. If you want to talk Java and JavaFX I'm all for it. :)

      Kind Regards,

    6. Re:'polished turd' by AKAImBatman · · Score: 5, Interesting

      Check out http://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. 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.
    7. Re:'polished turd' by Anonymous Coward · · Score: 1, Interesting

      Flash doesn't exist anymore to do animation or dynamic graphics, it exists to run fast. Clearly you've never run Flash on Mac OS.
    8. Re:'polished turd' by teknopurge · · Score: 1, Troll

      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.) Completely and utterly false.

      JS interpreters are not optimized to do image manipulation, DOM updates, etc. Now this isn't to say they aren't moving in that direction, but as of now they are atrocious at these tasks.

      Flash is a completely separate environment from the browser, is vector based and inherently performs animation better. Right now it's always faster(CPU %) to do an animation in Flash then it is to do the same animation in JS.

      Regards,

    9. Re:'polished turd' by teknopurge · · Score: 1

      found this:

      http://www.oddhammer.com/actionscriptperformance/set4/

      don't know the accuracy, but interesting nonetheless.

    10. Re:'polished turd' by AKAImBatman · · Score: 4, Insightful

      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. :-)
    11. Re:'polished turd' by kestasjk · · Score: 3, Interesting

      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

      --
      // MD_Update(&m,buf,j);
    12. Re:'polished turd' by AKAImBatman · · Score: 5, Insightful

      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/

      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.

    13. Re:'polished turd' by kestasjk · · Score: 1

      This is an example, and it's an impressively large grid running at decent speeds.

      Bram Cohen (bittorrent guy) had a JavaScript game of life on his page at one point, which used tables instead of Canvas, and it was much, much slower on a much, much smaller grid. (I can't find a link for comparison now though)

      --
      // MD_Update(&m,buf,j);
    14. Re:'polished turd' by erickhill · · Score: 1

      You obviously have never used Gameday at mlb.com - play-by-play of ever single real-time pitch/hit/play. Come on man, Get real.

    15. Re:'polished turd' by teknopurge · · Score: 2, Informative
      Please check that link again as it appears you ahve misread it.

      Lower is better. Got it.

      Array join (array size 1000, 500 iterations)
      JS: FF2 - 375ms, Flash - 303ms

      substring (10000 iterations)
      JS: FF2 - 16ms, Flash - 3ms

      Did you look at the link I posted at all? Even the older versions of Flash were split with JS ~50/50 on the various datapoints.

      I'm not implying it's a bad thing to try, but seriously. Did you even look at the JS code that is your "framework" to this stuff? Let me grab you a piece:


          do {
                          v1 = 2 * p.random(1) - 1; // between -1.0 and 1.0
                          v2 = 2 * p.random(1) - 1; // between -1.0 and 1.0
                          s = v1 * v1 + v2 * v2;
                      } while (s >= 1 || s == 0);
                      var multiplier = Math.sqrt(-2 * Math.log(s)/s);
                      nextNextGaussian = v2 * multiplier;
                      haveNextNextGaussian = true;

                      return v1 * multiplier;


      The JS engines are not optimized to do the above. Sure they will do it, but not with any semblance of efficiency.
    16. Re:'polished turd' by teknopurge · · Score: 1

      I do every day.

      I should have said "in an optimized manner" instead of 'fast'. Instead of splitting hairs my point is that Flash is designed to do particular things and has the tools to do them in a reasonable way.

      JS does not.

    17. Re:'polished turd' by frosky · · Score: 3, Insightful

      As a longtime Flash developer i can also tell you that wether u use it for animation, GUIs or for basic web apps, the primary appeal to people like me was that Macromedia created avery easy to learn authoring environment. And even as the application grew to include programming and such, its concept of timeline, tweens, movieclips, etc. was far simpler to learn than the alternatives - including MM Director. To me that is the core strength of Flash. So whoever attempts to compete should take that into consideration. Before Adobe acquired MM they failed miserably at competing because they had a very clunky authoring environment (at least as noted by most of my developer peers at the time)

    18. Re:'polished turd' by AKAImBatman · · Score: 2, Insightful

      Please check that link again as it appears you ahve misread it.

      Actually, you should check my post below as I explained in detail why Flash lost that handily. The short version is that Flash 9 is not comparable right now because the VM is not in use by many projects. By the time it's in heavy use, FireFox will be using the exact same engine.

      Did you even look at the JS code that is your "framework" to this stuff?

      Sure. And the piece you picked (like most of the code) is motion computations. The piece you picked does a handful of mulitplies and library (fast!) calls for log, random, and square root. That *could* be heavily optimized with lookup tables, but there wouldn't be much point. That's not even a blip on the processor's time. All the real work is done in the Canvas API calls where the blitting happens.

      There is no image manipulation in Javascript or Actionscript. The computations you see could be faster if Javascript had true primitive support, but at the end of the day it just doesn't matter. I know that because that was optimization 101 back when we developers had to write our own 3D engines. A routine that runs once per frame is far less of a concern than a routine that runs once a line or even once a pixel! Moore's law has continued to reinforce that truth. :-)
    19. Re:'polished turd' by Kenoli · · Score: 1

      Still, it cripples my browser.
      Do you think something like this could be drastically optimized?

    20. Re:'polished turd' by MenTaLguY · · Score: 1

      And of course, by the time Flash is using Tamarin, so will Javascript be (at least in Firefox).

      --

      DNA just wants to be free...
    21. Re:'polished turd' by Uncle+Focker · · Score: 1

      So, half past a blue moon?

    22. Re:'polished turd' by ardor · · Score: 1

      That *could* be heavily optimized with lookup tables, but there wouldn't be much point. Nowadays, lookup tables for log and sqrt are unwise. The CPU has instructions for this, and lookup tables just trash the cache. Random numbers *can* be reasonable as a LUT, especially pseudorandom stuff like Perlin Noise. But your average random() function does not belong in a LUT either.
      --
      This sig does not contain any SCO code.
    23. Re:'polished turd' by mad.frog · · Score: 1

      > absolutely no one is using yet

      Er, except for Flash 9. Which it was originally written for.

    24. Re:'polished turd' by GweeDo · · Score: 1

      That site is a great example of how not to use Flash. Not one thing there couldn't easily be done with standard HTML+CSS+Javascript. All they have now is a site that is hard to crawl and index and un-usable by the impaired. Go Flash!

    25. Re:'polished turd' by Dachannien · · Score: 1

      Flash, when used non-gratuitously Well, there's yer problem!

    26. Re:'polished turd' by mad.frog · · Score: 1

      Tamarin is used in all Flash Players since version 9.

    27. Re:'polished turd' by Uncle+Focker · · Score: 1

      I should have said "in an optimized manner" So then you clearly haven't run Flash on Mac OS X.
    28. Re:'polished turd' by AKAImBatman · · Score: 2, Informative

      I think you missed the point. If your Flash code is not compiled for Flash 9, Tamarin is not used. The old Flash 8 engine gets loaded instead. Since the vast majority of Flash content is still Flash 8, no one is using Flash 9. :-)

    29. Re:'polished turd' by pjt33 · · Score: 1

      People haven't done their own image manipulation since Amigas stomped the earth. I have, working for a company which makes Java games and still supports MSJVM. We wrote our own libraries to do almost everything because there wasn't available library support for it.
    30. Re:'polished turd' by Anonymous Coward · · Score: 1, Informative

      Tamarin is used in all Flash Players since version 9.

      And all of the web designers upgraded their Adobe Flash, and deleted all their old .swf files in favor of re-creating them in Tamarin-compatible form?

    31. Re:'polished turd' by vandit2k6 · · Score: 1

      But if Javascript does the job well, than what exactly is the problem? Does it really matter in the end? When you buy a piece of furniture in the store do you abide by the rules of using the furniture. For example do you always sit on a chair and never stand on it.

      --
      Its nice to be important but its more important to be nice
    32. Re:'polished turd' by kestasjk · · Score: 2, Insightful

      Conway's game of life isn't a very realistic use case, a large bit-array with lots of sequential reads/writes. It's always going to be a CPU-bound task, no matter what optimization it gets More interesting and realistic are the graphical demos, which show off Canvas. The ones which draw something in Canvas and then do nothing more are probably the most realistic real-world-like demos, and they shouldn't cripple anything.

      --
      // MD_Update(&m,buf,j);
    33. Re:'polished turd' by teknopurge · · Score: 1

      I used it as an example of how it was much faster for the developer to make it using Flash authoring tools to get the look he was after then using HTML. Of course you could make a similar site using HTML+CSS - that's not the point.

      It also take significantly fewer request to load(i.e. 2) then a normal site.

    34. Re:'polished turd' by MrMunkey · · Score: 1

      Thanks so much for all the great information about Javascript. As Doug Crockford says, it's The World's Most Misunderstood Programming Language Just a few months ago I started a project (in my spare time of course) to see how I could push my knowledge of the language, and I came up with this: Track Attack. It's far from complete, but uses Javascript for everything except sound (which uses an API to flash to handle it). The browser isn't taxed too much (after some tweaking on the music) and it was a fun experiment. All the code is in-line so that you can view the source quite easily. Kind of off-topic, but I thought I'd throw it out there. Javascript can be useful in the right hands.

    35. Re:'polished turd' by Anonymous Coward · · Score: 0

      Professional UI Designer review of his homepage-vertisement:

      Very Slow (to the point of being unusable and crashing my browser)

      10 CSS errors and growing.. something seems to be dynamically adding css specifications to the page.

      A+ on navigation being usable with stylesheets turned off

      F- for making my computer unusable when looking at the page. I think it's the flash.

      Doesn't seem like the kind of person who should be talking about efficient flash.

    36. Re:'polished turd' by SanityInAnarchy · · Score: 1

      The VM does, however, make most JavaScript implementations look slow -- emphasis on "most".

      Which is why the Tamarin project exists.

      --
      Don't thank God, thank a doctor!
    37. Re:'polished turd' by SanityInAnarchy · · Score: 1

      Or Linux.

      But then, most of my complaints about Flash are its video playback.

      --
      Don't thank God, thank a doctor!
    38. Re:'polished turd' by Anonymous Coward · · Score: 0

      Next chapter of performance wars is already won, by the geeks from Redmond.

      http://www.bubblemark.com

      I know it's hard to stomach. Let out a good cry Java-heads, it's healing.

    39. Re:'polished turd' by Anonymous Coward · · Score: 0

      Flash is a polished turd. It doesn't let you use basic browser controls.

    40. Re:'polished turd' by naz404 · · Score: 1

      That's bull.

      With the increasing number of Flex developers and Flash developers switching over to AS3 and the Flash 9 AVM2 engine, you sir, are talking out of your ass.

      Check out all those flash sites that use papervision3d, a 3D software renderer for Flash. That's all Flash 9 AS3.

      Picking up is not no one. There's a lot of demand for Flex developers right now (output = Flash 9 AVM2) and it's growing as an alternative to AJAX because AJAX eats a crapload of bandwidth since the Javascript code and XML aren't compressed. Moreover, your front-end code is visible in AJAX.

    41. Re:'polished turd' by naz404 · · Score: 1

      Moreover, Flash "runs almost everywhere" on browsers, and that's the core strength of Flash. Javascript is a hell of a headache to get running cross-platform with the aftermath browser wars and different JScript/Javascript implementations.

    42. Re:'polished turd' by AKAImBatman · · Score: 2, Interesting

      With the increasing number of Flex developers and Flash developers switching over to AS3 and the Flash 9 AVM2 engine
      Who still haven't produced a critical mass of software yet. In fact, there are very few Flex sites in existence. Adobe's exit from the J2EE market hasn't helped their case one bit.

      Check out all those flash sites that use papervision3d, a 3D software renderer for Flash. That's all Flash 9 AS3.
      Papervision 3D was created for Flash 8 and ported to Flash 9. If you see a Papervision app, there's a good chance it's Flash 8.

      [Flex is] growing as an alternative to AJAX because AJAX eats a crapload of bandwidth since the Javascript code and XML aren't compressed.
      AJAX uses as much or as little bandwidth as you design it to. (That's one of the reasons why JSON is becoming a popular alternative to XML.) Flex will happily chew just as much bandwidth if you design it to do so. In fact, if you use the object remoting features, you're likely to use a lot MORE bandwidth due to the nature of distributed objects.

      Oh, and my company compresses the hell out of our Javascript and XML. Seems this little thing called GZip compression is supported by every major browser on the market. Who'da'thunk, eh?

      Moreover, your front-end code is visible in AJAX.
      You don't really know a whole lot about AS3, do you? Like, for example, it's stupidly easy to decompile the code. Worrying about someone having access to your source is so 1990's. You had better get over it, because your source is open for the world to see. That goes for Java, Javascript, Actionscript, C#, and just about any other modern language you can think of.

      you sir, are talking out of your ass.
      Classic case of pot and kettle. Please get your facts straight before being so rude in the future. It really is upsetting and therefore tempting to use rather abusive language in return.
    43. Re:'polished turd' by nova_ostrich · · Score: 1

      In fact, there are very few Flex sites in existence.

      Public Flex sites, true. Most Flex apps run behind enterprise firewalls.

      If you see a Papervision app, there's a good chance it's Flash 8.

      Yeah right. No one in their right mind would run Papervision in Flash 8. It barely runs in Flash 9, hogging 100% of CPU.

      --
      It's scary being a Flash and Flex developer on Slashdot. You guys are unnaturally rabid.
    44. Re:'polished turd' by nova_ostrich · · Score: 1

      They already did. Flash Player 9 is running some nice JIT-compiled bytecode that is 10-30 times faster than previous versions. I'm not sure how it compares to Java, but it's definitely much faster than most browser-based JavaScript engines these days.

      Disclaimer: Designers who write code generally write bad code, so not all AS3 code is going to be as fast as it could. It's sad because that's why people think Flash is slow.

      --
      It's scary being a Flash and Flex developer on Slashdot. You guys are unnaturally rabid.
    45. Re:'polished turd' by BungaDunga · · Score: 2, Informative

      The AS2 version of Papervision has basically been discontinued: all the shiny stuff is in the AS3 version. There's quite an incentive to run it in AS3, because it's relatively fast compared to the old AVM. Since I started messing around in PV3D I've switched entirely to AS3: it's not really much of a change in coding style.

    46. Re:'polished turd' by 8-bitDesigner · · Score: 1

      You have a very strange definition of "non-gratuitously", when you're pimping a site that's Flash, top-to-bottom, and doesn't use the platform for a single thing that standard HTML and CSS can't do.

  4. Second Step by AKAImBatman · · Score: 5, Informative

    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 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. :-)
  5. Re:My Post by LighterShadeOfBlack · · Score: 5, Funny

    First of all... you got second post. Second of all, TFA is about Javascript, not Java.

    Other than that your post was completely relevant.

    --
    Spelling mistakes, grammatical errors, and stupid comments are intentional.
  6. Flash is just Adobe Javascript by Anonymous Coward · · Score: 4, Informative

    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.

    1. Re:Flash is just Adobe Javascript by truthsearch · · Score: 1

      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. A language and it's implementation are two different things. Just because a language has a feature doesn't mean an engine is written well to use it.
    2. Re:Flash is just Adobe Javascript by IdeaMan · · Score: 1

      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. Sorry with NoScript on HTML and CSS are the only tools for the job.
      --
      They ARE out to get you simply because They are in it for themselves and they don't care about you.
    3. Re:Flash is just Adobe Javascript by Anonymous Coward · · Score: 0

      JavaScript == ECMAScript

      JScript & ActionScript = ECMAScript Dialect

    4. Re:Flash is just Adobe Javascript by naz404 · · Score: 1

      You have sound and frame-based animation. I don't think Javascript will replae that.

      Good luck having non-programmer designers trying to do what they can do in Flash in Javascript.

  7. Not going to happen by stonecypher · · Score: 3, Insightful

    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.

    --
    StoneCypher is Full of BS
    1. Re:Not going to happen by ozamosi · · Score: 4, Insightful

      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

      In case the sarcasm wasn't obvious enough: that's one of the most important things that Javascript libraries solve

    2. Re:Not going to happen by MightyYar · · Score: 2, Informative

      Javascript is far too fragmented to be a competitor to flash. The author's most famous project, jQuery, addresses this weakness, though. It is a smallish framework that does a very good job abstracting you from the browser-to-browser differences in Javascript.

      I haven't played with this new toy of his, but it stands to reason that he'll take the same care with it that he did with jQuery.

      In other words, Javascript may be too fragmented, but this Processing language is not... and you write your code in Processing, not Javascript.
      --
      W..w..W - Willy Waterloo washes Warren Wiggins who is washing Waldo Woo.
    3. Re:Not going to happen by Arslan+ibn+Da'ud · · Score: 2, Funny
      In case the sarcasm wasn't obvious enough: that's one of the most important things that Javascript libraries solve


      Wow! A library that helps people detect sarcasm...that IS a killer feature!!!

      --

      Practice Kind Randomness and Beautiful Acts of Nonsense.

    4. Re:Not going to happen by Anonymous Coward · · Score: 0

      rigorously portable Oh is it now? So why am I here with my 64-bit browser and no flash?
      Don't talk about 32-bit browsers in a 64-bit OS.
      Talk about no 64-bit flash.

    5. Re:Not going to happen by chromatic · · Score: 1

      The primary strength of Flash is its single vendor, rigorously portable....

      That has to be sarcasm, right? Satire? Sardonicism?

    6. Re:Not going to happen by Anonymous Coward · · Score: 0

      Are you being sarcastic?

    7. Re:Not going to happen by stonecypher · · Score: 1

      That has to be sarcasm, right?
      No. That's why I can play the same Flash games on my Windows and Linux boxes, the Mac test box at work, my Wii, one of my cell phones and soon the iPhone. For rich media, Flash is significantly more reliably portable than basically anything other than Java, and Java's lead is steadily waning.

      Satire?
      And what would you suggest I'm lampooning? Or didn't you know that satire was the imitation of an extant work with changes injected for the purpose of exposition and mockery? (Mad Magazine, for the mouth breathers in the audience.)

      Sardonicism?
      Are you just picking big words that start with S and whose dictionary definitions use the word "mock"? No, I am not making a joke for the purpose of pointing out that I am skeptical of someone else's claim. Obviously.

      Please use words you know. This kind of thing is just embarrassing.
      --
      StoneCypher is Full of BS
    8. Re:Not going to happen by stonecypher · · Score: 1

      rigorously portable
      Oh is it now? So why am I here with my 64-bit browser and no flash?
      Oh, I'm sorry, have you confused target portability with platform prevalence? Java doesn't run on Palm Pilots; does that mean Java applications aren't portable?

      Just because the platform doesn't appear on every platform doesn't mean that the platforms it does appear on are in any way bifurcated.
      --
      StoneCypher is Full of BS
    9. Re:Not going to happen by AKAImBatman · · Score: 1

      Java doesn't run on Palm Pilots

      Yes it does. (And that's only one of many implementations.)
    10. Re:Not going to happen by chromatic · · Score: 1

      Please use words you know.

      I know what "rigorous" and "portable" mean. Check Adobe Flash Player system requirements yourself; all you need for Linux is a "modern processor" of 800 MHz or faster. Somehow that doesn't include my 1 GHz PPC processor and my 2.16 GHz 64-bit Core 2 Duo.

      This kind of thing is just embarrassing.

      I can agree with that.

    11. Re:Not going to happen by stonecypher · · Score: 1

      I know what "rigorous" and "portable" mean.
      From your prior reply, it's actually quite obvious that you don't know what portable means, since you confused it with prevalence. Portability is not a question of being available on your platform of choice. Portability is a question of things working wherever it is available. If mono was 100%, then .NET would be rigorously portable, even though there were only two implementations out there for two platforms. Portability is not impeded by that people have not chosen to move to your target of choice. Indeed, if you'd bother to read Adobe's tech notes, the entire reason that Flash isn't currently available on Linux64 is because there are unresolved portability bugs.

      Check Adobe Flash Player system requirements yourself; all you need for Linux is a "modern processor" of 800 MHz or faster. Somehow that doesn't include my 1 GHz PPC processor and my 2.16 GHz 64-bit Core 2 Duo.
      The problem isn't your hardware. The problem is that they don't yet support your browser of choice. If you ran a 32 bit browser and changed literally nothing else, it would run just fine. This is a straw man, and frankly a pathetic one at that.
      --
      StoneCypher is Full of BS
    12. Re:Not going to happen by stonecypher · · Score: 1

      Eep. Ok, well, ... psions? I dunno, I hate java. I'm sure there's an example that fits. Nintendo Game and Watch: Donkey Kong, maybe. Or Windows Vista, that doesn't run much, maybe that'll do.

      --
      StoneCypher is Full of BS
    13. Re:Not going to happen by chromatic · · Score: 1

      Portability is not a question of being available on your platform of choice. Portability is a question of things working wherever it is available.

      That's a very unique definition of portability, one which suggests that that Active X components, for example, are portable because they work on every platform where Active X is available.

      The problem isn't your hardware. The problem is that they don't yet support your browser of choice. If you ran a 32 bit browser and changed literally nothing else, it would run just fine.

      Adobe Flash doesn't run on my PPC/Linux box because Adobe doesn't support my browser of choice? If I ran a 32-bit browser on my PPC/Linux box and changed "literally nothing else" (including the processor), Adobe Flash would run just fine?

      I find that somewhat difficult to believe.

    14. Re:Not going to happen by stonecypher · · Score: 1

      That's a very unique definition of portability, one which suggests that that Active X components, for example, are portable because they work on every platform where Active X is available.
      Well, if that were correct, then indeed they would be. However, ActiveX is plagued with portability problems through various versions of ActiveX as the various early faulty loading mechanisms were shut off, one by one, as they were discovered to be irreconcilably insecure.

      It's not actually a unique definition; it's taken from Knuth. I'd suggest reading a book, if I thought you knew how.

      Adobe Flash doesn't run on my PPC/Linux box because Adobe doesn't support my browser of choice? If I ran a 32-bit browser on my PPC/Linux box and changed "literally nothing else" (including the processor), Adobe Flash would run just fine? // I find that somewhat difficult to believe.
      I wish it was a surprise to find out how fundamentally ignorant you are of the thing you're complaining about. Maybe you didn't realize this, but Flash doesn't run in any 64-bit browser on any operating system. This includes IE, Mozilla, Opera, Safari and Konqueror, running on Windows, Macs or Linux. The problem has absolutely nothing to do with your computer or your operating system.

      Here's a technote from Adobe that even a chimpanzee could read. Next time you get up on a soapbox and find yourself saying things like "I find that somewhat difficult to believe", please know what the fuck you're talking about. Ignorance may be bliss for you, but it sure as hell isn't for the people you talk down to cluelessly.

      By the way, ten seconds of google turned up half a dozen ways of getting it running on Linux in a 64-bit browser without problems. Try doing some research next time.

      Know that if you respond, it's only to soothe your own ego; I'm not going to read it. You've disgusted me too thoroughly to give a shit what you say in the future. I've been on Slashdot for over a decade, and despite that I post in several hundred conversations a month, I only foe people at an rate of 1.4 foes per year. Consider yourself added to the shortbus shortlist. Your failure is complete.

      A better person than you would be ashamed to see what company they've just fallen into. I suspect you're stupid and arrogant enough to be proud of hitting that list.
      --
      StoneCypher is Full of BS
    15. Re:Not going to happen by stonecypher · · Score: 1

      several hundred conversations a month
      That was meant to say "per year".

      I also meant to post this quote from the Adobe article, just to drive home how much your research skills fail to impress (remember, this is straight from adobe.com, so spend some time sucking dick quietly in a dark corner before finding it "hard to believe") :

      Adobe Flash Player is not supported for playback in a 64-bit browser. However, you can run Flash Player in a 32-bit browser running on a 64-bit operating system.


      This has been well known and thoroughly documented for years. If ignorance were fuel, you would be Kuwait.
      --
      StoneCypher is Full of BS
    16. Re:Not going to happen by chromatic · · Score: 1

      Try doing some research next time.

      If there really is a Flash plugin for PPC/Linux, please deign to enlighten me. I'll happily admit that your research skills are much better than mine, as even Adobe seems to be unaware that such a plugin exists.

  8. Re:My Post by youthoftoday · · Score: 1

    Not true. It wasn't the first post either. Apart from those points, entirely relevant.

    --
    -1 not first post
  9. Rival?! by LSD-OBS · · Score: 1

    Javascript being a rival to Flash for online graphics content

    The article submitter has clearly never actually used the HTML canvas object. There's no way in HELL canvas & javascript together could ever approach the render and execution performance of Flash.

    It is very handy to have though, apart, of course, from having to perform kludgery to get it working roughly in IE (by using excanvas.js to emulate the canvas object in VML).

    --
    Today's weirdness is tomorrow's reason why. -- Hunter S. Thompson
    1. Re:Rival?! by AKAImBatman · · Score: 4, 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!
    2. Re:Rival?! by Manfre · · Score: 2, Informative

      The article submitter has clearly never actually used the HTML canvas object. There's no way in HELL canvas & javascript together could ever approach the render and execution performance of Flash.

      I have used the HTML canvas object. It's not on par with Flash 9, which is why I wrote "a first step towards Javascript being a rival to Flash". I styled that to help you with reading comprehension. Processing.js is an enabler that will lower the bar for many developers and give it the attention needed to improve the weaknesses that exist.
    3. Re:Rival?! by HeroreV · · Score: 1

      There's no way in HELL canvas & javascript together could ever approach the render and execution performance of Flash. You're not very imaginative. Once JavaScript has the same JIT as ActionScript, the language will be just as fast. And once Canvas has a hardware accelerated 3D API, it'll be much faster than Flash. 3D content in Flash is extremely slow and takes up a lot of storage space, because it has to be converted to 2D content beforehand.
    4. Re:Rival?! by SanityInAnarchy · · Score: 1

      That, and maybe I haven't looked too carefully at it, but I suspect Canvas is not necessarily a software renderer. At least, I suspect it's possible to build a compatible renderer which is hardware accelerated.

      The difference is, of course, that Flash will be hardware accelerated when Adobe damn well pleases, and there's nothing we can do about that.

      --
      Don't thank God, thank a doctor!
    5. Re:Rival?! by clowds · · Score: 1

      I've had a bit of a foray into some mindless canvas programming Some Free Canvas Games

      And i've had a fair bit of exposure to flash and I can say that while you can get some simple animations and image based animations running quite smoothly on any new browsers canvas, on IE or for any highly graphical sequences, your CPU maxes out and it runs like a dog.

      Hopefully the new release of beta browsers can do something nice to fix the performance issues.

    6. Re:Rival?! by AKAImBatman · · Score: 1

      I suspect Canvas is not necessarily a software renderer.
      Correct. There's nothing that prevents it from being hardware accelerated. In fact, there was some work done for Firefox 3 (which has sadly been abandoned) to create an OpenGL ES rendering context. I considered making mention of the hardware acceleration possibility, but it really would have distracted from my point. Since all current Canvas implementations are software, it's pretty safe to say Canvas == Software and Flash == Software. :-)
    7. Re:Rival?! by LSD-OBS · · Score: 1

      I can't agree with you. The canvas object, as currently designed, is absolutely no match for Flash.

      I've been writing software 3D engines for longer than I care to remember (since the early 90s at least). Just because engines A and B are "software" renderers does NOT make them equal.

      Using canvas, I can barely match the graphics capabilities I used to have on a good software engine on a 486. Believe me, I've tried.

      Flash, on the other hand, appears much more adept at actual animation, and is far less limiting.

      --
      Today's weirdness is tomorrow's reason why. -- Hunter S. Thompson
    8. Re:Rival?! by LSD-OBS · · Score: 1

      Don't take that as me knocking Processing.js - I think it's a laudable effort. I'm only saying that I can't understand how anybody could currently consider the canvas element an actual Flash rival. That's just silly.

      --
      Today's weirdness is tomorrow's reason why. -- Hunter S. Thompson
    9. Re:Rival?! by LSD-OBS · · Score: 1

      So what, we wait until canvas v5.0? Since that's obviously not how things work in web standards terms, sorting out JIT on Javascript and 3D acceleration is simply polishing a turd.

      Canvas requires a new incarnation in order to be "imaginative".

      --
      Today's weirdness is tomorrow's reason why. -- Hunter S. Thompson
    10. Re:Rival?! by HeroreV · · Score: 1

      Maybe you just have a different definition of "ever".

  10. Eric by erickhill · · Score: 5, Insightful

    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.

  11. Re:My Post by Thuktun · · Score: 1, Funny

    First of all... you got second post. Not true. It wasn't the first post either. Er, yeah.
  12. Re:My Post by maxume · · Score: 2, Funny

    Well muddled.

    --
    Nerd rage is the funniest rage.
  13. Re:My Post by Anonymous Coward · · Score: 3, Informative

    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. Java is a full blown object oriented programming language which runs on the Java Virtual Machine. Sine the JVM handles interfacing with the operating system Java itself is mostly platform independent.

  14. doesn't matter by Anonymous Coward · · Score: 0

    Even using bitmaps instead of vectors, the hardcoded C++ software rendering is the limiting factor above ECMA scripting performance. Theoretically, then, JS/Canvas could approximate the speed of Flash ... other than the fact that Flash has years of optimization on their side.

    What really matters, however, is that this *IS* slow, and that it doesn't run *AT ALL* on 50+% browsers.

  15. Re:My Post by truthsearch · · Score: 5, Funny

    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.

  16. Other than that, Mrs. Lincoln, how was the play? by Em+Ellel · · Score: 4, Insightful

    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
    --
    RelevantElephants: A Somatic WebComic...
  17. Re:My Post by fuzzy12345 · · Score: 5, Insightful

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

    Everybody's a libertarian 'till their neighbour's becomes a crack house.
  18. Re:Other than that, Mrs. Lincoln, how was the play by thestudio_bob · · Score: 1

    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.

    You mean like say, FireFox AND Webkit?

    --
    The real Sig captains the Northwestern. This one captains /.
  19. Neat, but not necessarily useful by togofspookware · · Score: 1

    It looks to me like the big accomplishment here is that he parses processing language code and API calls and converts it to JavaScript that uses a canvas. It's pretty cool that it's possible to do that (similar to the Java -> JavaScript converter or the Ruby VM in JavaScript mentioned a few days ago), but the end product doesn't seem that useful to me, as the processing language isn't significantly better than JavaScript for this kind of thing, anyway. I'd be more interested if this guy had found a way to make processing perform better (translated to JS or otherwise), or if he came up with an entirely new language that made certain graphics really simple to express (certain fractal generators come to mind). Though it feels likely that proofs-of-concept such as this will inspire something really great in the near future.

    --
    Duct tape, XML, democracy: Not doing the job? Use more.
  20. Re:My Post by compro01 · · Score: 4, Interesting

    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.

    --
    upon the advice of my lawyer, i have no sig at this time
  21. Re:My Post by ardor · · Score: 2, Informative

    Except that Javascript is much more powerful than Java can ever hope to be. It's the environment thats crappy, not the language.

    Seriously, you should at least *understand* the languages before you talk nonsense.

    --
    This sig does not contain any SCO code.
  22. JS a rival to flash? by museumpeace · · Score: 1

    has the writer of that claim read chapters 8 and 9 from Flanagan's Javascript 5th ed.? It is a hopelessly messy language that is congenitally unable to do a decent job of OO implementations. Flex has classes in a more normal sense of the word. Sounds like hype. Does the newly offered code somehow bury the variable scoping sloppiness of JS?

    --
    SLASHDOT: news for people who can't concentrate on work or have no life at all and got tired of yelling back at the TV.
  23. Re:My Post by Uncle+Focker · · Score: 1, Insightful

    Java is a crappy low-level language Java's a low level language? That's news to me.

    the COBOL of the millenium." So you mean it's highly ubiquitous language with 100s of billions of lines of code written in it that spreads over innumerable applications?
  24. example from TFA and why we're in the OO stoneage by Anonymous Coward · · Score: 0

    The author goes to describe a 'Spin' class. Then he defines a SpinArm that extends (concrete inheritance ) the Spin class. So we really have an 'Arm' that 'is-a' Spin. Oh really?

    Then the SpinArm class contains its own function to display itself. Oh really?

    This shows that the guy is clueless about what OO is all about.

    This kind of stuff, that makes it frontpage on /., it's part of the reason we're still in the OO stone-age.

    OO analysis? Anyone?

    Now of course I'm not surprised about the lack of good OO practice from anyone spewing random JavaScript or Java here and there: I'm not saying good OO is not possible in these languages, simply that 99.9% of the projects out there written in Java or JavaScript (or C#) are written by people that have no idea what OO is about.

    If you're interested in good OO practices in Java, check out the Spring framework (used, amongst other, by Voca to process daily 100 millions of bank-to-bank transactions). Guys behind such frameworks know wtf they're doing.

    The dude from TFA doesn't have the singlest clue about OOP, let alone OOD or OOA (he probably never heard these terms).

    I'm pissed off by such article containing phrase such as: "this is an example of inheritance".

    "This is an example of incompetence", that's all it is.

  25. Re:My Post by Free+the+Cowards · · Score: 3, Insightful

    So you mean it's highly ubiquitous language with 100s of billions of lines of code written in it that spreads over innumerable applications? Pretty much. Both Java and COBOL blow great big donkey chunks, but they're both used all over the place. They both have this great property of making it difficult to shoot yourself in the foot, which makes it practical to unleash hordes of medium/low quality programmers on a code base and actually come up with something that kinda sorta works.
    --
    If you mod me Overrated, you are admitting that you have no penis.
  26. Riddle me this... by argent · · Score: 1

    Why is the distinction between objects that you can inherit from (classes) and ones you can't (instances) so important?

    1. Re:Riddle me this... by museumpeace · · Score: 1

      I didn't mean to say that was the problem. Its the loosey goosey inheritance mechanism, looks like an aferthought, not sure how you avoid circular dependencies...and the dozen hoops to jump through if you what to imitate the innate data hiding of a real OO language. You have to work to make namespaces and vars are basically global unless they start colliding. The way a function namespace comes from the context of its definition rather than invocation yet NEW requires a function to be supplied as the constructor. Plus getting the equivalent of a static storage class requires putting on asbestos mittens and using the .Prototype feature...its a kluge if you ask me. Those are problems I seen in js and presume lurk in anything layered over js. But I shot my big mouth off too soon. I write some js to embed small data bases completely client side and working inside hacked Blogger templates. no graphics, limited dynamic generation of forms, combo boxes and such and instantaneous performance [once the DB loads into an hidden div]...but it is the shits to debug. [ its also fun: the DB is human readable xml and I cobbled up a toy imitation of XPATH for the accesses I needed to do...did I mention that it flies?] My mistake: Flex leans on ECMA-script too. Just because I look over the shoulder of someone developing in Flex doesn't mean I know much about Flex:( If I insisted on doctrinaire OO AND browser ubiquitous support, I would have to wait until most browsers support js 2,...and I'd have to take up farming for a while to have food. I want my whole world in a thumbdrive, and I don't want to see if there is internet so i can load gears or whatever is next [when will python be as ubiquitous and invisible to users as js?]

      --
      SLASHDOT: news for people who can't concentrate on work or have no life at all and got tired of yelling back at the TV.
    2. Re:Riddle me this... by argent · · Score: 1

      Ah, yes, I was wondering about the "flex" bit, and I really do prefer a classless model, but I'll grant you that global-by-default is a bugger to deal with for any program more than a couple pages long. If all they did in JS2 was to fix that bit and left the classlessness intact I wouldn't be dreading JS2.

      In Javascript's defense, I don't think it was originally intended for programs more than a couple of pages long.

      Python will be ubiquitous after they redesign the syntax. Preferably towards a Smalltalk-like rather than a C-like model. C doesn't really have a good syntax for building an OO language on top of.

      Indentation for nesting creeps people out.

    3. Re:Riddle me this... by SanityInAnarchy · · Score: 1

      and the dozen hoops to jump through if you what to imitate the innate data hiding of a real OO language. It's actually pretty trivial to do that, though I would argue it's much better to simply specify, in your documentation, what your public API is.

      The way a function namespace comes from the context of its definition rather than invocation That's a feature. It means all functions are automatically closures, which makes for some very cool Lisp-like possibilities.

      Not going to disect your entire post -- whether it was your intent or not, one gigantic paragraph is annoying to read -- but here:

      A quick article

      Or, check out the YUI Theater, in particular things like "The JavaScript Programming Language" and "Advanced JavaScript".

      And I'll take Ruby over Python any day. (Unless I need performance. Then I'll write C.)
      --
      Don't thank God, thank a doctor!
  27. learning Processing by ystar · · Score: 1

    (sorry this is tangential to the topic)

    This summer my goal is to start working with Processing. I'm at home in C/C++/Lisp and I have a tiny bit of experience with openGL (probably safe to assume it's worthless though - I pretty much recycled other folks' shaders when I was working with it). Do any folks here have some advice, such as where they started when they began working with Processing? Thanks :)

    1. Re:learning Processing by stokes · · Score: 1

      The best resource for learning Processing is just taking apart the example code that comes with it.

      Processing is extremely easy if you have previous programming experience. It's really just Java with a simple IDE and some automatically-loaded libraries; when a Processing 'sketch' compiles, it's actually wrapping it in a Java class and building that.

    2. Re:learning Processing by ystar · · Score: 1

      Thanks! I'll start with that advice. I've looked through a little bit of the examples on the main site. I've been feeling too impatient and very curious as to how folks like flight404 are creating these great lighting and texture effects:

      http://www.vimeo.com/935317

      It seems things like that represent a couple years of experience (stuff like the magnetophysics of the ball) but I like to get my hands as dirty as possible, as quickly as possible.

    3. Re:learning Processing by BungaDunga · · Score: 1

      My goal is to learn C++; most of my experience is with Actionscript. I have a feeling it'll be a lot harder than learning Processing.

  28. Re:example from TFA and why we're in the OO stonea by togofspookware · · Score: 1

    I think the guy who did this deserves more credit than you give him, if only because re-implementing all the processing functions and parsing the language is a relatively large undertaking for anyone who doesn't have mountains of free time on their hands, and the fact that it works at all is good sign that this guy isn't completely incompetent.

    All that said, I agree that a 'SpinArm' extending a 'Spin' isn't the best example of inheritance. I also realize that seemingly small things like this can be very frustrating to read for people who are well-versed in the subject. But it was my understanding that he threw out that 'this is an example of inheritance' line just to show processing syntax (and assuming the reader already knows what inheritance is and that that's not a very good example of its use), and I'm guessing that most of his code is more sensible - if his entire project was written that sloppily it doesn't seem likely that he would have gotten as far with it as he did.

    --
    Duct tape, XML, democracy: Not doing the job? Use more.
  29. Re:My Post by bb5ch39t · · Score: 2, Informative

    Which was part of the design criteria for COBOL. It was so that "low level" (PFC) military "grunts" could write code that would work.

  30. Re:My Post by tkinnun0 · · Score: 2, Informative

    Java is a crappy low-level language Java's a low level language? That's news to me. Well, yeah, before Java 5 with its generics, autoboxing and the rest, that was pretty much the case. Much like C is a low-level language to produce assembler code, Java was (and mostly still is) a low-level language to produce JVM byte-code. If you take ever take a look at results of javap -c on a simple method you'll see what I mean.
  31. Re:My Post by Uncle+Focker · · Score: 1

    Much like C is a low-level language to produce assembler code, Java was (and mostly still is) a low-level language to produce JVM byte-code. I don't think that word means what you think it does.

    In computer science, a low-level programming language is a language that provides little or no abstraction from a computer's microprocessor. That clearly doesn't describe Java.
  32. SVG anyone? by DerPflanz · · Score: 1

    Wasn't SVG (with Javascript) supposed to be the Flash killer? We use it a lot in SCADA systems, and it works great.

    Just ported our system to Firefox' native SVG as Adobe's plugin reached its end-of-life.

    --
    -- The Internet is a too slow way of doing things, you'd never do without it.
    1. Re:SVG anyone? by Cthefuture · · Score: 1

      I agree. SVG is intended to do everything Flash does and more. Currently dynamic stuff is pretty slow but there have been some very good advancements lately in the Firefox SVG engine. The main problem is Microsoft has completely ignored SVG. Probably because of Flash being popular and proprietary (more money for all). Plus now they have Silverlight.

      You still have to contend with the awful Javascript language though. The engines are slow because the language is convoluted.

      SVG should be the future. It's the best choice out of all the options. The only change I would make is to ditch Javascript or at least allow the option of using another language (Lua would be my first choice, tiny and fast).

      --
      The ratio of people to cake is too big
    2. Re:SVG anyone? by SanityInAnarchy · · Score: 1

      You still have to contend with the awful Javascript language though. The engines are slow because the language is convoluted. Awful? Convoluted?

      It wouldn't be my first choice, but I don't think either of those really apply. There are a few weird syntax issues, but it's pretty much Lisp in C's clothing, and actually enjoyable to work with, once you really know it.

      And Tamarin will make it fast.
      --
      Don't thank God, thank a doctor!
    3. Re:SVG anyone? by Anonymous Coward · · Score: 0

      The world, unfortunately, has mostly ignored SVG.

      Everyone except Adobe and Opera. Yes, Mozilla finally has it, although not as complete as the old Adobe plugin, or Opera. Took them 7 years to get from draft spec to incomplete implementation.

      And that's why the world is still going "wow!" over slow javascript image manipulation.

    4. Re:SVG anyone? by Anonymous Coward · · Score: 0

      Compare Lua to Javascript. Lua is what Javascript should have been. Very simple straightforward syntax that provides basically the same functionality.

  33. Re:My Post by Mongoose+Disciple · · Score: 1

    Javascript is a full blown power-users' language

    It gets a bad rap because poor developers will use that power to write powerfully terrible code, and "smart" developers will typically use that power to write clever but unmaintainable code.

  34. Re:My Post by Anonymous Coward · · Score: 0

    I don't know where you learned to program, but you have a VERY warped view of programming languages. Javascript is not a power-users' language by any means. Furthermore comparing it to Lisp is an insult to Lisp, the programmers who use Lisp, and any machine that Lisp has ever been run on. Javascript sucks donkey.

  35. Re:My Post by tkinnun0 · · Score: 1

    In computer science, a low-level programming language is a language that provides little or no abstraction from a computer's microprocessor. That clearly doesn't describe Java. From a 100% Pure Java viewpoint, the JVM is the microprocessor. Within environments like Jazelle, that true even in practice.
  36. Re:My Post by dotancohen · · Score: 1

    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. I _have_ seen someone thrown out the window for coding in Java.
    --
    It is dangerous to be right when the government is wrong.
  37. Re:My Post by fredrik70 · · Score: 1

    You nowhere near describing a stackbased cpu with the java language, it's not low level, ok? if you ever done low lewel you know what I mean

    --
    if (!signature) { throw std::runtime_error("No sig!"); }
  38. Re:My Post by Anonymous Coward · · Score: 0

    As a COBOL programmer, your comparison offends me.

  39. Re:My Post by Spudley · · Score: 1

    "Lisp with syntax problems" ???

    Man, there's a whole raft of jokes just waiting to come out of that statement.

    But I'll refrain -- I don't want to offend anyone with a thpeech impedimenth.

    --
    (Spudley Strikes Again!)
  40. Re:Other than that, Mrs. Lincoln, how was the play by Em+Ellel · · Score: 1

    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.

    You mean like say, FireFox AND Webkit?

    No, if you have bothered to read TFA, only beta of firefox 3 is fully supported and nothing else. Webkit is a little more supported than anything mainstream, but latest nightly Webkit (not even a beta!!) can do image handling, but not pixel or text processing.

    -Em
    --
    RelevantElephants: A Somatic WebComic...
  41. Re:My Post by tkinnun0 · · Score: 2, Insightful

    You nowhere near describing a stackbased cpu with the java language, it's not low level, ok? Ummm, the Java byte-code is the embodiment of a stack based language, what with its operand stack and stack frames. You would have a point, if you had insisted on a register-based cpu...

    if you ever done low lewel you know what I mean I haven't written, but I have read enough assembler to see a disturbing amount of similarities: unconditional jumps, labels, bitwise arithmetic operations, reading and writing to registers (local variables). Sure, there is more freedom when it comes to declaring the operands for any instruction. Sure, the JVM checks the bounds of your array access. But compared to a modern CPU, I'd imagine that's peanuts.
  42. LISP and JavaScript by LuckyStarr · · Score: 1

    I don't know where you learned to program, but you have a VERY warped view of programming languages. Javascript is not a power-users' language by any means. Furthermore comparing it to Lisp is an insult to Lisp, the programmers who use Lisp, and any machine that Lisp has ever been run on. Javascript sucks donkey. Sorry sir, but you are quite wrong. Please see this page.

    Recursive, functional programming can indeed warp your mind if you are referring to that???
    --
    Meme of the day: I browse "Disable Sigs: Checked". So should you.
  43. Re:My Post by SanityInAnarchy · · Score: 2, Interesting

    That's funny.

    Maybe you should actually look up the very history of Javascript -- the programmer wanted an embedded LISP. Some PHB-type wanted it to look like C, so it would be more approachable. So he took his embedded LISP and gave it a C-like syntax.

    Or maybe you should've Googled about Lisp and Javascript. Here, go read.

    --
    Don't thank God, thank a doctor!
  44. even if its wonderful, its bad.. by museumpeace · · Score: 1

    "dreading js 2"

    quite so. The more lovable and perfect it is, the more disruptive it will be to a staggering volume of interactive bits that legions of coders have tucked into all the pages on the internets. We paid a VERY high price for "run everywhere".

    --
    SLASHDOT: news for people who can't concentrate on work or have no life at all and got tired of yelling back at the TV.
  45. Re:My Post by Uncle+Focker · · Score: 1

    So what? Java is still a highly abstracted language hence why it is not a low-level language by any definition other than some bizarre one you've created.

  46. Re:My Post by Free+the+Cowards · · Score: 1

    What bullshit. A good programmer's ability to produce good code is directly proportional to the language's ability to free him from tedium.

    --
    If you mod me Overrated, you are admitting that you have no penis.
  47. Re:My Post by Raenex · · Score: 1, Funny

    GOTO is the most powerful of them all.

  48. JS Animation by Also · · Score: 1

    If you're just looking for animation in javascript, some much more impressive examples are in the CAKE (Canvas Animation Kit Experiment).

    What makes Resig's work interesting to me is his port of the Processing lauguage, so the existing Processing examples can be run without Java. I haven't looked at the processing.js source, but I imagine it would run somewhat faster if you used his API directly, instead of parsing Processing code.

  49. we're still inside the âcanvasâ box by Anonymous Coward · · Score: 0

    I wish some of this (minus the vector stuff of course) could be ported to plain old DHTML+CSS. Flying pink 1995 unicorns FTW!

    captcha: canvas - oh well

  50. JavaScript != DOM by emblemparade · · Score: 1

    I think what's going on with some of the "discussions" in the comments is that some people are confusing JavaScript as an interpreted language with JavaScript manipulating the HTML DOM of a web page. These are very different things! Resig is not trying to suggest that DOM effects could replace Flash rendering! He is using JavaScript around Canvas, a component that renders just as well as Flash. The difference is that Resig's solution does not require the addition of an extra scripting language interpreter (Flash's) over the one already existent in all major browsers.

  51. New Language? Why? by Tablizer · · Score: 0

    It seems like he invented a new language instead of merely an API. If so, why? Let JavaScript be JavaScript so that you don't have to waste CPU to translate. If you want Java, then do it in Java for pete's sake. Language zealots can be annoying.

  52. Re:My Post by Hognoxious · · Score: 1

    I am sick and tired of people confusing Java and javascript.
    Could you point out where someone did so? Take note: merely mentioning java does not count.

    Now since the thread seems to be drifting into a flash vs javascript (ajax will be along later) flamewar, here's my 2 cents. When java started to get known, one of the touted uses was for rich and complex interfaces - the web page runs an applet that can have all nice shiny things on it - exactly what flash seems to be moving towards with flex and suchlike. I was busy doing other stuff at the time, anybody tell me how that happened?
    --
    Confucius say, "Find worm in apple - bad. Find half a worm - worse."
  53. VM not in use by many projects?! by nova_ostrich · · Score: 2, Informative

    The short version is that Flash 9 is not comparable right now because the VM is not in use by many projects.

    Are you serious? As a software engineer who works with Flash and Flex daily, I've worked exclusively with Flash Player 9 and ActionScript 3 for over two years. Almost anyone who calls him or herself a Flash developer will say the same. I might have let your argument slide a year ago, but with Flash Player 9 installed on well over 90% of web-connected computers, it's silly not to use AS3. Anyone still working with AS2 and Flash 8 is probably a designer building simple "experience sites" or advertisements who knows a little about coding or a developer who doesn't know any better (or is a masochist).

    --
    It's scary being a Flash and Flex developer on Slashdot. You guys are unnaturally rabid.
    1. Re:VM not in use by many projects?! by lazybeam · · Score: 1

      We've had to go back to Flash 8 for most of our projects because of the Flash player no being up to scratch. Too many of our clients (and their clients) have Flash 9.0.16 which is quite broken, even causing one of relatively simple video websites to crash the entire browser. Since they have "Flash 9" they don't understand when we tell them to upgrade Flash

      Using express install (setting minimum version 9.0.115) there are still problems - especially if they don't have admin rights on their machines. We even had one machine in the office that refused to express install the ActiveX control, and then to even install manually (Of course the FF plugin worked).

      --
      --
      no sig for you. come back one year.
    2. Re:VM not in use by many projects?! by nova_ostrich · · Score: 1

      Interesting. If you're still having problems with that machine, Adobe provides a Flash Player uninstaller that might work. Worse case scenario (and I've hit this one once, actually), you can delete the old ActiveX control manually from wherever its hiding in the c:\windows directory (I'm on a Mac these days, and I don't remember the exact location off the top of my head).

      --
      It's scary being a Flash and Flex developer on Slashdot. You guys are unnaturally rabid.
  54. Re:My Post by Anonymous Coward · · Score: 0

    Finding one might be hard these days, but COBOL coding jobs pay very nicely. When I was looking at graduate software engineering jobs, COBOL starting salaries were at least 25% higher than C#/Java.

  55. Canvas not up to the job by Anonymous Coward · · Score: 0

    When Canvas first came out for Safari I knocked up a quick 3d rendering engine to rotate cubes and that sort of stuff. It was incredibly slow. One cube, fine, but when I moved up to 20 or 30 the whole thing ground to a halt.

    As it stands, Canvas is not suitable for animations containing more than about 20 faces, not if you want more than about 10f/s

  56. Re:My Post by MillionthMonkey · · Score: 1

    In computer science, a low-level programming language is a language that provides little or no abstraction from a computer's microprocessor.
    That clearly doesn't describe Java.

    Sure it does- "little or no abstraction from your computer's microprocessor" is what doesn't describe Java. It compiles directly to bytecode for a goofy virtualized processor which is an abstraction around your actual CPU and its instruction set and register set. Bytecode is higher level than machine code because it leaves a lot of work to be done on the side like parsing class files, resolving constants, navigating inheritance trees, etc. Instructions that manipulate the stack or the virtual storage registers are trivially mapped to lower levels, but instructions like invokevirtual require native library routines for correct handling of Java objects in OO hierarchies. So there is a little abstraction. Although in theory a processor could be built to execute Java bytecode directly if there was a demand for such a thing in a market saturated with emulators.
  57. OT: What happened to kfg? by zobier · · Score: 1

    Whatever happened to kfg? Last discussion I had with him, he was preparing for a long sailing trip. Maybe he finally went on it.

    He was pretty cool and doesn't afraid of anything. I'm going to update my sig now.

    --
    Me lost me cookie at the disco.