最近老是被一些底层的东西困扰着,老大说可能的话自己要做个编译器。嘿嘿,这两小罗那边也在叫嚣着自己做个小编译器,嘿嘿。。再者是最近项目里用到了as的正则表达式,非常恶心,反正还是不能满足目前自己的需求,而听老大说as的正则是用perl那的一套,什么版本我也搞不清了,所以也想看看AVM2的底层代码,底层的东西还是很好玩的。。结果发现其早就开源了,找到了篇外国人写的文章,也就不翻译了,直接贴出全文,相信牛人应该都看过了,,直接上地址。。
http://www.adobe.com/devnet/logged_in/ehuang_tamarin.html
On November 7 at the Web 2.0 Conference in San Francisco, we announced that Adobe is contributing source code for the latest ActionScript Virtual Machine (AVM2) to the Mozilla Foundation. AVM2, the new scripting language engine for ActionScript 3.0 introduced with Flash Player 9, was designed to deliver the performance and features to support the needs of rich Internet application developers. The new open source project, known as Tamarin, will be hosted at mozilla.org and contributions will be managed by a governing body of developers from Adobe and Mozilla.
By partnering on the Tamarin open source project, Adobe and Mozilla hope to accelerate the adoption of a standard language for creating rich and engaging web applications. The Tamarin virtual machine will be implementing the final version of the ECMAScript Edition 4 (ES4) language specification. ECMAScript is a standards-based programming language widely used on the web—although you are more likely to be familiar with references to Adobe ActionScript, JavaScript, and Microsoft JScript than the name of the foundational standard these languages are based on. Adobe and Mozilla have been working together alongside other companies—such as Yahoo!, Apple, Microsoft, and Opera—on developing the ES4 language proposal as part of the Ecma International Programming Language technical committee (TC39-TG1).
"There is nothing better for a standard than to have it implemented in multiple products," said Secretary General Jan van den Beld of Ecma International. "Adobe is taking a huge step forward in driving standards-based web development by open source licensing their virtual machine technology."
As a web developer, you may be wondering: "What does this mean to me?" For starters, in addition to driving the Adobe ActionScript Virtual Machine in Flash Player, Tamarin will be used in the next generation of SpiderMonkey, the core JavaScript engine in Firefox, and other products based on Mozilla technology. Future versions of Firefox will benefit from a new, high-performance virtual machine for running JavaScript—and applications built with JavaScript will perform faster and more efficiently than ever before. And because it is now available to anyone who wishes to use it, the code behind the lightweight, high-performance ActionScript Virtual Machine and Just-In-Time (JIT) compiler can be used to drive other applications and projects.
"Maybe someone will build a server that relies on the Tamarin virtual machine. Maybe someone will create a client-side product that uses it. Who knows? If you have a project that needs a modern, robust virtual machine, you can use ours," said Sho Kuwamoto, senior director on the Flex Builder engineering team.
The Tamarin project brings a new level of portability to your existing skill set by extending it to other arenas as the use of the virtual machine expands. In the near term, if you have been investing time into learning ActionScript 3.0, you've got a head start to being on the leading edge of the next generation of JavaScript. By unifying the language across browsers and platforms, we also hope to open the Flex and Flash doors to a wider audience of web developers.
"Developers who know JavaScript will be familiar with the language and syntax of ActionScript," said Mike Chambers, senior product manager for Apollo Developer Relations. "It's going to make it easier for new people to move into Flash and Flex development, and help to expand the Flash ecosystem. Now there isn't a mental barrier that ActionScript is something different, and the learning curve is going to be smaller."
In addition to making your skill set more valuable, standardization around a common language means your work becomes more portable, too. While there are unique extensions, DOMs, and supporting libraries that differ between the browser and Flash Player, you will be able to develop and reuse libraries and algorithms across both the browser and Flash Player. Greater opportunity and more free time—the hardest part will be figuring out which exciting new application you should start building first.
We are truly looking forward to contributing to and participating in the open source community through the Tamarin project. This project will improve our ability to maintain a standards-compliant implementation of the ECMAScript 4 specification for ActionScript in future versions of Flash Player, and the virtual machine will benefit from having more smart people looking at and contributing to the code.
"Ideally, this will lead to a more secure, more robust, and a better performing engine for ActionScript and JavaScript," said Adobe engineering director and Tamarin module owner Dan Smith. "And, over time, as the virtual machine proliferates into other Mozilla projects, as well as in technologies outside of Mozilla, end users should have a better experience, including better performance and improved security on the client side."
Flash Player isn't the only Adobe product that will benefit from Tamarin. The SpiderMonkey engine is the JavaScript engine within several Adobe products, such as Adobe Acrobat, Adobe Reader, Macromedia Director, and Adobe Shockwave Player. So in a roundabout way, we're sending our technology outside in order to bring it back into our own products!
Ultimately, from web developers to individuals using the web, everyone will benefit from having the open source community contribute to the Tamarin code base.
You can learn more about the Tamarin project, read the Tamarin FAQ, and view the source code at the Tamarin project page at Mozilla.org. For more information about the Mozilla SpiderMonkey project, visit www.mozilla.org/js/spidermonkey.
To learn more about ActionScript 3.0, see the ActionScript 3.0 Overview and visit theActionScript Technology Center for more language resources.
Emmy Huang is the senior product manager for Adobe Flash Player. Her experience includes working in engineering and product management on a range of digital entertainment technologies at Sony Pictures Digital, Liberate Technologies, and Intel. She briefly flirted with the idea of switching to another industry while working towards her MBA at UCLA but decided that working in software was way more fun than selling bleach.