https://github.com/althonos/kmachine
A toy compiler that produces Kappa code from Counter Machine instructions.
Science Score: 13.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
○CITATION.cff file
-
✓codemeta.json file
Found codemeta.json file -
○.zenodo.json file
-
○DOI references
-
○Academic publication links
-
○Committers with academic emails
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (7.0%) to scientific vocabulary
Keywords
Keywords from Contributors
Repository
A toy compiler that produces Kappa code from Counter Machine instructions.
Basic Info
Statistics
- Stars: 3
- Watchers: 2
- Forks: 1
- Open Issues: 0
- Releases: 0
Topics
Metadata Files
README.md
κmachine
A toy compiler that produces Kappa code from counter machine instructions.
Syntax
The syntax is heavily inspired by the AT&T syntax of the GNU Assembler. The following example
program copies the content of register %rax to register %rbx using a temporary register %rcx:
asm
; clear content of %rcx
clr %rcx
cpy1: ; move %rax to both %rbx and %rcx
inc %rcx
inc %rbx
dec %rax
jz %rax, cpy2
jmp cpy1
cpy2: ; move %rcx back into %rax
inc %rax
dec %rcx
jz %rcx, cpy3
jmp cpy2
cpy3:
Usage
Provide the compiler with a pseudo-assembly program, and it will generate a
self-sufficient Kappa source:
console
$ cargo run -- examples/loop.S
This program can then be run with KaSim through the command line:
console
$ KaSim examples/loop.ka
Or you can open it with the KUI to inspect the generated agents and rules:

Instructions
| Instruction | Supported | Emulated | Example |
| :---------: | :-------: | :------: | :---------------- |
| add | ✓ | | add %rax, %rbx |
| add * | | ✓ | add $0x12, %rbx |
| clr | ✓ | | clr %rax |
| cpy | | ✓ | cpy %rax, %rbx |
| inc | ✓ | | inc %rcx |
| jmp | ✓ | | jmp label |
| jnz | ✓ | | jnz %rax, label |
| jz | ✓ | | jz %rax, label |
| mov | ✓ | | mov %rax, %rbx |
| mov * | | ✓ | mov $5, %rax |
| mul | | ✓ | mul %rax, %rbx |
| swp | ✓ | | swp %rax, %rbx |
About
This program was developed by Martin Larralde as the final project for the Biochemical Programming course (2.19) of the MPRI.
Owner
- Name: Martin Larralde
- Login: althonos
- Kind: user
- Location: Heidelberg, Germany
- Company: EMBL / LUMC, @zellerlab
- Twitter: althonos
- Repositories: 91
- Profile: https://github.com/althonos
PhD candidate in Bioinformatics, passionate about programming, SIMD-enthusiast, Pythonista, Rustacean. I write poems, and sometimes they are executable.
GitHub Events
Total
Last Year
Committers
Last synced: 7 months ago
Top Committers
| Name | Commits | |
|---|---|---|
| Martin Larralde | m****e@e****r | 88 |
| ImgBotApp | I****p@g****m | 1 |
Committer Domains (Top 20 + Academic)
Issues and Pull Requests
Last synced: 7 months ago
All Time
- Total issues: 0
- Total pull requests: 1
- Average time to close issues: N/A
- Average time to close pull requests: 3 minutes
- Total issue authors: 0
- Total pull request authors: 1
- Average comments per issue: 0
- Average comments per pull request: 0.0
- Merged pull requests: 1
- Bot issues: 0
- Bot pull requests: 1
Past Year
- Issues: 0
- Pull requests: 0
- Average time to close issues: N/A
- Average time to close pull requests: N/A
- Issue authors: 0
- Pull request authors: 0
- Average comments per issue: 0
- Average comments per pull request: 0
- Merged pull requests: 0
- Bot issues: 0
- Bot pull requests: 0
Top Authors
Issue Authors
Pull Request Authors
- imgbot[bot] (1)