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."
First of all...All hail Java and it's multi-planform goodness. I say a Flash take over is just what is needed. Second of all....FIRST POST :)
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.
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,
Website Hosting
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.
Javascript + Nintendo DSi = DSiCade
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.
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
That site is a fucking abomination, not so much a polished turd as a turd with white mould all over it. Please remove the link at once.
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
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.
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.
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...
You mean like say, FireFox AND Webkit?
The real Sig captains the Northwestern. This one captains
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.
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.
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?
/., it's part of the reason we're still in the OO stone-age.
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
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.
Why is the distinction between objects that you can inherit from (classes) and ones you can't (instances) so important?
(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
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.
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.
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...
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.
"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.
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.
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
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.
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.
Table-ized A.I.
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.
You lose anyway.
College-Pages.com - Online Colleges, Degrees, and Programs
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
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.