# Calling GoLang from Typescript

**URL:** <https://forum.heroiclabs.com/t/calling-golang-from-typescript/4267>\
**Category:** Runtime Framework\
**Tags:** typescript\
**Created:** [August 24, 2023, 2:10pm UTC](https://forum.heroiclabs.com/t/calling-golang-from-typescript/4267 "2023-08-24T14:10:03Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![RobinM](https://avatars.discourse-cdn.com/v4/letter/r/b5a626/32.png) [@RobinM](https://forum.heroiclabs.com/u/RobinM)\
**Post date:** [August 24, 2023, 2:10pm UTC](https://forum.heroiclabs.com/t/calling-golang-from-typescript/4267/1 "2023-08-24T14:10:03Z")

</div>

We’re wondering if it’s possible to make GoLang functions available in TypeScript or if there is any other way to call GoLang code from TypeScript. We would like to run some GoLang functions and get the output of those functions in TypeScript.

---

<div class="post-metadata">

**Author:** ![sesposito](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.heroiclabs.com/sesposito/32/2594_2.png) [@sesposito](https://forum.heroiclabs.com/u/sesposito)\
**Post date:** [August 25, 2023, 3:53pm UTC](https://forum.heroiclabs.com/t/calling-golang-from-typescript/4267/2 "2023-08-25T15:53:33Z")

</div>

Hello @RobinM

It’s not possible to invoke Go code directly from the TS runtime. There’s a way around it, which is to declare RPCs in the Go runtime and then invoke them from TS as http calls to 127.0.0.1, however this pattern is not ideal and should be used sparingly, plus, it may not be suitable for performance critial code paths as it incurs in the additional overhead of the http stack.

Best.

---

<div class="post-metadata">

**Author:** ![RobinM](https://avatars.discourse-cdn.com/v4/letter/r/b5a626/32.png) [@RobinM](https://forum.heroiclabs.com/u/RobinM)\
**Post date:** [August 25, 2023, 7:26pm UTC](https://forum.heroiclabs.com/t/calling-golang-from-typescript/4267/3 "2023-08-25T19:26:02Z")

</div>

@sesposito Thanks a lot, that should work fine for us!
