Giter Site home page Giter Site logo

henry232323 / henrio Goto Github PK

View Code? Open in Web Editor NEW
8.0 2.0 2.0 413 KB

im just playing with making event loops. really an async library

License: MIT License

Python 100.00%
async python3 python36 async-await asynchronous async-programming trio curio asyncio language compiler tags hacktoberfest

henrio's Introduction

henrio

A small set of projects I've been working on. The goal is to recreate some major frameworks in Python from scratch. Right now this means an async framework (like asyncio) and an embeddable Python-family language.

Three Parts:

  1. An Async Library modeled after others, with lots of inspiration from Curio, Trio, and AsyncIO. It includes many of the same concepts and can interface with multio easily, but doesn't yet have any support for anyio (prs welcome!)

    • 3 Types of Loops: Base Loop with no Async-IO; Selector Loop using the Selector Module; and on Windows, the IOCP Loop (Selector is the default)
    • Futures, Tasks, and Conditionals. Wait for a Future to be set, wrap a coroutine, wait for a condition to become true.
    • I/O. Specific operations for avoiding blocking when interacting with raw sockets.
    • File Wrappers: Selector and IOCP Loops provide special wrapped files for interacting with file I/O
    • Queue: A native LIFO/FIFO queue and a Heap Queue; Technically both work with any async lib.
    • Protocols: Selector Only. Modeled after AsyncIO's own protocols, same type of thing but with async callbacks
    • Workers: Using multiprocessing process and thread pools, run sync and async functions in separate threads
    • Loop Methods or Library Functions. Any operation available as a loop method can also be accessed using functions found in the henrio.yields module. These will run the associated operation on the Loop processing the coroutine. Generally only one loop will be running a coroutine.
    • Universals: henrio.universals This is a module containing all classes that can be used between Async libraries. For more information on inter-operation with other async libraries see async-recipes
  2. The Language. Sometimes the parsing actually works, realistically this isn't meant to be used and was more of an attempt to learn about parsing, specifically Lex-Yacc style interpretation. The language has one primary feature: all functions are run asynchronously, meaning all function definitions are async and have implicit awaits around every call (turning sync funcs into async funcs) and any top level async calls are run using henrio.run. Whats included

    • A custom import hook for importing .hio files from Python. First parsing then loading
    • A specially built "compiler" / pyc generator. An attempt at recreating how Python handles compiled files.
    • Cool other stuff maybe??
    • parser is actually broken rn, it needs to be rewritten but better this time
    • At some point I need a lex-yacc implementation that supports async, this has proven to be especially difficult unfortunately, and isn't supported by Dabeaz's rewrite of ply either
  3. Documentation for part 1, as practice for generating Python documentation. http://typheus.me/henrio/

henrio's People

Contributors

henry232323 avatar king1600 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

king1600 unazed

henrio's Issues

Mixed tabs and spaces [BOT]

Hi, I have found 2 files containing a mix of tabs and spaces!

These are:

  • /docs/_static/alabaster.css (300 spaces, 3 tabs, 14 mixed)
  • /docs/_static/websupport.js (734 spaces, 2 tabs, 0 mixed)

I am a bot; if you think this "alert" is a mistake, open an issue or contact @adri326.
If you wish to disable this bot's scan of this repository, please comment with leave me alone or leave us alone.

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.