55## Overview
66
77Grumpy is a Python to Go source code transcompiler and runtime that is intended
8- to be a near drop in replacement for CPython 2.7. The key difference is that it
8+ to be a near drop- in replacement for CPython 2.7. The key difference is that it
99compiles Python source code to Go source code which is then compiled to native
1010code, rather than to bytecode. This means that Grumpy has no VM. The compiled Go
1111source code is a series of calls to the Grumpy runtime, a Go library serving a
@@ -17,15 +17,15 @@ supported).
1717### Things that will probably never be supported by Grumpy
1818
19191 . ` exec ` , ` eval ` and ` compile ` : These dynamic features of CPython are not
20- supported by Grumpy because Grumpy modules consist of statically compiled Go
20+ supported by Grumpy because Grumpy modules consist of statically- compiled Go
2121 code. Supporting dynamic execution would require bundling Grumpy programs
22- with the compilation toolchain which would be unwieldy and impractically
22+ with the compilation toolchain, which would be unwieldy and impractically
2323 slow.
2424
25252 . C extension modules: Grumpy has a different API and object layout than
2626 CPython and so supporting C extensions would be difficult. In principle it's
2727 possible to support them via an API bridge layer like the one that
28- [ JyNI] ( http://jyni.org ) provides for Jython but it would be hard to maintain and
28+ [ JyNI] ( http://jyni.org ) provides for Jython, but it would be hard to maintain and
2929 would add significant overhead when calling into and out of extension
3030 modules.
3131
@@ -38,16 +38,16 @@ There are three basic categories of incomplete functionality:
3838 yet supported.
3939
40402 . Builtin functions and types: There are a number of missing functions and
41- types in ` __builtins__ ` that have not been implemented. There are also a
41+ types in ` __builtins__ ` that have not yet been implemented. There are also a
4242 lot of methods on builtin types that are missing.
4343
44443 . Standard library: The Python standard library is very large and much of it
4545 is pure Python, so as the language features and builtins get filled out, many
4646 modules will just work. But there are also a number of libraries in CPython
47- that are C extension modules that need to be rewritten.
47+ that are C extension modules which will need to be rewritten.
4848
49494 . C locale support: Go doesn't support locales in the same way that C does. As such,
50- some functionality that is locale dependent may not currently work the same as in
50+ some functionality that is locale- dependent may not currently work the same as in
5151 CPython.
5252
5353 To see the status of a particular feature or standard library module, click
@@ -68,7 +68,7 @@ echo "print 'hello, world'" | make run
6868
6969### Method 2: grumpc:
7070
71- For more complicated programs you'll want to compile your Python source code to
71+ For more complicated programs, you'll want to compile your Python source code to
7272Go using grumpc (the Grumpy compiler) and then build the Go code using `go
7373build`. First, write a simple .py script:
7474
@@ -101,16 +101,16 @@ writing, you may need to change one or more of these.
101101
102102### grumpc
103103
104- Grumpy converts Python programs into Go programs and grumpc is the tool
105- responsible for parsing Python code and generating Go code from it. grumpc is
104+ Grumpy converts Python programs into Go programs and ` grumpc ` is the tool
105+ responsible for parsing Python code and generating Go code from it. ` grumpc ` is
106106written in Python and uses the ` ast ` module to accomplish parsing.
107107
108- The grumpc script itself lives at tools/grumpc. It is supported by a number of
109- Python modules in the compiler subdir.
108+ The grumpc script itself lives at ` tools/grumpc ` . It is supported by a number of
109+ Python modules in the ` compiler ` subdir.
110110
111111### Grumpy Runtime
112112
113- The Go code generated by grumpc performs operations on data structures that
113+ The Go code generated by ` grumpc ` performs operations on data structures that
114114represent Python objects in running Grumpy programs. These data structures and
115115operations are defined in the ` grumpy ` Go library (source is in the runtime
116116subdir of the source distribution). This runtime is analogous to the Python C
@@ -119,13 +119,13 @@ counterparts in CPython.
119119
120120### Grumpy Standard Library
121121
122- Much of the Python standard library is written in Python and so it "just works"
122+ Much of the Python standard library is written in Python and thus "just works"
123123in Grumpy. These parts of the standard library are copied from CPython 2.7
124124(possibly with light modifications). For licensing reasons, these files are kept
125- in the third_party/stdlib subdir.
125+ in the ` third_party/stdlib ` subdir.
126126
127127The parts of the standard library that cannot be written in pure Python, e.g.
128- file and directory operations, are kept in the lib subdir. In CPython these
128+ file and directory operations, are kept in the ` lib ` subdir. In CPython these
129129kinds of modules are written as C extensions. In Grumpy they are written in
130130Python but they use native Go extensions to access facilities not otherwise
131131available in Python.
0 commit comments