Skip to content

Latest commit

 

History

History
43 lines (32 loc) · 2.28 KB

File metadata and controls

43 lines (32 loc) · 2.28 KB

Navigation

Table of Contents

Examples of creating dialects using mcpyrate

The dialects subsystem of mcpyrate makes Python into a language platform, à la Racket. It provides the plumbing that allows to create, in Python, dialects that compile into Python at macro expansion time. It is geared toward creating languages that extend Python and look almost like Python, but extend or modify its syntax and/or semantics. Hence dialects.

As examples of what can be done with a dialects system together with a kitchen-sink language extension macro package such as unpythonic, we currently provide the following dialects:

Lispython, Listhell, and Pytkell are AST-transforming dialects, built on top of unpythonic's macro layer. All three support unpythonic's continuations block macro, to add call/cc to the language; but it is not enabled automatically. BF is a source-to-source compiler — the body of a BF file is not parseable as Python — and demonstrates the other half of mcpyrate's dialect system.

Mostly, these dialects are intended as a cross between teaching material and a (fully functional!) practical joke, but Lispython may occasionally come in handy.