开发者

A guide to Boo's metaprogramming and extensibility features?

开发者 https://www.devze.com 2022-12-10 03:13 出处:网络
I\'m interested in learning about Boo\'s more powerful features such as syntactic macros, parser support (Ometa?), compiler pipeline, etc.My impression is that these areas have been i开发者_JAVA百科n

I'm interested in learning about Boo's more powerful features such as syntactic macros, parser support (Ometa?), compiler pipeline, etc. My impression is that these areas have been i开发者_JAVA百科n flux and somewhat under-documented. Are there any good resources for learning about these things other than studying the source code?


ask code gardener / boo author @rodgrigobamboo!

"boo metaprogramming facilities I - the ast".


There's Building Domain Specific Languages in Boo. I got an early early access edition and found it frustrating for the "flux" reason you mentioned; I finally gave up. Hopefully things have stabilized since then.


Feel free to ask questions on the mailing list:

http://groups-beta.google.com/group/boolang?pli=1


By far the best reference to see what Boo can do is to spend a bunch of time going through the tests. It takes a while to puzzle out what's going on, but the tests really do flex all of the muscles that are available and are quite well written. https://github.com/bamboo/boo/blob/master/tests/testcases/macros/macro-1.boo

Also, note that boo's interpretter- booish- is really excellent and if you're not sure how a test works, you should probably spend time in booish prodding at it. http://boo.codehaus.org/Interactive+Interpreter


I haven't looked through this site extensively, but it appears it may have the best references for Boo: http://boo.codehaus.org/Tutorials

This section is still not well documented but if you look at https://github.com/bamboo/boo/wiki/Syntactic-Macros you can see how to make syntactic macros. Basically you have to implement Boo.Lang.Compiler.IAstMacro.

The correct section is in https://github.com/bamboo/boo/wiki/Abstract-Syntax-Tree but it largely seems incomplete.

0

精彩评论

暂无评论...
验证码 换一张
取 消