• Stars
    star
    126
  • Rank 275,809 (Top 6 %)
  • Language
    Python
  • License
    MIT License
  • Created over 8 years ago
  • Updated almost 8 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Python Compiler Infrastructure

Python Compiler Infrastructure

The Pytsi -initiative's goal is to provide a C compiler that is easy to set up, understand and maintain.

So far it parses trigraphs, tokenizes and preprocesses. It also has a cool probe that can be imported:

~/pytci$ python gcc_probe.py /opt/gcw0-toolchain/usr/bin/mipsel-gcw0-linux-uclibc-gcc
{
    "includes": [
        "/opt/gcw0-toolchain/usr/lib/gcc/mipsel-gcw0-linux-uclibc/4.9.1/include", 
        "/opt/gcw0-toolchain/usr/lib/gcc/mipsel-gcw0-linux-uclibc/4.9.1/include-fixed", 
        "/opt/gcw0-toolchain/usr/lib/gcc/mipsel-gcw0-linux-uclibc/4.9.1/../../../../mipsel-gcw0-linux-uclibc/include", 
        "/opt/gcw0-toolchain/usr/mipsel-gcw0-linux-uclibc/sysroot/usr/include"
    ], 
    "interpreter": "/lib/ld-uClibc.so.0", 
    "local_includes": [], 
    "search_paths": [
        "/usr/local/lib", 
        "/lib", 
        "/usr/lib"
    ]
}

I programmed Pytci to run on Python 2.7.10 because PEP 0492 is one big clusterfuck. The effort to complicate python compiler should be directed towards standardizing greenlets instead.

Attempt was being made to get Pytci preprocess like existing compilers.

Early benchmark

I compared macroexpansion of gcc -E and python preprocess.py. on /usr/include/stdio.h. Pytci preprocesses it only 25 times slower than gcc.

Correctness

For a bulltest, I preprocessed a header with Pytci and compiled a "hello world" program against it. Lack of errors and messages proposes that there were mostly non-errorneous behavior.

License

MIT allows full interoperability and code sharing with other really interesting projects.

More Repositories

1

lever

A programming language in the Perl/Python/Ruby group
HTML
129
star
2

json-algorithm

Now even your pet rock can parse JSON.
Python
88
star
3

node-wayland

Wayland bindings for node.js
C++
61
star
4

spirthon

Python bytecode to SPIR-V -translation.
Python
40
star
5

node-udev

Bindings to libudev
C++
34
star
6

chartparser

Chart parser (Earley SPPF)
Python
25
star
7

cffi-gen

C Foreign function interface generator.
Python
19
star
8

codemirror-ether

Demonstration, codemirror as a collaborative editor. Attempts to be simple enough for anyone to implement in their editor.
JavaScript
8
star
9

suoml

A small "ideal" language.
Makefile
8
star
10

textended-edit

Editor for t+ -format.
Python
8
star
11

pyllisp

interpreter prototypes in rpython
Python
7
star
12

purescript-rady

Encode/decode typed structures using a regular expression DSL.
PureScript
7
star
13

essence

Programming environment that failed to redefine terms in programming
Python
7
star
14

vkstruct

Bindings focused on filling Vulkan structures
Python
6
star
15

lisp-editor

lisp-inspired visual editor concept.
5
star
16

icicle-binfmt

5
star
17

lijp

LIJP language
Python
4
star
18

dg

Direct Graphics API for Open Source Platforms
C
4
star
19

lelux

Toy Linux distribution
Makefile
4
star
20

little_list_editor

Python
3
star
21

prolog-tic-tac-toe

Tic tac toe written in Prolog, applying game-semantics to programming
Prolog
3
star
22

pygame_tutorial

Cheery's Pygame Tutorial
Python
3
star
23

node-dg

Bindings for libdg
C++
2
star
24

node-gdev

video library for node (WIP, early alpha)
JavaScript
2
star
25

browserid-service-verify

Verifies BrowserID assertion by using free verification service in browserid.org
JavaScript
2
star
26

riscv-mini-hello

Mini-hello-world with a raw ELF header for RISC-V
Assembly
2
star
27

rendertools

Some rendering related tools for python & linux
Python
2
star
28

snakelisp

The graphical list processing language
Python
2
star
29

node-dg-webgl

dg-webgl bindings
C++
2
star
30

riscv-maze

A small graphics program for RV8 and RISC-V
Assembly
2
star
31

language

programming language study/parser/experiment/runtime
C
2
star
32

diffbuff

Diffable protocol buffers
Python
2
star
33

helium-desktop

Experiments on operating systems user interfaces
CoffeeScript
1
star
34

handwritten-digit-recognition

Handwritten digit recognition, GPT-assisted programming
Python
1
star
35

dialogic-vm

A VM prototype exploring dialogic programming
Python
1
star
36

suomipelit

CoffeeScript
1
star
37

suchlog

Should-have-used-curry-in-logic
Python
1
star
38

vscode-lever

Lever programming tools for Visual Studio Code
JavaScript
1
star
39

vim-lever

Vim syntax files for Lever programming language
Vim Script
1
star
40

hextracker

JavaScript
1
star
41

sp_rytmi

Suomipelit.fi:n rytmipeli
1
star
42

raspberrypi-multimedia

(WIP) multimedia library for raspberry pi
Python
1
star
43

colors-game

Hand-written clone of http://sleepysort.github.io/colors/
CoffeeScript
1
star
44

python-flappy-mapeli

Mapeli for flappy bird
Python
1
star
45

alonzo_nbe

Lambda calculus nbe-normalizer/parser/printer
Haskell
1
star
46

flog

Functional programming language made in RPython
Python
1
star
47

lrkit

Parser generator for LR parsers
Python
1
star
48

midi-proxy-js

Relays the MIDI events into a browser. Linux only.
Python
1
star
49

toiletart

milani/appjs an 'example'
CoffeeScript
1
star
50

mkpages

Python
1
star
51

lpirk

An experimental horn-clause based IR targetting javascript (not completed)
Python
1
star