Pyking
A small, statically typed language that reads like Python and compiles to Python, JavaScript, C, Java and OCaml.
for name in ["Ada", "Grace", "Don"]: print("Hello, " ++ name)What Pyking is
- Python’s syntax, with stricter rules. Indentation,
def,for,ifandmatchwork as they do in Python. A name bound with=cannot change. A variable that changes is declared withvarand updated with:=. Every block is a scope. - Statically typed, with types inferred. Every program is checked before it runs. You write types where they help a reader, and the checker works out the rest.
- Compiles to many targets.
pyk compileturns one program into Python, JavaScript for node or the browser, C89 to C23, Java 8 to 21, or OCaml.pykwith no command runs the program with the interpreter. - Comes with an interpreter, a REPL and notebooks.
pyk replstarts an interactive session.pyk notebookserves a Markdown file whose code runs in the browser, like the examples on this site.