开发者

Can opa extensions be written in Ocaml?

开发者 https://www.devze.com 2023-03-19 10:05 出处:网络
I notice that included in the source of the OpaWhiteBoard example, there is a .ml file he开发者_如何转开发re:

I notice that included in the source of the OpaWhiteBoard example, there is a .ml file he开发者_如何转开发re: https://github.com/hhugo/OpaWhiteBoard/blob/master/src/opacairo/cairo.ml

This appears to be OCaml with some directives ("##"). I'm guessing this means it's possible to write extensions to Opa in OCaml, correct?


Yes you can with OPA-plugin-builder.

The book is still a work in progress (http://opalang.org/resources/book/index.html) and we will complete the plugin builder part as soon as we can.

But you can guess how it works looking at the Makefile: https://github.com/hhugo/OpaWhiteBoard/blob/master/Makefile

And the cairo.ml plugin: https://github.com/hhugo/OpaWhiteBoard/blob/master/src/opacairo/cairo.ml

The '##' directive are here in particularly to register functions and their types in OPA.


More precisely, you can get some info and example here : http://opalang.org/resources/book/index.html#hello_binding

0

精彩评论

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