News for hackers. Stuff that matters.
Re:Processing ported to JavaScript by Raphael on Friday May 09, 2008 @02:16AM (#185280)
Long live the king of JavaScript.
Re:Processing ported to JavaScript by bootload on Friday May 09, 2008 @02:33AM (#185286)
"... Processing ported to JavaScript ..."

My project just got a lot more interesting. One of the things I was having trouble with is generating an image from data with severe constraints on modules & processing time. Processing.js fills the gap of PIL which I couldn't use. I'm finding more and more interesting JS modules. Take this one for instance ~ http://www.nihilogic.dk/labs/canvas2image/ Converts the canvas to a binary image.

Re:Processing ported to JavaScript by bootload on Friday May 09, 2008 @08:02AM (#185410)
"... Converts the canvas to a binary image ..."

Just realised that in fox3 right mouse click on the canvas allows you to save the image as a .png

Re:Processing ported to JavaScript by llimllib on Friday May 09, 2008 @11:00AM (#185518)
You can also save an image via the toDataUrl method of a canvas object: http://www.whatwg.org/specs/web-apps/current-work/#todataurl
Re:Processing ported to JavaScript by andreyf on Friday May 09, 2008 @11:37AM (#185554)
Re:Processing ported to JavaScript by llimllib on Friday May 09, 2008 @02:33PM (#185732)
add the textures and watch your browser slowwwww
Re:Processing ported to JavaScript by boucher on Saturday May 10, 2008 @09:17PM (#186615)
Not if you're using Safari!
Re:Processing ported to JavaScript by dhotson on Friday May 09, 2008 @01:22AM (#185250)
This is pretty sweet, I've been a big fan of Processing for ages.

Processing reminds me of what was great about languages like QBasic. You could draw graphics on the screen and animate them without needing to understand how to use complicated graphics libraries.

It doesn't necessarily need to be fast, it just needs to be easy and fast-enough!

Re:Processing ported to JavaScript by programnature on Friday May 09, 2008 @04:00AM (#185317)
Needless to say this is very cool.

Could someone explain the technical advantages of having it in javascript rather than as a java applet?

Obviously java applets are a pain, but at least right now they much more widely supported than the canvas element.

Re:Processing ported to JavaScript by jeresig on Friday May 09, 2008 @09:24AM (#185460)
In my testing the JavaScript version had a better "boot time" (it was able to begin showing results instantly) - and rendered better/faster for simple examples. However, the Java Applets simply scale better. They can handle pretty much anything you throw at them. If you're just tackling simple stuff (pretty much anything that I demoed on the site) then Processing/Canvas is probably the way to go.
Re:Processing ported to JavaScript by nex3 on Friday May 09, 2008 @04:37AM (#185336)
Are they? At least for my tech-oriented blog, the percentage of visitors using canvas-compatible browsers and the percentage with Java applets enabled is roughly the same. And the former is bound to get higher while the latter goes the other way. So for sites that have a high ratio of non-IE users that are concerned about subjecting those users to the various Java applet pains.
Re:Processing ported to JavaScript by f1lt3r on Saturday May 09, 2009 @04:03AM (#600830)
File size of a Processing.js compared to a Java app is generally smaller.

I did a quick test and got 22kb overhead with the JS version and 233kb overhead with the Java Applet, that's WITH the library included.

More details here:

http://processingjs.org/reference/articles/comparing-process...

Re:Processing ported to JavaScript by gibsonf1 on Friday May 09, 2008 @12:29AM (#185214)
Wow, I'd love to use this to generate dynamic graphs with text - but does it support text?
Re:Processing ported to JavaScript by llimllib on Friday May 09, 2008 @12:36AM (#185217)
Canvas itself does not support text; there are various hacks to, e.g., port PS fonts to canvas, but it's a really ugly scene. Other methods include overlaying HTML text via CSS and server-side image rendering fonts. It's all really ugly.
Re:Processing ported to JavaScript by jeresig on Friday May 09, 2008 @09:22AM (#185459)
Firefox 3 supports native text rendering. There's a couple demos that show this (although you're out in the cold in other browsers, for now at least).
Re:Processing ported to JavaScript by llimllib on Friday May 09, 2008 @10:56AM (#185515)
Yup it does, and it's been recently added to the spec (http://www.whatwg.org/specs/web-apps/current-work/#text). Unfortunately, the font rendering as currently in the spec won't return the path of the font, which is a feature that allows nodebox to do some really neat things (eg http://nodebox.net/code/index.php/LetterKnitter).
Re:Processing ported to JavaScript by gravity on Friday May 09, 2008 @10:02AM (#185476)
Is there any word on whether other browsers will be implementing this in the future? It's what's keeping me from using canvas today, and partially what's keeping me from writing a certain app I've been thinking about for a little while.
Re:Processing ported to JavaScript by andreyf on Friday May 09, 2008 @11:29AM (#185541)
partially what's keeping me from writing a certain app I've been thinking about for a little while

Have you played with SVG?

Re:Processing ported to JavaScript by llimllib on Friday May 09, 2008 @12:00PM (#185583)
In my experience it's painfully slow and advanced features are spottily supported on every implementation I've tried; is yours different?
Re:Processing ported to JavaScript by jsrn on Saturday May 10, 2008 @08:57PM (#186609)
I've tested some of my SVG demos with FF 3 and they run much faster than with FF 2 (I think that's due to Cairo being integrated into Firefox 3). Opera and Safari are very fast compared to FF 2, too.

As for feature completeness I agree with you. The Firefox SVG team is very small and not funded by the Mozilla corporation (at least that was the case last year when I talked to one of its members) - the SVG standard, on the other hand, is HUGE.

Re:Processing ported to JavaScript by andreyf on Saturday May 10, 2008 @02:24AM (#186215)
I'm using it for a simple web app, testing in FF2/FF3/Safari, seems to work fine... there are some annoying bugs in the implementation (the kind that have been open for years), and inconsistencies between Safari and FF, but nothing I couldn't work around so far.

What were your issues?

Re:Processing ported to JavaScript by gibsonf1 on Friday May 09, 2008 @06:41PM (#185992)
We started by using graphviz to generate svg, but then couldn't find any decent in-line svg viewers. Do you know of any non-java applet inline svg viewers?
Re:Processing ported to JavaScript by gravity on Friday May 09, 2008 @12:15PM (#185597)
Not yet, I've looked at it a bit but haven't looked in to browser compatability at all.
Re:Processing ported to JavaScript by f1lt3r on Saturday May 09, 2009 @04:00AM (#600828)
Processing.js now supports Ture Type Fonts: http://processingjs.org/source/ttf-pfonts/ttf-pfont-pjs.html
Re:Processing ported to JavaScript by f1lt3r on Saturday May 09, 2009 @04:00PM (#601346)
I mean TrueType fonts of course :P
Re:Processing ported to JavaScript by tectonic on Friday May 09, 2008 @02:43AM (#185292)
Wow, I'm very impressed. Looking forward to playing with this.
Re:Processing ported to JavaScript by justinbmeyer on Wednesday May 14, 2008 @07:59PM (#190121)
Why not make a JavaScript API instead of Processing?
Re:Processing ported to JavaScript by pkrumins on Friday May 09, 2008 @01:00AM (#185229)
A-M-A-Z-I-N-G