Interesting. Thanks for the perspective. I did take a look at the PyPy ast
module but I guess I got scared off by the PyPy specific requriements.

I ended up integrating pythonparser <https://github.com/m-labs/pythonparser>
which is a pure Python parser for Python 2.x and 3.x. I'm very impressed
with the quality of the code and it has a more powerful interface than the
AST module (e.g. it gives line/column ranges for different parts of a
node), so it seemed like a no brainer.

I am curious what your toolchain looks like, so if you publish it, be sure
to update this thread.

On Fri, 17 Feb 2017 at 06:08 <p...@boddie.org.uk> wrote:

> On Saturday, February 4, 2017 at 5:35:33 AM UTC+1, Dylan Trotter wrote:
>
> The compiler cannot yet run under Grumpy because it uses standard
> libraries that aren't yet supported. The most substantial unsupported
> library is the ast module. Once https://github.com/google/grumpy/pull/216
> is merged, I think we'll be very close to hosting the compiler in Grumpy.
> At that point, supporting go get would be feasible.
>
>
> As someone suggested on Reddit (or Hacker News, or whatever it is called),
> you could use the ast module implementation from PyPy. I've been working on
> my own toolchain for a Python-like language, and to move gradually towards
> self-hosting, I migrated from the parser module (implemented in C for
> CPython) to the pyparser package that is also provided by PyPy. I didn't
> adopt the ast module from PyPy because I've been using the compiler package
> all along, and it was more sensible for me to adapt pyparser and my fork of
> compiler to work together.
>
> With the pyparser stuff, you'll need to remove some PyPy-specific
> operations related to object spaces, but it wasn't difficult to get working
> at all. The PyPy people have done some nice work that, unfortunately,
> doesn't get recognised as much as it should. Since I'm aiming to release
> the source code for my toolchain fairly soon, you might be interested in
> what (little) I did in this regard.
>
> By the way, I like what you're attempting to do with this project. I don't
> use Go myself, but I totally understand and support the idea of targeting
> it. My own toolchain targets C, which is fairly awkward but does have some
> portability arguments in its favour.
>
> Paul
>
> --
> You received this message because you are subscribed to the Google Groups
> "Grumpy Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to grumpy-users+unsubscr...@googlegroups.com.
> To post to this group, send email to grumpy-us...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/grumpy-users/86089c26-8d6a-4780-90c4-8d883aef3307%40googlegroups.com
> <https://groups.google.com/d/msgid/grumpy-users/86089c26-8d6a-4780-90c4-8d883aef3307%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

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

Reply via email to