Coder Social home page Coder Social logo

alok1106 / nemesys Goto Github PK

View Code? Open in Web Editor NEW

This project forked from fuzziqersoftware/nemesys

0.0 1.0 0.0 440 KB

Experimental Python JIT compiler

License: MIT License

C++ 95.52% Assembly 0.73% Makefile 0.20% Python 3.45% Roff 0.01% Shell 0.09%

nemesys's Introduction

nemesys is a just-in-time (JIT) compiler for the Python programming language.

This project is what happens when someone who has never written a compiler or
taken a computer languages or compilers class writes a compiler. The goals of
this project are fun and learning, not necessarily to contribute anything of
value to the world. If you're a student looking for an example of well-designed
compiler, this is not such an example.

See notes/design.md for specifics on how the compiler is implemented.

Here's what nemesys does:
- Function calls and control flow statements like if, for, while, etc.
- Fast integer math.
- Floating-point math.
- Strings, lists, and tuples.
- Classes, but not inheritance yet.
- Refcounted garbage collection.
- Custom class destructors (__del__).
- Exceptions.
- Lambdas and non-closure private functions.
- Function polymorphism.

Here's what nemesys doesn't do yet, but will in the future:
- Dicts and sets.
- Variadic functions.
- Recursion.
- Class inheritance.
- Decorators.
- Most built-in functions.
- Generators and coroutines.
- Magic methods on classes (except __init__ and __del__, which are implemented).

Here's what nemesys doesn't do yet, but could in the future:
- Interactive shell interface.
- Closures.
- Return statements inside finally blocks.
- Support the CPython C API.
- Optimize its generated assembly code.
- Build and run on architectures other than AMD64.

Here's what nemesys will probably never be able to do:
- Assign arbitrary attributes to objects after construction time.
- Polymorphic variables within a scope (except to/from None).
- Metaclasses.
- Negative exponents for integer bases. Just do 1/(a**b) instead.

Have fun. Don't complain to me if you run this and it breaks your computer.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.