Skip to content

Commit d82646e

Browse files
authored
Update README.md
1 parent f8af690 commit d82646e

File tree

1 file changed

+55
-1
lines changed

1 file changed

+55
-1
lines changed

README.md

+55-1
Original file line numberDiff line numberDiff line change
@@ -1 +1,55 @@
1-
# python-grammar-hacks
1+
# Hacking Python's grammar
2+
3+
## Getting the source
4+
5+
Download the source with git,
6+
7+
git clone https://github.com/python/cpython.git
8+
9+
or you can download a [zip file](https://github.com/python/cpython/archive/master.zip).
10+
11+
## Compiling
12+
13+
### Windows
14+
PCbuild\build.bat -e -d
15+
16+
### macOS and Linux
17+
Generate the Makefile with
18+
19+
./configure
20+
21+
Then we can build Python.
22+
23+
make
24+
25+
#### Compiling with ccache (optional)
26+
27+
If we're compiling on macOS or Linux, we can speed things up with ccache. Compiling with ccache lets us only compile files that have changed so that we don't have to recompile the entire project because one file changed.
28+
29+
##### Ubuntu
30+
sudo apt-get install ccache
31+
32+
##### Arch Linux
33+
pacman -S ccache
34+
35+
##### macOS (requires Homebrew)
36+
37+
brew install ccache
38+
39+
To use ccache when we compile Python, we just have to make two changes to the Makefile.
40+
We need to replace the following lines
41+
42+
CC= gcc -pthread
43+
CXX= g++ -pthread
44+
45+
with the following.
46+
47+
CC= ccache gcc -pthread
48+
CXX= ccache g++ -pthread
49+
50+
Now everytime running `make` after the first, the compilation will be much quicker.
51+
52+
## Our first change
53+
In Python, we have to `import` modules before we can use them,
54+
55+
but we've decided we don't like the word `import` and want to `require` modules instead.

0 commit comments

Comments
 (0)