Re: [go-nuts] In memory compilation and execution of Go code
OK, but what about to use the compiler and tune it to take a string instead of a file or something like that? Or compile a function in runtime? I look into https://github.com/cosmos72/gomacro and https://github.com/go-interpreter/ssainterp but seems to use reflection to create a class and are quite slow On Wednesday, July 26, 2017 at 10:27:58 AM UTC-3, Ian Lance Taylor wrote: > > On Tue, Jul 25, 2017 at 9:53 PM, Cristian Adamo >wrote: > > > > I'm looking for a way to compile an in memory go file and execute it > within > > a go program.I have been looking around the go source code and found > that > > perhaps something from the cmd/go/internal package could be used to do > such > > task. > > There is no support for that at present, and no real advantage since > the result would have to be written to disk anyhow in order to use it. > I suggest using the ordinary compilation process on a RAM disk. > > Ian > -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: [go-nuts] In memory compilation and execution of Go code
On Tue, Jul 25, 2017 at 9:53 PM, Cristian Adamowrote: > > I'm looking for a way to compile an in memory go file and execute it within > a go program.I have been looking around the go source code and found that > perhaps something from the cmd/go/internal package could be used to do such > task. There is no support for that at present, and no real advantage since the result would have to be written to disk anyhow in order to use it. I suggest using the ordinary compilation process on a RAM disk. Ian -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[go-nuts] In memory compilation and execution of Go code
Hi guys, I'm looking for a way to compile an in memory go file and execute it within a go program.I have been looking around the go source code and found that perhaps something from the cmd/go/internal package could be used to do such task. But my question is, is anyone familiar with that package or with the go compilation process who can help me here? Thanks in advance for your help. Best, Cristian Adamo. -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.