Domain: w3future.com
Stories and comments across the archive that link to w3future.com.
Comments · 11
-
Re:Python binding
I'm working on a project at the moment that's all Javascript on the client side and mod_python (with the very nice Publisher handler on the server. I have a simple Javascript wrapper around XMLHttpRequest for making asynchronous calls to the server (using CPS with Javascript closures as the "continuations") and I just pass all the info back in JSON format, so I can just eval() the returned text.
Surprisingly neat and (very) surprisingly flexible - you can also do stuff like pass back Javascript functions (from the server) along with the data you wish to process.
You can use the Python str() function for the most simple data conversions (eg. an array or a dictionary), but I prefer the pyjsonrpc package which has very nice little objToJson and jsonToObj functions. Better than just using Python's str() function, as it also strips out excess whitespace. I also modified it slightly to also properly convert Python booleans to Javascript booleans (it already handled null to None conversions).
It all works very nicely, a testament to the power of simplicity. The Javascript (client) side just makes requests in response to user actions (eg. button clicks) or other events, and the server responds to those requests with Javascript data (CPS is very well suited to this kind of programming).
Javascript really is a very cool programming language. I've implemented my own python.js library which adds a handful of Python-like functional programming facilities to Javascript (eg. map, filter, reduce) and dictionary/object methods like keys() and values(). It's got to the point now where I sometimes get confused as to whether I'm writing Javascript or Python, because they're so similar in all the ways that really matter.
This kind of web development is quite fun. I also have a nice advantage with the web application I'm working on, as it flat-out can't run on IE (it uses fixed-positioned divs quite extensively, along with a few other standard features that IE can't handle) and so I don't have to worry about compatibility with that fucking mess of a browser. Hooray.
:-) -
Re:Misconception
-
Re:So does this mean there will be no IE7?
IE doesn't support XHTML 2.0, nor does Mozilla or Opera. The page to which you refer uses Appendix C XHTML 1.0 as an example of the new XHTML 2.0 features and their XHTML 1.0 equivalents.
Since when is the following valid XHTML 1.0 code? This is taken from the page I referred to. It may be that the XHTML 2.0 page is based on the draft standard, but I don't think this is valid XHTML 1.0. And even if it were, it would mean that Moz isn't as good as IE at displaying XHTML 1, and Opera doesn't display this at all. So which rendering engine is out-dated now?[object data="http://w3future.com/weblog/images/mailedima
g es/20030529t2152n2.jpg" class="picture"]Dauwpop 2003![/object]> But take a look at 101 things that the Mozilla browser can do that IE cannot.
Most of th the points in this page has to do with UI. (if we're talking about UI, the first thing I'd like to say is that Moz's GUI toolkit is f*ing ugly). A lot of us don't care for tabbed browsing (personally I think alt-tabbing through browser windows is the way to go). Since you called IE's rendering engine out-dated, could you point out a page with a comprehensive list of IE's rendering faults? (I know IE has a few rendering quirks, but I'll not accept that it's somehow as bad as Navigator 4 -- which is the impression being bandied about by most people in this thread.
-
Re:So does this mean there will be no IE7?
> IE6 has really stagnated
Exactly how is this? I am not a web developer, but IIRC IE6 has pretty decent support for CSS1 and DOM level 1. Agree, IE hasn't kept up with bleeding edge stuff like CSS2 (and yes, transparent PNG support sucks), but that's hardly stagnation. Is there a link available somewhere (just so I could learn) that lists all the things IE6 does not do?
On the other hand, IE6 SP1 seems to render this XHTML 2.0 page slightly better then Phoenix 0.6 (Moz 1.4b) does. Opera 7.1 does not render it at all. For all its doodads (notes and all) isn't Opera 'stagnating' faster than IE?
As for UI tweaks, like tabs, gestures and popup blocking -- there are lots of IE "shells", like NetCaptor that add these to IE. Nothing stops someone from writing their own shell and giving it away.
Btw, I agree with you in principle -- with little competition in the marketplace, companies do have less incentive to add features. On the other hand, in practice, it is not clear that IE's competitors have produced a better product yet. Opera sucks memory, and even Firebird 0.6 (which I'm currently using because it's the best non-IE browser I've tried so far) has serious bugs with its History pane. I'd say basic features like those are way more important than chasing the latest standard-of-the-week from the W3C.
-
Re:When is HTTP 2.0 coming out?
An AC Writes:
> I figure XHTML 2 is going to require a big re-design of everything anyway, ...
XHTML 2 has been working in many browsers since August, 2002, even though it's still a draft. Part of the point of point of XHTML 2 is to cleanly re-seat HTML on top of the stack of stuff that browsers are supposed to implement already (CSS, XML, linking, etc.). -
Use XHTML 2.0 (draft) todayIf you're interested in XHTML and XML, take a look at XHTML 2.0.
XHTML moves the presentation out into CSS completely, and so can be presented by an XML+CSS rendering engine; what's left in XHTML 2.0 is the semantics.
It's possible to use most of XHTML 2.0 in today's modern browsers, though crafting the style sheets to make it work is a job for serious experts. Here is a sample weblog page converted to XHTML 2.0 and it should display properly in most modern browsers: http://w3future.com/weblog/gems/xhtml2.xml
The big missing pieces are XForms, which abstracts the form data model and operations out of XHTML into its own module, and XML Events, which does the same for events (though it is compatible with recent DOM events). There is aplugin for Internet Explorer that make XForms work seamlessly inside XHTML documents, so I suspect that if you are so inclined, in a month or two you can be targeting to the draft of XHTML 2.0 with support for most of its features, and get cross-browser standards-based support for the same kinds of features you're writing back-end ASP hacks and browser-specific JavaScript and ActiveX controls for today. (No, it won't work in IE 4.0 or Netscape 4.62, but neither will most of the hacks and ActiveX controls.)
Here is an article on XHTML 2.0: http://www.xml.com/pub/a/2002/08/07/deviant.html .
Here is an XMLHack article by Simon St. Laurent: http://www.xmlhack.com/read.php?item=1741 who writes
The new XHTML 2.0 introduces XForms integration, navigation lists, linking on every element, unordered section headings, and an expanded role for the object element.
-
XHTML2 web pages today
Proof of concept, anyway. This page doesn't work entirely in IE, because of IE's horrible <object> bugs. Works great in Mozilla, pretty good in Opera.
-
Working XHTML 2.0 examples
In case you were wondering how long it will take before browsers can handle XHTML 2.0.
Here are 2 techiniques to do this already in recent browsers:
CSS, works in Opera 6, Mozilla 1.0 and IE 6
XSL, works in Mozilla 1.0 and IE 6 -
Working XHTML 2.0 examples
In case you were wondering how long it will take before browsers can handle XHTML 2.0.
Here are 2 techiniques to do this already in recent browsers:
CSS, works in Opera 6, Mozilla 1.0 and IE 6
XSL, works in Mozilla 1.0 and IE 6 -
Re:I thought *I* had it bad enough...
You may want to check out the extension library we (Sjoerd Visscher and I) have created. You can find it over at http://w3future.com/weblog/
This library, called Beyond JS, provides functional programming features for JavaScript language. Since JavaScript is based on Self, you get the benefit of both these "obscure" languages
We have yet to document this library, or QAed it sufficiently, but we are giving the source for free. You can get both the lib and some sample code from here.
An example of what can be done with beyond.js. First an example of some Haskell code, which is a used to explain some of the benefits of Haskell:
qsort [] = []
qsort (x:xs) = qsort elts_lt_x ++ [x] ++ qsort elts_greq_x
where
elts_lt_x = [y | y <- xs, y < x]
elts_greq_x = [y | y <- xs, y >= x]
With beyond.js, this type of code can be done in javascript too. This is the code to add a qsort method to arrays:
_AP.qsort = Array.recurse(function(head, tail) {
var elts_greq = [];
var elts_lt = tail.filter(function(v) { return v return elts_lt.qsort().concat(head, elts_greq.qsort());
});
// this is how to use qsort:
alert([ 5, 3, 4, 2, 1 ].qsort());
Here is another sample:
function fac(n) {
return n.to(1).fold("*");
}
alert(fac(6));
Although both these samples use a version of the lib that is slightly newer than the one currently online, they do demonstrate its design and features.
We invite everyone to try it out. At the very least it should give new perspectives on what can be done with JavaScript.
-
Re:I thought *I* had it bad enough...
You may want to check out the extension library we (Sjoerd Visscher and I) have created. You can find it over at http://w3future.com/weblog/
This library, called Beyond JS, provides functional programming features for JavaScript language. Since JavaScript is based on Self, you get the benefit of both these "obscure" languages
We have yet to document this library, or QAed it sufficiently, but we are giving the source for free. You can get both the lib and some sample code from here.
An example of what can be done with beyond.js. First an example of some Haskell code, which is a used to explain some of the benefits of Haskell:
qsort [] = []
qsort (x:xs) = qsort elts_lt_x ++ [x] ++ qsort elts_greq_x
where
elts_lt_x = [y | y <- xs, y < x]
elts_greq_x = [y | y <- xs, y >= x]
With beyond.js, this type of code can be done in javascript too. This is the code to add a qsort method to arrays:
_AP.qsort = Array.recurse(function(head, tail) {
var elts_greq = [];
var elts_lt = tail.filter(function(v) { return v return elts_lt.qsort().concat(head, elts_greq.qsort());
});
// this is how to use qsort:
alert([ 5, 3, 4, 2, 1 ].qsort());
Here is another sample:
function fac(n) {
return n.to(1).fold("*");
}
alert(fac(6));
Although both these samples use a version of the lib that is slightly newer than the one currently online, they do demonstrate its design and features.
We invite everyone to try it out. At the very least it should give new perspectives on what can be done with JavaScript.