Online service to run Go code with Go modules support

103 views
Skip to first unread message

Alexey Melezhik

unread,
Nov 20, 2020, 5:30:18 PM11/20/20
to golang-nuts

Hi go devs. I am thinking about brining up a service that would execute Go code with support of third party modules, so that both Go modules developers and users could play with a code and get immediate results without having any Go environment, through a browser.
I've noticed that there are some similar services in the scene right now, including goplay.space and play.golang.org but they seems do not support third party modules usage.

So long story short ( I am golang newbie ), would be such a service in demand?
Thanks for comments.

PS Additionally there might my different OS support ( Linuxes distros ) so that code would be executed on respected dockers with targeted OS internally, for people doing arch dependent applications.

You can leave your comments on reddit as well - https://www.reddit.com/r/golang/comments/jxytki/online_service_to_run_go_code_with_go_modules/

Paul Jolly

unread,
Nov 20, 2020, 5:46:38 PM11/20/20
to Alexey Melezhik, golang-nuts
Hi,

> Hi go devs. I am thinking about brining up a service that would execute Go code with support of third party modules, so that both Go modules developers and users could play with a code and get immediate results without having any Go environment, through a browser.
> I've noticed that there are some similar services in the scene right now, including goplay.space and play.golang.org but they seems do not support third party modules usage.

play.golang.org does support third party modules, at least importing
them: https://play.golang.org/p/2dHQwOa7_gn

On a related note, last week we released https://play-with-go.dev/
which is designed to provide people with an interactive introduction
to the tooling required to work with the Go programming language. The
authentication is required because each guide instance is connected to
a remote container which effectively gives you a full blown
development environment in the browser alongside the guide (there is
even the option for us to serve VSCode in a similar way, allowing the
user to edit files in the remote session). But as
https://play-with-go.dev/go-fundamentals_go115_en/ demonstrates, not
only does it provide you with a complete development environment, but
guides are automatically provisioned with remote source code
repositories as required. So you interactively follow the publishing
of a real module, that is then resolved via the proxy.

> PS Additionally there might my different OS support ( Linuxes distros ) so that code would be executed on respected dockers with targeted OS internally, for people doing arch dependent applications.

With play-with-go.dev we have also explored the possibility of the
user choosing the platform on which the guide should run, which would
also vary the commands needed to run the guide as necessary.

If play-with-go.dev is of any interest I'd be happy to talk about that
more (it's an open source project, supported by sponsorship)


Paul

Dan Kortschak

unread,
Nov 20, 2020, 6:22:44 PM11/20/20
to Paul Jolly, Alexey Melezhik, golang-nuts
It does, but it depends on how big of a dependency set is imported due
to timeout. The example below does work.

https://play.golang.org/p/WL-OhWYsx68
> --
> 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...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/golang-nuts/CACoUkn6pdz228J7s0%3D8sd-tTYNjhTVUmPG%2BH23YyPaA4C_Y9Dg%40mail.gmail.com
> .


Alexey Melezhik

unread,
Nov 20, 2020, 8:49:03 PM11/20/20
to golang-nuts
Thanks. I receive " Don't communicate by sharing memory, share memory by communicating. " error (?) when run the example

пятница, 20 ноября 2020 г. в 17:22:44 UTC-6, kortschak:

Alexey Melezhik

unread,
Nov 20, 2020, 8:53:13 PM11/20/20
to golang-nuts
Hi Paul! Thanks for pointing play-with-do service. It's cool. But I'd want something less lowlevelish. I only want user to fill a form with code to run, plus some dependencies declaration if needed. Boom! Dependencies are installed, code is executed. You've got your report to share.
You could check out alternatively the service I've recently wrote for Raku - http://rakudist.raku.org/play/  Maybe I'd like to expand the same idea for other languages ... )))

пятница, 20 ноября 2020 г. в 16:46:38 UTC-6, Paul Jolly:

Aston Motes

unread,
Nov 20, 2020, 8:59:42 PM11/20/20
to Alexey Melezhik, golang-nuts

Dan Kortschak

unread,
Nov 20, 2020, 9:01:22 PM11/20/20
to golan...@googlegroups.com

Alexey Melezhik

unread,
Nov 20, 2020, 9:02:38 PM11/20/20
to golang-nuts

Ahh, ok ... )))

пятница, 20 ноября 2020 г. в 20:01:22 UTC-6, kortschak:

Alexey Melezhik

unread,
Nov 21, 2020, 10:57:07 AM11/21/20
to Dan Kortschak, Paul Jolly, golang-nuts
And what about system libraries. Tools like make or gcc required to compile some go modules, f.e. sqlite bindings? For example for gorm I get this error, due to absense of gcc compiler:


github.com/mattn/go-sqlite3 exec: "gcc": executable file not found in $PATH

https://play.golang.org/p/Xw-am5HX0PE

Reply all
Reply to author
Forward
0 new messages