Showing posts with label IT/Java. Show all posts
Showing posts with label IT/Java. Show all posts

Saturday, June 30, 2007

The Java Compiler API

Java Compiler API 主要提供了两方面的改进
1. Compilation as app-level service. Sun 希望的好处是,在一些特定的应用中,改善compiler的使用性(availability and/or consumability ?) 提供compiler的API之后,这个希望能够比较轻松的达成.用户可以在程序运行时通过API启动编译过程。和老的使用System.run的技巧比,用户对compiler可以有更细致的控制.API的提供,将编译任务分成了不同阶段,提供了回调函数,这些老的技巧很难实现.

2. Integration.分两方面.一方面,API的提供,便于编译器更好的发布自己的服务,走向了类似于SOA的方向.想象一个compilation service,有点意思.另一方面,编译器可以编译广义上的JAVA代码,比如直接编译存在数据库中的信息,之后直接将类文件放入内存.[1]

3. Meta-programming.在JDK6中,SUN包装了语法树和annotation。用户可以编程时对自己书写的代码本身进行操纵。不过目前基本上语法树是只读的,而且包装也暂时是SUN私有的,并没有放入API之中。看起来JAVA将变得能够更加动态一些。

4.Diagnostic information.这些信息也可以通过JAVA API直接获取,对于 IDE开发者,应该是个不错的消息.

[1] http://www.artima.com/lejava/articles/compiler_api.html

Monday, June 25, 2007

Lucene indexing process

分为3个阶段 :
1。转换成文本;
2。分析文本;
3。生成索引
生成索引还包括添加一个Document对象到索引,删除或者更新Document对象。

Monday, February 26, 2007

Pack200

It's really a hard thing to implement :-(
By now, I just remeber 2 things about the specification detail.
The bytecode renumbering, and attribute layout definition.
But, what's them, I do not know.