by oso2k · 11y ago · 0 comments
[0] https://en.wikipedia.org/wiki/Web_SQL_Database
[1] https://en.wikipedia.org/wiki/Google_Native_Client
[2] https://en.wikipedia.org/wiki/Dart_(programming_language)
NaCl isn't portable (Mozilla is working on Web Assembly)
Dart excerpt taken from Dart FAQ; question: "Will the Dart VM get into Chrome?" response: "No. Dart is designed to compile to JavaScript to run across the modern web, and the dart2js compiler is a top priority for the team." [1]
[0] http://www.w3.org/TR/webdatabase/#web-sql
[1] https://www.dartlang.org/support/faq.html#q-will-the-dart-vm...
Before this, before Blink forked WebKit, Apple rejected naive DartVM pre-integration changes for the same reason:
https://lists.webkit.org/pipermail/webkit-dev/2011-December/...
Whining for the poor Google-Goliath, blaming little Mozilla-David, is rich. No comment on the Pocket deal or other recent Mozilla changes. On this tangent about Dart, I'm happy that Chrome people prevailed.
I'm not. We are sentenced for another 20+ yrs for lang with broken 'this' pointer
Yep. I recognise that this may not have been a winnable fight, but I absolutely judge the people who were on the other side.
WebSQL was a much better tech than IndexedDB. Was the dependence on Sqlite problematic? Sure. But Mozilla had the resources to make a pretty good try at fixing it; instead they refused to even implement it and gave us the relatively terrible IndexedDB instead. Which, in turn, Apple has refused to implement[1], and now here we are. Thanks Moz[2].
(I'm less concerned about NaCL and Dart, because it's less clear to me that these were obviously superior technologies that obviously needed cross-browser adaption. You're certainly right that the pattern is suggestive though.)
[1]: Yeah, I know, they claim to have implemented it. Anyone who's tried to use their implementation will recognise this claim as a subtle joke. On us.
[2]: Their blog post justifying themselves[3] has not aged well. I especially love the bit where they say IndexedDB is better than WebSQL because it has better "developer aesthetics", as if anyone is actually casually coding against IndexedDB without using some sort of wrapper or compatibility layer. Or as if anyone actually likes the IndexedDB syntax and API.
[3]: https://hacks.mozilla.org/2010/06/beyond-html5-database-apis...
I agree the situation sucks, but I'm not sure how to fix it even today.
First, keep in mind that lot of this decision was political; if Mozilla had lobbied for it a lot of fudging could have been done. Instead Mozilla made sure that a strict reading of the rules was used by which, yes, WebSQL clearly failed.
And no, Mozilla probably didn't have the resources to implement SQLite from scratch, but:
1. They could have worked with others. Apple, quite clearly, was much more invested in WebSQL than IndexedDB. Could they have contributed to a join effort? We'll never know.
2. In particular, the rule about needing two seperate implementations is good, but it could have been fudged here; a bigger problem was the lack of a spec beyond "whatever Sqlite does". Did Mozilla have the resources to clearly specify how a reference implementation should work, even if the only actual implementation remained Sqlite? Maybe. Would that have been enough? Arguably.
3. In the event, IndexedDB was not a real replacement for WebSQL; at most it was an important tool that could be used to build one, some day; a process that is still ongoing (eg, with PouchDB) and has no real end in site. Even if we lacked the resources to really bring WebSQL up to par and re-implement Sqlite from scratch, we apparently lack the resources to bring IndexedDB up to par too. If we're doomed to spend years struggling with broken implementations and poor browser support either way, what did we gain with IndexedDB?
Like I said, I don't know that there was a good solution to this. But I feel like Mozilla helped ensure we got a bad one.
The rule of having multiple implementations is an important one.
And it might have been possible - surely Google and Microsoft, who supported IndexedDB, had the resource to write an alternative implementation. I don't know the history enough to know why they didn't.
When there is just a single codebase, even if it is open source, it isn't a standard. Now, not everything needs to be a standard, but on the web standardization is a big part of why it is so successful.
One example of why a single codebase is bad: Imagine that SQLite version X is the implementation of WebSQL, which all browsers must use. SQLite development is of course continuing, fixing security issues and making it faster, etc. Will browsers just keep using SQLite past version X? What if the SQLite community takes SQLite in a direction that isn't optimal for web browsers? Perhaps web browsers will fork it. What if browsers end up not agreeing on the fork, and some use the original project, and others use the fork - or there are multiple forks?
All of that makes it very risky that compatibility issues will appear between browsers. Having a properly specced standard, with multiple compatible implementations, is so far the best way that we have found that can prevent such things.
It doesn't matter how developers choose to use IndexedDB, what does is for a Web standard to be sane and WebSQL never was. See https://news.ycombinator.com/item?id=9978713
"asm.js over NaCl (which v8 team as shown doesn't require a special compiler mode to optimize for)"
I don't see how not requiring a special compiler is an argument against it.
"ES5/ES5.1/ES6/ES7 language bloat over Your-Choice-Of-JS-Successor language or actually fixing the issues with JS"
ES5/ES5.1/ES6/ES7 ARE efforts to fix issues with JS and mostly driven by Mozilla.
A few days ago, when doing some client-side JS I wanted to use it and I saw that it is not part of a standard, not only that, it has actually been REJECTED. It's really sad to see the development of the language crippled for a reason that basically boils down to "No, because it was proposed by Microsoft".