Skip to content
vic

vmchale/kempe

Kempe is a compiled stack-based language

vmchale/kempe.json
{
"createdAt": "2020-09-18T14:51:48Z",
"defaultBranch": "master",
"description": "Kempe is a compiled stack-based language",
"fullName": "vmchale/kempe",
"homepage": "",
"language": "Haskell",
"name": "kempe",
"pushedAt": "2024-09-30T10:36:53Z",
"stargazersCount": 58,
"topics": [
"aarch64",
"haskell",
"languages",
"stack-based",
"stack-based-language",
"x86-64"
],
"updatedAt": "2024-11-05T00:14:18Z",
"url": "https://github.com/vmchale/kempe"
}

Kempe is a stack-based language and toy compiler for x86_64 and aarch64. It requires the nasm assembler when targeting x86_64.

Inspiration is primarily from Mirth.

See manual here. There is also a tour of the compiler available here.

Installation is via cabal-install:

cabal install kempe

For shell completions put the following in your ~/.bashrc or ~/.bash_profile:

eval "$(kc --bash-completion-script kc)"
  • Errors don’t have position information

  • Monomorphization fails on recursive polymorphic functions

    Hopefully this isn’t too sinful; I can’t think of any examples of recursive polymorphic functions

  • Can’t export or call C functions with more than 6 arguments; can’t call or export large arguments (i.e. structs) passed by value.

    This is less of an impediment than it sounds like.

  • Cyclic imports are not detected

  • Imports are kind of defective

You may wish to use Mirth or Factor instead. Mirth is statically typed (similar to Kempe) but less mature.