Closed xushiwei closed 3 weeks ago
I think GOP_COMPILER
is more intuitive. GOP_GO_COMPILER
works too, but it's a bit verbose.
This is a great idea, as it not only allows the use of LLGo but also enables other Go compilers like TinyGo.
I think
GOP_COMPILER
is more intuitive.GOP_GO_COMPILER
works too, but it's a bit verbose.
GOP_COMPILER
is ambiguous and can easily lead to misunderstanding. GOP_GO_COMPILER
is clear but GOP_GOCMD
is already supported.
By default Go+ use go command as the underlying compiler tool. But in many case we want use llgo or tinygo command as the underlying compiler tool.
For now, we can select
llgo
ortinygo
by using the environment variableGOP_GOCMD
. For example:Let us assume that we introduce the following grammar in
go.mod
:or:
We specify that this project should use
llgo
ortinygo
instead ofgo
by introducing// llgo <ver>
or// tinygo <ver>
.Of course you can still select the Go compiler by specifying
GOP_GOCMD
. At this time, we will ignore the// llgo <ver>
or// tinygo <ver>
information ingo.mod
.Also, we can select
llgo
ortinygo
by adding switch-llgo
or-tinygo
to thegop mod init
command: