/500lines-rewrite

Re-write code of "500 Lines or Less" project.

Primary LanguagePythonOtherNOASSERTION

500 Line or Less (Rewritten)

Status

This project is working in progress.

Project Origin Language Origin Article Rewrite Language Rewrite Article Status
blockcode Javascript Blockcode: A visual programming toolkit
ci Python A Continuous Integration System Python rewrite-ci Done
cluster Python Clustering by Consensus
contingent Python Contingent: A Fully Dynamic Build System Python rewrite-contingent Done
crawler Python A Web Crawler With asyncio Coroutines - - -
dagoba Javascript Dagoba: an in-memory graph database Python rewrite-dagoba Done
data-store Python DBDB: Dog Bed Database Python rewrite-dbdb Done
event-web-framework LISP An Event-Driven Web Framework
flow-shop Python A Flow Shop Scheduler Python rewrite-flowshop Done
functionaldb Clojure An Archaeology-Inspired Database
image-filters Processing Making Your Own Image Filters
interpreter Python A Python Interpreter Written in Python Python rewrite-interpreter Done
modeller Python A 3D Modeller Python rewrite-modeller Done
objmodel Python A Simple Object Model Python rewrite-objmodel Done
ocr Python Optical Character Recognition (OCR)
pedometer Ruby A Pedometer in the Real World
same-origin-policy Alloy The Same-Origin Policy
sampler Python A Rejection Sampler
spreadsheet Javascript Web Spreadsheet
static analysis Julia Static Analysis Python rewrite-static-analysis Done
templating engine Python A Template Engine Python rewrite-template-engine Done
web-server Python A Simple Web Server Python rewrite-web-server Done

Rewritten of original project 500 Lines or Less with improvements in the following aspects:

  • Code written in Python2 are rewritten in Python3
  • Replace some of the outdated content with newer mechanism. For example, HTTP processing pipeline are introduced instead of CGI
  • Written in a step-by-step manner, showing actual code for each step, so we can see how to make progress
  • Some of the projects are developed in a test-driven (TDD) manner

Project relatived articles are published at My blog, in Chinese language.

How to Use

To run the program code, you need

  • Python3. Any version higher than Python3.6 should work (not verified, however). Current development environment is Python3.8.

Code of each project is in a separated directory, naming after the original project. Whitespace or hyphen(-) are replaced with underline(_) for the sake of references in code. For thosed developed in a step-by-step manner, each step also has its own sub-directory.

To run a projects written in Python: open main.py in project root, find the entry point for the project of interest, uncomment it and run.

本项目试图以更加现代化的方式重写 500 Lines or Less 项目,并在以下方面有所改进:

  • 将基于 Python2 的项目改写为基于 Python3
  • 删除部分过时的内容,用更适合现实的机制代替。例如,CGI 机制换成了 HTTP 处理管线
  • 用循序渐进的方式编写代码,展示每个具体步骤,让读者能够更好地理解
  • 部分项目采用测试驱动(TDD)的方式开发。

项目相关的介绍文章发布在 作者的博客.

如何使用

要运行程序代码,需要

  • Python3。理论上任何高于 Python3.6 的版本均可(但未验证)。目前使用的开发环境是 Python3.8

各个项目分别放在不同的目录下,命名方式遵照原先的名称,为了方便在代码中引用,部分空格或连字符(-)用下划线(_) 替代。对于使用迭代式开发的项目,每个步骤放在单独的目录下。

对于用 Python 实现的项目,请打开项目根目录下的 main.py, 找到特定的项目以及步骤编号,取消注释并运行。