# \[RFC\] TVMScript Metaprogramming

**URL:** <https://discuss.tvm.apache.org/t/rfc-tvmscript-metaprogramming/12969>\
**Category:** RFC\
**Created:** [June 16, 2022, 5:49pm UTC](https://discuss.tvm.apache.org/t/rfc-tvmscript-metaprogramming/12969 "2022-06-16T17:49:51Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![yelite](https://discuss.tvm.apache.org/user_avatar/discuss.tvm.apache.org/yelite/32/3651_2.png) [@yelite](https://discuss.tvm.apache.org/u/yelite)\
**Post date:** [June 17, 2022, 3:22pm UTC](https://discuss.tvm.apache.org/t/rfc-tvmscript-metaprogramming/12969/3 "2022-06-17T15:22:05Z")

</div>

Yes, that’s right. Actually you can write imperative code to construct IR graph now, by calling IR node constructors from `tvm.tir.stmt|expr` manually. The new things behind F4 are:

1. IRBuilder API, which can be used to construct IR nodes in a more concise way compared to calling node constructor directly.
2. The ability to embed these functions inside TVMScript. This means you can use imperative code to construct small fragments inside a large T.prim\_func.

---

_[View the full topic](https://discuss.tvm.apache.org/t/rfc-tvmscript-metaprogramming/12969)._
