A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/hapy-lang/hapy below:

hapy-lang/hapy: Hausa Programming language that compiles to Python

Hapy - Write Python in Hausa with braces!

Hapy is a simple programming language that uses Hausa vocabulary and compiles to Python. Originally as a final year school project.

Hapy can be installed using pip (pre-release versions)

note: Hapy is still in development so it might change a lot before full release. You can still join us for the ride!

If you have installation problems on Windows, try installing Python from the Python website gan and not Microsoft Store.

Check if Hapy is accessible globally, open a new Command-line/terminal and run hapy --help. If you're not seeing Hapy your Python packages directory may not be in PATH or some other pip/python issue. We noticed all problems disappear when we get Python from their website.

All these commands are to be run in the command line:

hapy --help - prints the help message

hapy --version or hapy -v - prints the installed Hapy version

hapy or hapy repl - launches the REPL. Exit via exit(), or Ctrl-C. Pass --english to use Hapy english vocabulary.

hapy <filename> - execute a script. Hapy uses .hapy file extension. For example: hapy lagbaja.hapy. Pass --compile-only to just print the compiled script or you can pass --save to save the compiled Python in a file.

hapy run <filename> - same as above.

hapy do "<code to evaluate>" - compiles and executes Hapy code as a string. Pass --compile-only to skip execution or pass --english/-e to use Hapy english vocabulary.

More options on the way :)

Let's say 'ayyana' is def keyword in Hausa and 'buga' is the print keyword. Sample Hapy code

    # example.hapy

    # wannan sharhi ne
    ayyana muje(){
        nuna("Let's Goooooo");
    };

    muje();

Python output after running hapy example.hapy --save

    # example.ha.py

    # wannan sharhi ne
    def muje():
        print("Let's Goooooo")

    muje()
    >>> "Let's Goooooo"

OH MY GOSH πŸ˜‚πŸ˜­, WE'RE SO DESPERATE FOR CONTRIBUTIONS THAT WE'RE LITERALLY BEGGING FOR PULL REQUESTS πŸ™πŸΌπŸ’»! WE'RE SERIOUSLY ABOUT TO START CRYING OVER HERE. PLEASE, PLEASE, PLEASE SEND A PR AND MAKE OUR DAY. WE'LL LOVE YOU FOREVER AND EVER β€οΈπŸ€—.

on it's way...

Hausa -> English Dictionary

key (Hausa): value (English)

keywords = {
     "in": "if",
    "kokuma": "elif",
    "then": "then",
    "indai": "while",
    "ma": "for",
    "karo": "import",
    "tsarin": "class",  #Changed from irin to tsarin(structure) in 0.5.0
    "yanada": "has",
    "gada": "inherits",
    "anfani": "use",
    "wuce": "pass",
    "daga": "from",
    "imbahakaba": "else",
    "cikin": "in",
    "Babu": "None",
    "dawo": "return",
    "ayyana": "def",
    "Gaskiya": "True",
    "Karya": "False",
    "nuna": "print"
}

operators_words = {
    "ba": "not",
    "da": "and",
    "ko": "or",
    "shine": "=",
    "cikin": "in",
    "of": "of",
    "ba cikin": "not in",
    "is equal": "is equal",
    "is not equal": "is not equal",
    "times": "*",
    "hada": "+",
    "raba": "/",
    "chire": "-"
}

builtin_functions = {
    "__farada__": "__init__",
    "__donnunawa__": "__repr__",
    "nuna": "print",
    "iri": "type",
    "tsakanin": "range",
    "kirga": "len",
    "rubuta": "input",
    "duka": "all",
    "tace": "filter",
    "koyar": "help",
    "id": "id",
    "lissafta": "eval",
}
Differences with Python syntax

On it's way...

Noticed something wrong with Hapy or have a suggestion?

SEND A PR MY BROTHA/SISTA or create an issue on the github

On it's way...

Hapy is released under the MIT License

If you found Hapy useful enought to cite, please cite using the following BibTeX:

@software{segunlean2021,
  author = {Segun-Lean, Emmanuel and Wuta, Shugaba},
  title = {Hapy: Hausa Programming Language},
  month = December,
  year = 2021,
  url = {https://github.com/hapy-lang/hapy}
}

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.3