[go-nuts] Re: [ANN] pygor: yet another Python to Go regurgitator

2018-10-20 Thread Nick Craig-Wood

Very interesting :-)

It looks like a useful tool for producing a first rough cut of a python 
program.


-- Nick

On 20/10/18 05:16, Raffaele Sena wrote:
Inspired by ESR pytogo (and tired of writing python code), I went the 
complete opposite way and came up with pygor:


https://github.com/raff/pygorhttps://github.com/raff/pygor

pygor is written in Go, using the Python parser and AST from 
https://github.com/go-python/gpython (so right now it only targets 
Python 3.4). The origin of this was actually a python implementation 
that I started  a long time ago, using Python ast, but hat didn't go 
very far because it was hard to do Go things in python.


It doesn't generate runnable code, but aspire to generate at least 
code that passes the smell test of "go fmt" (with the problem that if 
"go fmt" fails to correctly format the code, the translation fails).


pygor also attempt to convert some of the python magic (list and dict 
comprehension, for example) to Go, again mainly in order to generate 
formatted code. And it also comes with a concept of "runtime" 
(automatically imported when needed) to implement a couple of things 
that are hard to do inline.


Enjoy,

Raffaele


--
You received this message because you are subscribed to the Google 
Groups "go-python" group.
To unsubscribe from this group and stop receiving emails from it, send 
an email to go-python+unsubscr...@googlegroups.com 
.
To post to this group, send email to go-pyt...@googlegroups.com 
.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/go-python/CANKfucYmWed786-ErNmO-Dyu-zVDSV43AfG17aDoMq1diq9Q9A%40mail.gmail.com 
.

For more options, visit https://groups.google.com/d/optout.



--
Nick Craig-Wood  -- http://www.craig-wood.com/nick

--
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[go-nuts] Re: [ANN] pygor: yet another Python to Go regurgitator

2018-10-19 Thread Eric Raymond


On Saturday, October 20, 2018 at 12:17:16 AM UTC-4, Raffaele Sena wrote:
>
> Inspired by ESR pytogo (and tired of writing python code), I went the 
> complete opposite way and came up with pygor:
>

Bravo.

I am amused by the name - puts me in mind of Discworld Igors.  And if my 
sadly departed friend Terry Pratchett were still alive so I could explain 
it to him I have no doubt he would be amused too.  He would have made a 
fine upstanding hacker if his life had gone a bit differently.

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.