Skip to main content

A programming language based on Toisanese, aka Taishanese, a dialect of Cantonese

Project description



GitHub Workflow Status Code style: black Downloads

A programming language based on Toisanese, aka Taishanese, a dialect of Cantonese


pip install toisan-lang

Command Line Usage

  • python -m toisan_lang "..." to transpile and execute toisan-lang in Python
  • --show xxx to show extra information if given: tree for parse tree, code for transpiled python code

For example,

Transpile and execute

python -m toisan_lang "你系嚿叉烧。你个头系假咯。睇下你系乜呀。睇下(丐时)系乜。"


{'头': False}
2020-02-28 12:09:01.580252
To Show extra information
python -m toisan_lang "你系嚿叉烧。你个头系假咯。睇下你系乜呀。睇下(丐时)系乜。" --show tree code


Parse Tree:
  (begin_program (begin_scope))
    (statement (st_assign
      (var_list (var (variable_ref '你'))) '系'
      (exp_list (exp (dict_init '嚿叉烧'))))) '。'
    (statement (st_assign
      (var_list (var (variable_ref '你' '个' '头'))) '系'
      (exp_list (exp (constant (boolean '假')))))) '咯' '。'
    (statement (st_print '睇下'
      (var (variable_ref '你')) '系乜')) '呀' '。'
    (statement (st_print '睇下'
      (adjusted_exp '('
        (exp (now '丐时')) ')') '系乜')) '。')
  (end_program (end_scope)))

Transpiled Python Code:
from datetime import datetime

def main():
    你 = dict()
    你['头'] = False
    print( 你 )
    print( ( ) )

if __name__ == '__main__':

{'头': False}
2020-03-03 22:26:13.549966

Code Usage

from toisan_lang import parse
program = """
code, tree = parse(program)


git clone
cd toisan-lang
python -m venv venv
source venv/bin/activate
pip install -r requirements-dev.txt

To run test, simply


Happy hacking!

Credit: logo from

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for toisan-lang, version 0.1.2
Filename, size File type Python version Upload date Hashes
Filename, size toisan_lang-0.1.2-py3-none-any.whl (8.6 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size toisan_lang-0.1.2.tar.gz (38.5 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page