News for hackers. Stuff that matters.
Re:Zygomys: Embedded Scripting Language for Go by Zambyte on Wednesday June 28, 2023 @07:22PM (#36514090)
Very interesting! I'll have to play around with it. It seems like this wants to be to Go what Hy is to Python.

Another related language that is embedded in Go is golisp by SteelSeries: https://github.com/SteelSeries/golisp

Re:Zygomys: Embedded Scripting Language for Go by seanw444 on Thursday June 29, 2023 @03:14AM (#36517388)
I wonder what SteelSeries of all companies would not only use that for, but put resources into developing.
Re:Zygomys: Embedded Scripting Language for Go by ilyt on Wednesday June 28, 2023 @08:31PM (#36514758)
Used it to do some operations on incoming mqtt things on my custom i3 bar thingy, quite nice if you like Lisp
Re:Zygomys: Embedded Scripting Language for Go by schemescape on Wednesday June 28, 2023 @09:26PM (#36515170)
Out of curiosity, what kinds of things?
Re:Zygomys: Embedded Scripting Language for Go by ilyt on Thursday June 29, 2023 @05:13AM (#36518137)
My phone's power level. Got task sent via tasker to some code that turns that into mqtt messages. Then they go to the metrics gatherer on my NAS (it also has gps position and few other things), and my computer.

I had more but mpower pro I was using (power strip with 6 sockets, power measuring and control) died on me ;/

Re:Zygomys: Embedded Scripting Language for Go by erik_seaberg on Wednesday June 28, 2023 @10:12PM (#36515513)
Is anyone working on generating compiler-ready boilerplate from macros, rather than running interpretively?
Re:Zygomys: Embedded Scripting Language for Go by thefounder on Wednesday June 28, 2023 @10:40PM (#36515696)
Yes, I did that extensively and ended up using reflection only. The code generation/generated is just hard to maintain and the tools that generate the code (and read the code) are hard to maintain as well. Currently I'm using code "reading" only to extract documentation so no more code generation.
Re:Zygomys: Embedded Scripting Language for Go by kubb on Thursday June 29, 2023 @02:38AM (#36517151)
This is one Go's blind spots. It's there, it's solvable most effectively at the language level, it's ignored.
Re:Zygomys: Embedded Scripting Language for Go by liampulles on Thursday June 29, 2023 @04:41AM (#36517929)
I worked on a side project to try and generate mapping code with Go (like mapstruct) but abandoned it: https://github.com/liampulles/juryrig

I do wish there was a nice library to aid in parsing Go, there may be one I'm not aware of - I used the standard AST library but it is very verbose. Actually generating the code is very easy and go format helps a lot.

Custom kubernetes operators in Go use code generation via comments extensively, perhaps worth looking at.

Re:Zygomys: Embedded Scripting Language for Go by Solvency on Wednesday June 28, 2023 @10:45PM (#36515722)
Seems like a missed opportunity to make it Gua.
Re:Zygomys: Embedded Scripting Language for Go by adastra22 on Thursday June 29, 2023 @12:44AM (#36516373)
An infinitely better name.
Re:Zygomys: Embedded Scripting Language for Go by rob74 on Thursday June 29, 2023 @05:20AM (#36518186)
Or even Gooa (witten phonetically to ensure correct pronunciation in English)?
Re:Zygomys: Embedded Scripting Language for Go by myzie on Thursday June 29, 2023 @06:06AM (#36518491)
Nice. Somehow this is the first time I'm seeing Zygomys.

If you're not in love with the lisp syntax, you might want to take a look at Risor as well.

https://github.com/risor-io/risor#quick-example

  array := ["gophers", "are", "burrowing", "rodents"]
  sentence := array | strings.join(" ") | strings.to_upper
  print(sentence)
Re:Zygomys: Embedded Scripting Language for Go by jaten on Thursday June 29, 2023 @06:45AM (#36518732)
Zygo does have infix available in addition to traditional lisp parentheses. Just put the math (or whatever) inside curly braces. I much prefer math in infix, so I put in a Pratt parser for that.
Re:Zygomys: Embedded Scripting Language for Go by BiteCode_dev on Thursday June 29, 2023 @06:07AM (#36518499)
I was wondering was was this for Rust.

Then I realized with maturin, that was Python :)