Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upTry Yaegi #24
Try Yaegi #24
Comments
If somebody has time to try this, I'd love to hear from you! |
I was also thinking about yaegi too. Its amazing to have an interpreter. I am thinking of using it for the CI scripts, so that i dont have to use the providers scripting language, but instead just write the scripts in golang. So the first thing the CI does is install yaegi, and then your cooking... I am using Azure pipelines so that i can run the tests and builds in all Operating systems. |
Great! I'd love to see some examples of what you're doing—we could add them to the README to show how to use |
Ok will buzz you when i have some ready |
Hey @joeblew99, how are you getting on? Any news? |
@bitfield Got nothing done on it. Had to work on quic networking stack. Sorry but you know how it is with development - always so many things going on. I think that its still worth while for CI. |
No problem, maybe somebody else will be able to pick this up and have a play with it! |
Hello, I tried to play with Yaegi + script today. I did not dig super far but when trying this fairly simple program:
I have no issue with
I am not super confortable with Yaegi's internals so I am not sure to be able to quickly debug this by now Might need a little bit more of experimentation. |
Oh, great! Thanks for finding this. As far as I know this is the first real bug anyone's ever found in Would you mind opening this as a new issue? I'll grab Yaegi and see if I can reproduce this and figure out what's going on. |
Actually, cancel that; I figured it out! Or rather, there's an oddity in the code which, though it works perfectly under standard Go, causes Yaegi to crash. That's a Yaegi issue, which I'll go ahead and file as soon as I've got a reproducing program that doesn't use I'll push a change to |
I was wondering if the problem was actually on the Yaegi side! Well spotted! |
@lobre this is containous/yaegi#558. |
I hadn't tried Yaegi before, so thanks very much to @lobre for suggesting it. Having had a look, my sense is that it's at a fairly early stage at the moment, and there seem to be problems using it with lots of well-known and widely-used libraries. So it's definitely worth trying Yaegi with |
So the issue was with the ReadAutoCloser type, which wraps an type ReadAutoCloser struct {
r io.Reader
} But the Read method is magical, because it detects So far, so good. But note that we declared Whatever Yaegi does, though, causes this to fail. Even though it's not strictly a bug in
@lobre, does this fix your example program, or do you at least not get the exact same crash? |
Hello @bitfield, Thanks for this effort trying to understand and find a fix! Unfortunately, I still have a panic with your latest fix but now with the I am not sure it is worth trying to make I am sure both projects will be a cool combo used together as soon as yaegi gets ready! Loric |
No worries, @lobre! Hopefully other people trying out Yaegi with |
This could be a good companion for
script
: https://github.com/containous/yaegiIf it works, add some documentation to the README on how to use it, with examples.