Why HTML/JavaScript/CSS are not compiled languages and will they ever be?

后端 未结 9 1306
死守一世寂寞
死守一世寂寞 2021-01-31 02:36

Why HTML/JavaScript/CSS are not becoming compiled languages (or maybe even merge into a single compiled language)? What if browsers were running \"Browser Virtual Machine\" and

相关标签:
9条回答
  • 2021-01-31 03:15

    Google V8, which is one of many new-generation javascript engines 'compiles' javascript into pseudocode, much like .NET 'compiles' c# on the fly. Nothing magical here. Expect more of it esp. as webapps get heavier and more demanding

    0 讨论(0)
  • 2021-01-31 03:20

    Since HTML and CSS aren't code they can't be compiled. Google Chrome's V8 engine does actually convert JS into byte code, expect other rendering engines to follow suit!

    http://code.google.com/apis/v8/design.html

    We recently reworked a php template system I've helped create to use minify to compress multiple JS and CSS into one file each, seeing our file sizes drop to about 20% of the origial combined sizes. Minify also does gzip and caching so it's really amazing for speeding up websites.

    http://code.google.com/p/minify/

    In short you can't compile non-code, which HTML and CSS are. JS can be compiled and is starting to be, but all depends on what browsers feel like doing.

    Browsers just need to be on the ball regarding supporting web standards. The more browsers do this, the less headache us web developers have. I was quite happy with YouTube's very public drop of support for IE6. We need more action like that for the web to move forward.

    0 讨论(0)
  • 2021-01-31 03:23

    HTML

    HTML is pretty much XML. DTD'd exist for various versions and developers can check against that at any time.

    CSS

    CSS is not a programming language, however I do agree that "compiled" CSS could work seeing as compilation would compress it. However with the support that CSS has and with the number of essential hacks any CSS needs to have, you'd never manage to compile it without errors.

    JS

    As others have mentioned, JS IS becoming a compiled language except the browser compiles it for you and not you yourself.

    0 讨论(0)
提交回复
热议问题