Build python 1.0

A little archaeological interest made me want to explore early Python, so I built and ran Python 1.0.1.

Programming archeology series

Get source code

The oldest source code currently available from the official Python page (http://legacy.python.org/download/releases/src/) is Python 1.0.1. It was released in 1994, nearly five years after Python development began in December 1989. According to the README

Older sources

If you find an older Python release (e.g. 0.9.8), we're interested in getting a copy! [email protected]

Therefore, it seems that data has been lost in earlier versions. Speaking of 1989, there was no Git, SVN, or CVS, so there is no help for it.

Download and unzip.

$ curl http://legacy.python.org/download/releases/src/python1.0.1.tar.gz -O
$ tar xzf python1.0.1.tar.gz
$ cd python-1.0.1

Build

The tarball contains configure, Makefile.in, etc., and the build procedure is exactly the same as in modern times.

However, the internally used function getline conflicts with the modern standard library, so you need to replace the name.

$ sed -i 's/^getline/my_getline/' Objects/fileobject.c
$ sed -i 's/ getline/ my_getline/' Objects/fileobject.c

All you have to do is build as usual.

$ ./configure
$ make

Try to move

Let's play with the binary file python that came out.

$ ./python
Python 1.0.1 (Jan 11 2017)
Copyright 1991-1994 Stichting Mathematisch Centrum, Amsterdam
>>> hex(12345678901234567890)
OverflowError: integer literal too large
>>> hex(12345678901234567890L)
'0xAB54A98CEB1F0AD2L'
>>> int('100')
Traceback (innermost last):
  File "<stdin>", line 1
TypeError: int() argument can't be converted to int
>>> int(1.5)
1
>>> def fibonatti(n):
...     if n == 1 or n == 2:
...         return 1
...     else:
...         return fibonatti(n - 1) + fibonatti(n - 2)
...
>>> fibonatti(5)
5
>>> o = {'foo': 1, 'bar': 'baz'}
>>> o
{'foo': 1, 'bar': 'baz'}
>>> for i in range(5):
...     print(i)
...
0
1
2
3
4
>>> range(100)
[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99]
>>> [i * 2 for i in range(10)]
/home/esolang/python: line 3:     7 Segmentation fault      ./python
$

It doesn't have much functionality, but it works just like modern Python.

next time

Build Ruby 0.49 --Qiita

References

Recommended Posts

Build python 1.0
Python
build Python on Ubuntu
Build python3 environment with ubuntu 16.04
Build Python environment on Windows
Build python environment with direnv
[ev3dev × Python] Build ev3dev development environment
Build python environment on windows
Build a Python environment offline
kafka python
Python basics ⑤
python + lottery 6
Python Summary
Built-in python
Python comprehension
Studying python
Python 2.7 Countdown
Python memorandum
Python FlowFishMaster
Python service
python tips
Python memo
Build python virtual environment with virtualenv
Python comprehension
Python Singleton
Python basics ④
Python Memorandum 2
Python increment
atCoder 173 Python
[Python] function
Python installation
python tips
Build Mysql + Python environment with docker
Installing Python 3.4.3.
Try python
Python memo
Python iterative
Python algorithm
Python2 + word2vec
[Python] Variables
Python functions
Python sys.intern ()
Python tutorial
Python decimals
python underscore
Python summary
Start python
[Python] Sort
Note: Python
Python basics ③
python log
Python basics
python memo
Build mlpy with python3.3 (64bit) (windows 64bit)
Python memorandum
Python # sort
ufo-> python
Python nslookup
python learning
Hannari Python 2020
[Rpmbuild] Python 3.7.3.