Any embedded scripting language for Go

726 views
Skip to first unread message

Aravindhan K

unread,
Oct 21, 2020, 1:33:16 AM10/21/20
to golang-nuts
Hi,

I am looking for a way to build interactive app,where user will be giving instructions to draw as a script,rendering of the script will be displayed live.
I would like to use below 2d drawing package for same,

Is there scripting language that would be able generate bindings to arbiratory go packages back and forth? and I could embed it in Go App as well.

Thanks,
Aravindhan K

Marcin Romaszewicz

unread,
Oct 21, 2020, 12:51:30 PM10/21/20
to Aravindhan K, golang-nuts
Lua is probably your easiest bet:

--
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/CAJn1S2PBV00Zb2Tpb%2Be02t5uAAKxOiFNJaiNX02ES_NT_FD91g%40mail.gmail.com.

Max

unread,
Oct 21, 2020, 2:03:04 PM10/21/20
to golang-nuts
It's also possible to embed a Go interpreter in a Go App - in this way, the scripting language is Go itself.

There are several fairly complete Go interpreters around, including at least:
https://github.com/cosmos72/gomacro (disclaimer: I am the author)

Wojciech S. Czarnecki

unread,
Oct 21, 2020, 2:18:39 PM10/21/20
to golan...@googlegroups.com
Dnia 2020-10-21, o godz. 11:01:58
Aravindhan K <aravind...@gmail.com> napisał(a):

> Hi,
>
> I am looking for a way to build interactive app,where user will be giving
> instructions to draw as a script,rendering of the script will be displayed
> live.

There is such one ready, awaiting you:

https://goplay.space#draw
https://github.com/iafan/goplayspace


> I would like to use below 2d drawing package for same,
> github.com/fogleman/gg

It is being used there, indeed.

> Is there scripting language that would be able generate bindings to
> arbiratory go packages back and forth? and I could embed it in Go App as
> well.

Beside mentioned above playspace (that utilizes script that can be understood by 3-4yo kids),
there are Go interpreters as well, you might plug in - most recent I am aware of is at
https://github.com/traefik/yaegi

Hope this helps,

> Aravindhan K
>

--
Wojciech S. Czarnecki
<< ^oo^ >> OHIR-RIPE

Aravindhan K

unread,
Oct 22, 2020, 1:22:09 AM10/22/20
to Wojciech S. Czarnecki, golang-nuts
Thanks for the suggestions, I will check it out.
Go as interpreted language seems an interesting idea, I will surely try that.

https://goplay.space#draw wonderful idea! to teach programming to kids.

Thanks,
Aravindhan K




--
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.

Jan Mercl

unread,
Oct 22, 2020, 1:00:34 PM10/22/20
to Aravindhan K, golang-nuts
In case you're on Linux and you like Tcl: https://godoc.org/modernc.org/tcl#example-Interp-NewCommand

--
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.

Viktor Kojouharov

unread,
Oct 24, 2020, 5:52:41 AM10/24/20
to golang-nuts
I've had success with using
github.com/dop251/goja as a javascript interpreter

Alejandro Sáez Morollón

unread,
Oct 26, 2020, 12:27:12 PM10/26/20
to golan...@googlegroups.com
Do you know Starlark? Not sure if it will suit you, but worth taking a
look at it.

https://github.com/google/starlark-go

Kaveh Shahbazian

unread,
Oct 29, 2020, 5:25:17 PM10/29/20
to golang-nuts
If you like using/trying one from lisp family, there is also Zygo.

On Wednesday, October 21, 2020 at 7:33:16 AM UTC+2 aravind...@gmail.com wrote:
Reply all
Reply to author
Forward
0 new messages