lygaret / miriam

a rather ambitious scheme

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Miriam Scheme

miriam is:

  • a hobby project; likely indefinitely undone
  • a kinda scheme, kinda clojure, kinda common lisp
  • a self-hosted bytecode compiler, runtime, and armv7 assembler
  • a bare-metal, language-based operating system
  • a userland that can be used to make one-off games and demos

status

miriam is in no way ready for others to play with, but ./devlog.org will help get you up to speed.

[2023-12-10 Sun] the assemebler’s macro system is nicely coming along

[2023-12-08 Fri] the assembler is mostly working, and I’m working on value reprs

[2023-12-04 Mon] build a raw binary output file and run in qemu

$ guile --r7rs -L ./scm ./tests/assembler-tests.scm
$ qemu-system-arm -machine raspi2b -device loader,file=a.bin,addr=0x20 -Ss

# in another term, connect gdb and single-step through
$ arm-none-eabi-gdb
> layout asm
> layout reg
> target remote localhost:1234
> si ; to single step (code starts at 0x20)

high-level plan

  • [-] an ARMv7 assembler (r7rs, run on host)
  • [ ] a bytecode vm and garbage collector, written in our assembler
    • which can be booted on an rpi, or devterm, or rg35xx, or something
    • multiprocessor?
      • the vm should be able to run independently on all cores
      • study more in-depth BEAM
  • [ ] a compiler for scheme to our bytecode vm
    • “scheme” - this doesn’t actually have to be a scheme
    • if it’s not 100%, it means writing a bunch of library code
      • but rewriting srfis is probably good for my personal growth
  • [ ] a rewrite of the assembler and compiler to run on the bytecode compiler
    • self-hosting is necessary for full user-space support, because we need to support eval
  • [ ] a multi-core capable operating system, written in scheme
    • virtual memory and user-mode
    • preemptive thread scheduler; thread and ipc io via async channels
    • a network stack, PHY+MAC should come from the hardware
    • kernel interface via lexical closures and capability passing
  • [ ] a minimal user-space!
    • a text adventure game (zork)
    • a graphical shell for the os
    • a tetris game
    • a web browser? gopher maybe?

shout outs

I have read prose, read code, and re-read prose from all over, and the following people and projects stand out. They have all have my deepest and most sincere gratitude for writing, building, thinking and working in the open, where I could learn from them.

As such, a reading list, in no particular order:

tools

license

Copyright (c) 2023 Jonathan Raphaelson

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

See ./LICENSE

third party

Third party code is identified here, and with a copyright line in the file itself.

See ./COPYRIGHT

About

a rather ambitious scheme

License:GNU General Public License v3.0


Languages

Language:Scheme 75.4%Language:Assembly 16.9%Language:Emacs Lisp 5.8%Language:Makefile 1.3%Language:HTML 0.5%Language:GDB 0.1%