CINXE.COM
Bad Ideas - WHATWG Wiki
<!DOCTYPE html> <html class="client-nojs" lang="en" dir="ltr"> <head> <meta charset="UTF-8"/> <title>Bad Ideas - WHATWG Wiki</title> <script>document.documentElement.className="client-js";RLCONF={"wgBreakFrames":false,"wgSeparatorTransformTable":["",""],"wgDigitTransformTable":["",""],"wgDefaultDateFormat":"dmy","wgMonthNames":["","January","February","March","April","May","June","July","August","September","October","November","December"],"wgRequestId":"77bc08fd0eb7c5ff594f3f4b","wgCSPNonce":false,"wgCanonicalNamespace":"","wgCanonicalSpecialPageName":false,"wgNamespaceNumber":0,"wgPageName":"Bad_Ideas","wgTitle":"Bad Ideas","wgCurRevisionId":8277,"wgRevisionId":8277,"wgArticleId":2498,"wgIsArticle":true,"wgIsRedirect":false,"wgAction":"view","wgUserName":null,"wgUserGroups":["*"],"wgCategories":[],"wgPageContentLanguage":"en","wgPageContentModel":"wikitext","wgRelevantPageName":"Bad_Ideas","wgRelevantArticleId":2498,"wgIsProbablyEditable":false,"wgRelevantPageIsProbablyEditable":false,"wgRestrictionEdit":[],"wgRestrictionMove":[],"wgVector2022PreviewPages":[]};RLSTATE={"ext.gadget.WatchlistChangesBold":"ready", "ext.gadget.widensearch":"ready","site.styles":"ready","user.styles":"ready","user":"ready","user.options":"loading","skins.vector.styles.legacy":"ready"};RLPAGEMODULES=["site","mediawiki.page.ready","skins.vector.legacy.js","ext.gadget.exlinks","ext.gadget.charinsert","ext.gadget.edittop","ext.gadget.PrettyLog"];</script> <script>(RLQ=window.RLQ||[]).push(function(){mw.loader.implement("user.options@12s5i",function($,jQuery,require,module){mw.user.tokens.set({"patrolToken":"+\\","watchToken":"+\\","csrfToken":"+\\"});});});</script> <link rel="stylesheet" href="/load.php?lang=en&modules=skins.vector.styles.legacy&only=styles&skin=vector"/> <script async="" src="/load.php?lang=en&modules=startup&only=scripts&raw=1&skin=vector"></script> <meta name="ResourceLoaderDynamicStyles" content=""/> <link rel="stylesheet" href="/load.php?lang=en&modules=ext.gadget.WatchlistChangesBold%2Cwidensearch&only=styles&skin=vector"/> <link rel="stylesheet" href="/load.php?lang=en&modules=site.styles&only=styles&skin=vector"/> <meta name="generator" content="MediaWiki 1.39.3"/> <meta name="format-detection" content="telephone=no"/> <meta name="viewport" content="width=1000"/> <link rel="apple-touch-icon" href="https://resources.whatwg.org/logo.png"/> <link rel="icon" href="https://resources.whatwg.org/logo.svg"/> <link rel="search" type="application/opensearchdescription+xml" href="/opensearch_desc.php" title="WHATWG Wiki (en)"/> <link rel="EditURI" type="application/rsd+xml" href="https://wiki.whatwg.org/api.php?action=rsd"/> <link rel="license" href="/wiki/WHATWG_Wiki:Copyrights"/> <link rel="alternate" type="application/atom+xml" title="WHATWG Wiki Atom feed" href="/index.php?title=Special:RecentChanges&feed=atom"/> </head> <body class="mediawiki ltr sitedir-ltr mw-hide-empty-elt ns-0 ns-subject page-Bad_Ideas rootpage-Bad_Ideas skin-vector action-view skin-vector-legacy vector-feature-language-in-header-enabled vector-feature-language-in-main-page-header-disabled vector-feature-language-alert-in-sidebar-disabled vector-feature-sticky-header-disabled vector-feature-sticky-header-edit-disabled vector-feature-table-of-contents-disabled vector-feature-visual-enhancement-next-disabled"><div id="mw-page-base" class="noprint"></div> <div id="mw-head-base" class="noprint"></div> <div id="content" class="mw-body" role="main"> <a id="top"></a> <div id="siteNotice"><div id="localNotice"><div class="anonnotice" lang="en" dir="ltr"><div id="anonNotice"> <div style="margin: 0.5em auto; border: 1px solid #333333; background-color: #EEEEEE; padding: 0.5em; font-size: larger; text-align: center;"> <p>A user account is required in order to edit this wiki, but we've had to disable public user registrations due to spam. </p><p>To request an account, ask an autoconfirmed user on <a rel="nofollow" class="external text" href="https://whatwg.org/chat">Chat</a> (such as one of <span class="plainlinks"><a rel="nofollow" class="external text" href="https://wiki.whatwg.org/index.php?title=Special:ListUsers&group=autoconfirmed">these permanent autoconfirmed members</a></span>). </p> </div> </div></div></div></div> <div class="mw-indicators"> </div> <h1 id="firstHeading" class="firstHeading mw-first-heading"><span class="mw-page-title-main">Bad Ideas</span></h1> <div id="bodyContent" class="vector-body"> <div id="siteSub" class="noprint">From WHATWG Wiki</div> <div id="contentSub"></div> <div id="contentSub2"></div> <div id="jump-to-nav"></div> <a class="mw-jump-link" href="#mw-head">Jump to navigation</a> <a class="mw-jump-link" href="#searchInput">Jump to search</a> <div id="mw-content-text" class="mw-body-content mw-content-ltr" lang="en" dir="ltr"><div class="mw-parser-output"><p>The purpose of this page is to collect explanations why commonly-proposed bad ideas for the Web are bad, so that they don't need to be explained over and over again. </p> <h2><span class="mw-headline" id="Turing-complete_CSS">Turing-complete CSS</span></h2> <p>This would introduce at least one of these problems: </p> <ul><li>Styling couldn't be applied incrementally if the styling program needs to run from start to finish with the entire document as its input. XSLT suffers from this problem.</li></ul> <ul><li>Content changes couldn't be efficiently reflected in layout by doing partial updates if the style system had to analyze a Turing-complete program to see if it affects the styling of a particular subtree.</li></ul> <ul><li>If the Turing-complete language allowed side effects, the style system couldn't decide when to re-resolve styles. Instead, style re-resolution times would have to be specified in the standard in order to get interoperable side effects.</li></ul> <ul><li>Even now, some oft-requested selectors aren't supported due to time-complexity issues. It would be hard to curb bad time-complexity if arbitrary programs were allowed to run as part of styling.</li></ul> <ul><li>The environment in which the Turing-complete language program with run would have to be specified and would constrain the implementation of the style system.</li></ul> <h2><span class="mw-headline" id="Standardized_byte_code_language">Standardized byte code language</span></h2> <ul><li>Java's byte code compat limited where the language could go. Needed a complex byte code verifier to make sure the low-level operations don't combine to something dangerous.</li></ul> <ul><li>JS is already supported, so compiling to JS enjoys better benefits from network effects that launching a new byte code.</li></ul> <ul><li>Using gzip compression on JS produces an already supported binary representation of JS.</li></ul> <ul><li>The language needs to be able to call some APIs in the environment. In the browser, those are DOM APIs which are single-threaded. In order to call those APIs, the new languages are limited by JS's concurrency model anyway. Otherwise, there's a need to reinvent the world on the API side as well. The JDK was a huge parallel system to the browser-native APIs. Pepper as available to NaCl reinvents a lot of APIs that have Web-native analogs.</li></ul> <ul><li>You can't standardize an existing JS VM byte code: SpiderMonkey and SquirrelFish both have byte code but they are of very different designs (stack-based vs. register-based) and neither is designed to be ingested from untrusted sources. V8 doesn't have a byte code.</li></ul> <ul><li>Adding a few features to JS that make it a better compilation target is a smaller step from the status quo than launching something completely new.</li></ul> <ul><li>A new byte code design wouldn't be unbiased towards a kind of language anyway. (See e.g. Java byte code and later additions to better support dynamic languages.) Might as well accept the biases of JS as the interchange format.</li></ul> <ul><li>There's a lot of JS out there, so browsers need to compete on JS performance anyway. Using JS as the interchange intermediate language helps leverage that work instead of involving parallel work for a parallel system.</li></ul> <ul><li>See <a rel="nofollow" class="external text" href="http://www.infoq.com/presentations/The-JavaScript-World-Domination-Plan-at-16-Years">this talk by Brendan Eich</a> from 22:30 onwards. (Should transcribe the points here in due course.)</li></ul> <h2><span class="mw-headline" id="Other">Other</span></h2> <p>These should probably be elaborated at some point if they keep coming up: </p> <ul><li>XML-style namespaces</li> <li>XML-based formats</li> <li>Merging the SVG and HTML namespace</li> <li>Fixing something bad by introducing a document-global switch</li></ul> <!-- NewPP limit report Cached time: 20250205070935 Cache expiry: 86400 Reduced expiry: false Complications: [] CPU time usage: 0.000 seconds Real time usage: 0.004 seconds Preprocessor visited node count: 9/1000000 Post鈥恊xpand include size: 0/2097152 bytes Template argument size: 0/2097152 bytes Highest expansion depth: 2/100 Expensive parser function count: 0/100 Unstrip recursion depth: 0/20 Unstrip post鈥恊xpand size: 0/5000000 bytes --> <!-- Transclusion expansion time report (%,ms,calls,template) 100.00% 0.000 1 -total --> <!-- Saved in parser cache with key mediawiki:pcache:idhash:2498-0!canonical and timestamp 20250205070935 and revision id 8277. --> </div> <div class="printfooter" data-nosnippet="">Retrieved from "<a dir="ltr" href="https://wiki.whatwg.org/index.php?title=Bad_Ideas&oldid=8277">https://wiki.whatwg.org/index.php?title=Bad_Ideas&oldid=8277</a>"</div></div> <div id="catlinks" class="catlinks catlinks-allhidden" data-mw="interface"></div> </div> </div> <div id="mw-navigation"> <h2>Navigation menu</h2> <div id="mw-head"> <nav id="p-personal" class="vector-menu mw-portlet mw-portlet-personal vector-user-menu-legacy" aria-labelledby="p-personal-label" role="navigation" > <h3 id="p-personal-label" class="vector-menu-heading " > <span class="vector-menu-heading-label">Personal tools</span> </h3> <div class="vector-menu-content"> <ul class="vector-menu-content-list"><li id="pt-login" class="mw-list-item"><a href="/index.php?title=Special:UserLogin&returnto=Bad+Ideas" title="You are encouraged to log in; however, it is not mandatory [o]" accesskey="o"><span>Log in</span></a></li></ul> </div> </nav> <div id="left-navigation"> <nav id="p-namespaces" class="vector-menu mw-portlet mw-portlet-namespaces vector-menu-tabs vector-menu-tabs-legacy" aria-labelledby="p-namespaces-label" role="navigation" > <h3 id="p-namespaces-label" class="vector-menu-heading " > <span class="vector-menu-heading-label">Namespaces</span> </h3> <div class="vector-menu-content"> <ul class="vector-menu-content-list"><li id="ca-nstab-main" class="selected mw-list-item"><a href="/wiki/Bad_Ideas" title="View the content page [c]" accesskey="c"><span>Page</span></a></li><li id="ca-talk" class="new mw-list-item"><a href="/index.php?title=Talk:Bad_Ideas&action=edit&redlink=1" rel="discussion" title="Discussion about the content page (page does not exist) [t]" accesskey="t"><span>Discussion</span></a></li></ul> </div> </nav> <nav id="p-variants" class="vector-menu mw-portlet mw-portlet-variants emptyPortlet vector-menu-dropdown" aria-labelledby="p-variants-label" role="navigation" > <input type="checkbox" id="p-variants-checkbox" role="button" aria-haspopup="true" data-event-name="ui.dropdown-p-variants" class="vector-menu-checkbox" aria-labelledby="p-variants-label" /> <label id="p-variants-label" aria-label="Change language variant" class="vector-menu-heading " > <span class="vector-menu-heading-label">English</span> </label> <div class="vector-menu-content"> <ul class="vector-menu-content-list"></ul> </div> </nav> </div> <div id="right-navigation"> <nav id="p-views" class="vector-menu mw-portlet mw-portlet-views vector-menu-tabs vector-menu-tabs-legacy" aria-labelledby="p-views-label" role="navigation" > <h3 id="p-views-label" class="vector-menu-heading " > <span class="vector-menu-heading-label">Views</span> </h3> <div class="vector-menu-content"> <ul class="vector-menu-content-list"><li id="ca-view" class="selected mw-list-item"><a href="/wiki/Bad_Ideas"><span>Read</span></a></li><li id="ca-viewsource" class="mw-list-item"><a href="/index.php?title=Bad_Ideas&action=edit" title="This page is protected. You can view its source [e]" accesskey="e"><span>View source</span></a></li><li id="ca-history" class="mw-list-item"><a href="/index.php?title=Bad_Ideas&action=history" title="Past revisions of this page [h]" accesskey="h"><span>View history</span></a></li></ul> </div> </nav> <nav id="p-cactions" class="vector-menu mw-portlet mw-portlet-cactions emptyPortlet vector-menu-dropdown" aria-labelledby="p-cactions-label" role="navigation" title="More options" > <input type="checkbox" id="p-cactions-checkbox" role="button" aria-haspopup="true" data-event-name="ui.dropdown-p-cactions" class="vector-menu-checkbox" aria-labelledby="p-cactions-label" /> <label id="p-cactions-label" class="vector-menu-heading " > <span class="vector-menu-heading-label">More</span> </label> <div class="vector-menu-content"> <ul class="vector-menu-content-list"></ul> </div> </nav> <div id="p-search" role="search" class="vector-search-box-vue vector-search-box-show-thumbnail vector-search-box-auto-expand-width vector-search-box"> <div> <h3 > <label for="searchInput">Search</label> </h3> <form action="/index.php" id="searchform" class="vector-search-box-form"> <div id="simpleSearch" class="vector-search-box-inner" data-search-loc="header-navigation"> <input class="vector-search-box-input" type="search" name="search" placeholder="Search WHATWG Wiki" aria-label="Search WHATWG Wiki" autocapitalize="sentences" title="Search WHATWG Wiki [f]" accesskey="f" id="searchInput" > <input type="hidden" name="title" value="Special:Search"> <input id="mw-searchButton" class="searchButton mw-fallbackSearchButton" type="submit" name="fulltext" title="Search the pages for this text" value="Search"> <input id="searchButton" class="searchButton" type="submit" name="go" title="Go to a page with this exact name if it exists" value="Go"> </div> </form> </div> </div> </div> </div> <div id="mw-panel"> <div id="p-logo" role="banner"> <a class="mw-wiki-logo" href="/" title="Visit the main page"></a> </div> <nav id="p-navigation" class="vector-menu mw-portlet mw-portlet-navigation vector-menu-portal portal" aria-labelledby="p-navigation-label" role="navigation" > <h3 id="p-navigation-label" class="vector-menu-heading " > <span class="vector-menu-heading-label">Navigation</span> </h3> <div class="vector-menu-content"> <ul class="vector-menu-content-list"><li id="n-mainpage" class="mw-list-item"><a href="/" title="Visit the main page [z]" accesskey="z"><span>Main Page</span></a></li><li id="n-randompage" class="mw-list-item"><a href="/wiki/Special:Random" title="Load a random page [x]" accesskey="x"><span>Random page</span></a></li><li id="n-recentchanges" class="mw-list-item"><a href="/wiki/Special:RecentChanges" title="A list of recent changes in the wiki [r]" accesskey="r"><span>Recent changes</span></a></li></ul> </div> </nav> <nav id="p-WHATWG" class="vector-menu mw-portlet mw-portlet-WHATWG vector-menu-portal portal" aria-labelledby="p-WHATWG-label" role="navigation" > <h3 id="p-WHATWG-label" class="vector-menu-heading " > <span class="vector-menu-heading-label">WHATWG</span> </h3> <div class="vector-menu-content"> <ul class="vector-menu-content-list"><li id="n-Standards" class="mw-list-item"><a href="https://spec.whatwg.org/" rel="nofollow"><span>Standards</span></a></li><li id="n-FAQ" class="mw-list-item"><a href="https://whatwg.org/faq" rel="nofollow"><span>FAQ</span></a></li><li id="n-Chat" class="mw-list-item"><a href="https://whatwg.org/chat" rel="nofollow"><span>Chat</span></a></li><li id="n-Code-of-Conduct" class="mw-list-item"><a href="https://whatwg.org/code-of-conduct" rel="nofollow"><span>Code of Conduct</span></a></li><li id="n-GitHub" class="mw-list-item"><a href="https://github.com/whatwg" rel="nofollow"><span>GitHub</span></a></li><li id="n-What-you-can-do" class="mw-list-item"><a href="/wiki/What_you_can_do"><span>What you can do</span></a></li><li id="n-To-do-list" class="mw-list-item"><a href="/wiki/Specs_todo"><span>To-do list</span></a></li></ul> </div> </nav> <nav id="p-Registries" class="vector-menu mw-portlet mw-portlet-Registries vector-menu-portal portal" aria-labelledby="p-Registries-label" role="navigation" > <h3 id="p-Registries-label" class="vector-menu-heading " > <span class="vector-menu-heading-label">Registries</span> </h3> <div class="vector-menu-content"> <ul class="vector-menu-content-list"><li id="n-<meta-name>" class="mw-list-item"><a href="/wiki/MetaExtensions"><span><meta name></span></a></li><li id="n-rel=""" class="mw-list-item"><a href="http://microformats.org/wiki/existing-rel-values" rel="nofollow"><span>rel=""</span></a></li></ul> </div> </nav> <nav id="p-tb" class="vector-menu mw-portlet mw-portlet-tb vector-menu-portal portal" aria-labelledby="p-tb-label" role="navigation" > <h3 id="p-tb-label" class="vector-menu-heading " > <span class="vector-menu-heading-label">Tools</span> </h3> <div class="vector-menu-content"> <ul class="vector-menu-content-list"><li id="t-whatlinkshere" class="mw-list-item"><a href="/wiki/Special:WhatLinksHere/Bad_Ideas" title="A list of all wiki pages that link here [j]" accesskey="j"><span>What links here</span></a></li><li id="t-recentchangeslinked" class="mw-list-item"><a href="/wiki/Special:RecentChangesLinked/Bad_Ideas" rel="nofollow" title="Recent changes in pages linked from this page [k]" accesskey="k"><span>Related changes</span></a></li><li id="t-specialpages" class="mw-list-item"><a href="/wiki/Special:SpecialPages" title="A list of all special pages [q]" accesskey="q"><span>Special pages</span></a></li><li id="t-print" class="mw-list-item"><a href="javascript:print();" rel="alternate" title="Printable version of this page [p]" accesskey="p"><span>Printable version</span></a></li><li id="t-permalink" class="mw-list-item"><a href="/index.php?title=Bad_Ideas&oldid=8277" title="Permanent link to this revision of this page"><span>Permanent link</span></a></li><li id="t-info" class="mw-list-item"><a href="/index.php?title=Bad_Ideas&action=info" title="More information about this page"><span>Page information</span></a></li></ul> </div> </nav> </div> </div> <footer id="footer" class="mw-footer" role="contentinfo" > <ul id="footer-info"> <li id="footer-info-lastmod"> This page was last edited on 5 June 2012, at 10:06.</li> <li id="footer-info-copyright">Content is available under <a href="/wiki/WHATWG_Wiki:Copyrights" title="WHATWG Wiki:Copyrights">a CC0 Universal Public Domain Declaration, with some restrictions</a> unless otherwise noted.</li> </ul> <ul id="footer-places"> <li id="footer-places-about"><a href="/wiki/WHATWG_Wiki:About">About WHATWG Wiki</a></li> </ul> <ul id="footer-icons" class="noprint"> <li id="footer-poweredbyico"><a href="https://www.mediawiki.org/"><img src="/resources/assets/poweredby_mediawiki_88x31.png" alt="Powered by MediaWiki" srcset="/resources/assets/poweredby_mediawiki_132x47.png 1.5x, /resources/assets/poweredby_mediawiki_176x62.png 2x" width="88" height="31" loading="lazy"/></a></li> </ul> </footer> <script>(RLQ=window.RLQ||[]).push(function(){mw.config.set({"wgPageParseReport":{"limitreport":{"cputime":"0.000","walltime":"0.004","ppvisitednodes":{"value":9,"limit":1000000},"postexpandincludesize":{"value":0,"limit":2097152},"templateargumentsize":{"value":0,"limit":2097152},"expansiondepth":{"value":2,"limit":100},"expensivefunctioncount":{"value":0,"limit":100},"unstrip-depth":{"value":0,"limit":20},"unstrip-size":{"value":0,"limit":5000000},"timingprofile":["100.00% 0.000 1 -total"]},"cachereport":{"timestamp":"20250205070935","ttl":86400,"transientcontent":false}}});mw.config.set({"wgBackendResponseTime":270});});</script> </body> <!-- Cached 20250205104542 --> </html>