Projektrahmen: Cargo-Workspace, README und PLAN
Workspace mit sechs Crates (tb-frontend, tb-vm, tb-runtime, tb-ui, tb-cli, tb-ide) als Geruest fuer die Re-Implementierung des DOS-BASIC-Dialekts. Binaries: tbdos (IDE/TUI) und tbdosc (Standalone-Compiler). PLAN.md dokumentiert Phasen, Explorations- schritte und die Abwaegung der VM-/Runtime-Optionen (Entscheidung: eigene Bytecode-VM, TBVM). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
3
.gitignore
vendored
Normal file
3
.gitignore
vendored
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
/target
|
||||||
|
**/*.rs.bk
|
||||||
|
*.pdb
|
||||||
682
Cargo.lock
generated
Normal file
682
Cargo.lock
generated
Normal file
@@ -0,0 +1,682 @@
|
|||||||
|
# This file is automatically @generated by Cargo.
|
||||||
|
# It is not intended for manual editing.
|
||||||
|
version = 4
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "allocator-api2"
|
||||||
|
version = "0.2.21"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "683d7910e743518b0e34f1186f92494becacb047c7b6bf616c96772180fef923"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "anyhow"
|
||||||
|
version = "1.0.104"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "330a5ed07fa54e4702c9d6c4174f74427fc0ef6e214bbd677ae50a5099946470"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "bitflags"
|
||||||
|
version = "2.13.1"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "b588b76d00fde79687d7646a9b5bdf3cc0f655e0bbd080335a95d7e96f3587da"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "cassowary"
|
||||||
|
version = "0.3.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "df8670b8c7b9dae1793364eafadf7239c40d669904660c5960d74cfd80b46a53"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "castaway"
|
||||||
|
version = "0.2.4"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "dec551ab6e7578819132c713a93c022a05d60159dc86e7a7050223577484c55a"
|
||||||
|
dependencies = [
|
||||||
|
"rustversion",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "cfg-if"
|
||||||
|
version = "1.0.4"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "9330f8b2ff13f34540b44e946ef35111825727b38d33286ef986142615121801"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "compact_str"
|
||||||
|
version = "0.8.2"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "7fd622ebbb56a5b2ccb651b32b911cdeb2a9b4b11776b2473bf26a26a286244e"
|
||||||
|
dependencies = [
|
||||||
|
"castaway",
|
||||||
|
"cfg-if",
|
||||||
|
"itoa",
|
||||||
|
"rustversion",
|
||||||
|
"ryu",
|
||||||
|
"static_assertions",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "crossterm"
|
||||||
|
version = "0.28.1"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "829d955a0bb380ef178a640b91779e3987da38c9aea133b20614cfed8cdea9c6"
|
||||||
|
dependencies = [
|
||||||
|
"bitflags",
|
||||||
|
"crossterm_winapi",
|
||||||
|
"mio",
|
||||||
|
"parking_lot",
|
||||||
|
"rustix",
|
||||||
|
"signal-hook",
|
||||||
|
"signal-hook-mio",
|
||||||
|
"winapi",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "crossterm_winapi"
|
||||||
|
version = "0.9.1"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "acdd7c62a3665c7f6830a51635d9ac9b23ed385797f70a83bb8bafe9c572ab2b"
|
||||||
|
dependencies = [
|
||||||
|
"winapi",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "darling"
|
||||||
|
version = "0.24.1"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "ed17f5901b6630b993ca003def43f2f8ef4014fc13b047b57aad617ff32bc2ec"
|
||||||
|
dependencies = [
|
||||||
|
"darling_core",
|
||||||
|
"darling_macro",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "darling_core"
|
||||||
|
version = "0.24.1"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "6837e2cf7485aaae18f86181d2f0e9a7ed297a025e220aeabf63fdebd3a2ddff"
|
||||||
|
dependencies = [
|
||||||
|
"ident_case",
|
||||||
|
"proc-macro2",
|
||||||
|
"quote",
|
||||||
|
"strsim",
|
||||||
|
"syn 3.0.4",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "darling_macro"
|
||||||
|
version = "0.24.1"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "2ac7135c3ef02b2f7833bbeb1be5ba7f966dcde8a87c6b87f65a778d71a02785"
|
||||||
|
dependencies = [
|
||||||
|
"darling_core",
|
||||||
|
"quote",
|
||||||
|
"syn 3.0.4",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "either"
|
||||||
|
version = "1.18.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "252afb9ae5eaa683babdc6a068b3f5726eb19e05070c731f9b2a23a7c3e8ed34"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "equivalent"
|
||||||
|
version = "1.0.2"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "errno"
|
||||||
|
version = "0.3.14"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "39cab71617ae0d63f51a36d69f866391735b51691dbda63cf6f96d042b63efeb"
|
||||||
|
dependencies = [
|
||||||
|
"libc",
|
||||||
|
"windows-sys 0.61.2",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "foldhash"
|
||||||
|
version = "0.1.5"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "d9c4f5dac5e15c24eb999c26181a6ca40b39fe946cbe4c263c7209467bc83af2"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "hashbrown"
|
||||||
|
version = "0.15.5"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "9229cfe53dfd69f0609a49f65461bd93001ea1ef889cd5529dd176593f5338a1"
|
||||||
|
dependencies = [
|
||||||
|
"allocator-api2",
|
||||||
|
"equivalent",
|
||||||
|
"foldhash",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "heck"
|
||||||
|
version = "0.5.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "ident_case"
|
||||||
|
version = "1.0.1"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "indoc"
|
||||||
|
version = "2.0.7"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "79cf5c93f93228cf8efb3ba362535fb11199ac548a09ce117c9b1adc3030d706"
|
||||||
|
dependencies = [
|
||||||
|
"rustversion",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "instability"
|
||||||
|
version = "0.3.13"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "2bf84e73fa6f27f299dec58e13223cf70db80da872eb921d4f6138342a0eabc8"
|
||||||
|
dependencies = [
|
||||||
|
"darling",
|
||||||
|
"indoc",
|
||||||
|
"proc-macro2",
|
||||||
|
"quote",
|
||||||
|
"syn 3.0.4",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "itertools"
|
||||||
|
version = "0.13.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "413ee7dfc52ee1a4949ceeb7dbc8a33f2d6c088194d9f922fb8318faf1f01186"
|
||||||
|
dependencies = [
|
||||||
|
"either",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "itoa"
|
||||||
|
version = "1.0.18"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "8f42a60cbdf9a97f5d2305f08a87dc4e09308d1276d28c869c684d7777685682"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "libc"
|
||||||
|
version = "0.2.189"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "3eaf3ede3fee6db1a4c2ee091bf8a8b4dccdc6d17f656fb07896ee72867612f2"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "linux-raw-sys"
|
||||||
|
version = "0.4.15"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "d26c52dbd32dccf2d10cac7725f8eae5296885fb5703b261f7d0a0739ec807ab"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "lock_api"
|
||||||
|
version = "0.4.14"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "224399e74b87b5f3557511d98dff8b14089b3dadafcab6bb93eab67d3aace965"
|
||||||
|
dependencies = [
|
||||||
|
"scopeguard",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "log"
|
||||||
|
version = "0.4.34"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "f9f8bd3e56ce4dfc153cf470fffbfa98c7620958b312ca5c3a4b8d5181fd13c6"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "lru"
|
||||||
|
version = "0.12.5"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "234cf4f4a04dc1f57e24b96cc0cd600cf2af460d4161ac5ecdd0af8e1f3b2a38"
|
||||||
|
dependencies = [
|
||||||
|
"hashbrown",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "mio"
|
||||||
|
version = "1.2.2"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "30d65c71f1ce40ab09135ce117d742b9f8a19ff91a41a8b57ed50bc2de59c427"
|
||||||
|
dependencies = [
|
||||||
|
"libc",
|
||||||
|
"log",
|
||||||
|
"wasi",
|
||||||
|
"windows-sys 0.61.2",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "parking_lot"
|
||||||
|
version = "0.12.5"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "93857453250e3077bd71ff98b6a65ea6621a19bb0f559a85248955ac12c45a1a"
|
||||||
|
dependencies = [
|
||||||
|
"lock_api",
|
||||||
|
"parking_lot_core",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "parking_lot_core"
|
||||||
|
version = "0.9.12"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "2621685985a2ebf1c516881c026032ac7deafcda1a2c9b7850dc81e3dfcb64c1"
|
||||||
|
dependencies = [
|
||||||
|
"cfg-if",
|
||||||
|
"libc",
|
||||||
|
"redox_syscall",
|
||||||
|
"smallvec",
|
||||||
|
"windows-link",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "paste"
|
||||||
|
version = "1.0.15"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "proc-macro2"
|
||||||
|
version = "1.0.107"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "985e7ec9bb745e6ce6535b544d84d6cd6f7ad8bd711c398938ae983b91a766d9"
|
||||||
|
dependencies = [
|
||||||
|
"unicode-ident",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "quote"
|
||||||
|
version = "1.0.47"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "1fbf4db142a473a8d80c26bbf18454ed458bf8d26c8219c331daecfdbd079001"
|
||||||
|
dependencies = [
|
||||||
|
"proc-macro2",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "ratatui"
|
||||||
|
version = "0.29.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "eabd94c2f37801c20583fc49dd5cd6b0ba68c716787c2dd6ed18571e1e63117b"
|
||||||
|
dependencies = [
|
||||||
|
"bitflags",
|
||||||
|
"cassowary",
|
||||||
|
"compact_str",
|
||||||
|
"crossterm",
|
||||||
|
"indoc",
|
||||||
|
"instability",
|
||||||
|
"itertools",
|
||||||
|
"lru",
|
||||||
|
"paste",
|
||||||
|
"strum",
|
||||||
|
"unicode-segmentation",
|
||||||
|
"unicode-truncate",
|
||||||
|
"unicode-width 0.2.0",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "redox_syscall"
|
||||||
|
version = "0.5.18"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "ed2bf2547551a7053d6fdfafda3f938979645c44812fbfcda098faae3f1a362d"
|
||||||
|
dependencies = [
|
||||||
|
"bitflags",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "rustix"
|
||||||
|
version = "0.38.44"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "fdb5bc1ae2baa591800df16c9ca78619bf65c0488b41b96ccec5d11220d8c154"
|
||||||
|
dependencies = [
|
||||||
|
"bitflags",
|
||||||
|
"errno",
|
||||||
|
"libc",
|
||||||
|
"linux-raw-sys",
|
||||||
|
"windows-sys 0.59.0",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "rustversion"
|
||||||
|
version = "1.0.23"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "cf54715a573b99ac80df0bc206da022bcd442c974952c7b9720069370852e21f"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "ryu"
|
||||||
|
version = "1.0.23"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "9774ba4a74de5f7b1c1451ed6cd5285a32eddb5cccb8cc655a4e50009e06477f"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "scopeguard"
|
||||||
|
version = "1.2.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "signal-hook"
|
||||||
|
version = "0.3.18"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "d881a16cf4426aa584979d30bd82cb33429027e42122b169753d6ef1085ed6e2"
|
||||||
|
dependencies = [
|
||||||
|
"libc",
|
||||||
|
"signal-hook-registry",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "signal-hook-mio"
|
||||||
|
version = "0.2.5"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "b75a19a7a740b25bc7944bdee6172368f988763b744e3d4dfe753f6b4ece40cc"
|
||||||
|
dependencies = [
|
||||||
|
"libc",
|
||||||
|
"mio",
|
||||||
|
"signal-hook",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "signal-hook-registry"
|
||||||
|
version = "1.4.8"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "c4db69cba1110affc0e9f7bcd48bbf87b3f4fc7c61fc9155afd4c469eb3d6c1b"
|
||||||
|
dependencies = [
|
||||||
|
"errno",
|
||||||
|
"libc",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "smallvec"
|
||||||
|
version = "1.15.2"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "8ed6a63f02c8539c91a8685a86f4099661ba3da017932f6ebbea6de3f0fa7c90"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "static_assertions"
|
||||||
|
version = "1.1.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "strsim"
|
||||||
|
version = "0.11.1"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "strum"
|
||||||
|
version = "0.26.3"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "8fec0f0aef304996cf250b31b5a10dee7980c85da9d759361292b8bca5a18f06"
|
||||||
|
dependencies = [
|
||||||
|
"strum_macros",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "strum_macros"
|
||||||
|
version = "0.26.4"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "4c6bee85a5a24955dc440386795aa378cd9cf82acd5f764469152d2270e581be"
|
||||||
|
dependencies = [
|
||||||
|
"heck",
|
||||||
|
"proc-macro2",
|
||||||
|
"quote",
|
||||||
|
"rustversion",
|
||||||
|
"syn 2.0.119",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "syn"
|
||||||
|
version = "2.0.119"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "872831b642d1a07999a962a351ed35b955ea2cfc8f3862091e2a240a84f17297"
|
||||||
|
dependencies = [
|
||||||
|
"proc-macro2",
|
||||||
|
"quote",
|
||||||
|
"unicode-ident",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "syn"
|
||||||
|
version = "3.0.4"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "e6275cddf4610d1775e6d1fe9469b2e77d0f39fd98fb7450901b821e0c53649f"
|
||||||
|
dependencies = [
|
||||||
|
"proc-macro2",
|
||||||
|
"quote",
|
||||||
|
"unicode-ident",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "tb-cli"
|
||||||
|
version = "0.1.0"
|
||||||
|
dependencies = [
|
||||||
|
"anyhow",
|
||||||
|
"tb-frontend",
|
||||||
|
"tb-runtime",
|
||||||
|
"tb-ui",
|
||||||
|
"tb-vm",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "tb-frontend"
|
||||||
|
version = "0.1.0"
|
||||||
|
dependencies = [
|
||||||
|
"log",
|
||||||
|
"thiserror",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "tb-ide"
|
||||||
|
version = "0.1.0"
|
||||||
|
dependencies = [
|
||||||
|
"anyhow",
|
||||||
|
"crossterm",
|
||||||
|
"ratatui",
|
||||||
|
"tb-frontend",
|
||||||
|
"tb-runtime",
|
||||||
|
"tb-ui",
|
||||||
|
"tb-vm",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "tb-runtime"
|
||||||
|
version = "0.1.0"
|
||||||
|
dependencies = [
|
||||||
|
"log",
|
||||||
|
"thiserror",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "tb-ui"
|
||||||
|
version = "0.1.0"
|
||||||
|
dependencies = [
|
||||||
|
"crossterm",
|
||||||
|
"log",
|
||||||
|
"ratatui",
|
||||||
|
"thiserror",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "tb-vm"
|
||||||
|
version = "0.1.0"
|
||||||
|
dependencies = [
|
||||||
|
"log",
|
||||||
|
"tb-frontend",
|
||||||
|
"thiserror",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "thiserror"
|
||||||
|
version = "2.0.20"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "ec86235f5fcc2a73650310756d2ac5b138a5780bbbdfae3eeccec992c435ba4f"
|
||||||
|
dependencies = [
|
||||||
|
"thiserror-impl",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "thiserror-impl"
|
||||||
|
version = "2.0.20"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "bc04cd3e1236dd4a98afca4569f2deb3f120e5422a4023be2cb683f8486292af"
|
||||||
|
dependencies = [
|
||||||
|
"proc-macro2",
|
||||||
|
"quote",
|
||||||
|
"syn 3.0.4",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "unicode-ident"
|
||||||
|
version = "1.0.24"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "e6e4313cd5fcd3dad5cafa179702e2b244f760991f45397d14d4ebf38247da75"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "unicode-segmentation"
|
||||||
|
version = "1.13.3"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "c6f5d3c3b1bf09027a88a6bc961fc00497d651009560b5463668dc81b0fa87a8"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "unicode-truncate"
|
||||||
|
version = "1.1.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "b3644627a5af5fa321c95b9b235a72fd24cd29c648c2c379431e6628655627bf"
|
||||||
|
dependencies = [
|
||||||
|
"itertools",
|
||||||
|
"unicode-segmentation",
|
||||||
|
"unicode-width 0.1.14",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "unicode-width"
|
||||||
|
version = "0.1.14"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "7dd6e30e90baa6f72411720665d41d89b9a3d039dc45b8faea1ddd07f617f6af"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "unicode-width"
|
||||||
|
version = "0.2.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "1fc81956842c57dac11422a97c3b8195a1ff727f06e85c84ed2e8aa277c9a0fd"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "wasi"
|
||||||
|
version = "0.11.1+wasi-snapshot-preview1"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "ccf3ec651a847eb01de73ccad15eb7d99f80485de043efb2f370cd654f4ea44b"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "winapi"
|
||||||
|
version = "0.3.9"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419"
|
||||||
|
dependencies = [
|
||||||
|
"winapi-i686-pc-windows-gnu",
|
||||||
|
"winapi-x86_64-pc-windows-gnu",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "winapi-i686-pc-windows-gnu"
|
||||||
|
version = "0.4.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "winapi-x86_64-pc-windows-gnu"
|
||||||
|
version = "0.4.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "windows-link"
|
||||||
|
version = "0.2.1"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "f0805222e57f7521d6a62e36fa9163bc891acd422f971defe97d64e70d0a4fe5"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "windows-sys"
|
||||||
|
version = "0.59.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b"
|
||||||
|
dependencies = [
|
||||||
|
"windows-targets",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "windows-sys"
|
||||||
|
version = "0.61.2"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "ae137229bcbd6cdf0f7b80a31df61766145077ddf49416a728b02cb3921ff3fc"
|
||||||
|
dependencies = [
|
||||||
|
"windows-link",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "windows-targets"
|
||||||
|
version = "0.52.6"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973"
|
||||||
|
dependencies = [
|
||||||
|
"windows_aarch64_gnullvm",
|
||||||
|
"windows_aarch64_msvc",
|
||||||
|
"windows_i686_gnu",
|
||||||
|
"windows_i686_gnullvm",
|
||||||
|
"windows_i686_msvc",
|
||||||
|
"windows_x86_64_gnu",
|
||||||
|
"windows_x86_64_gnullvm",
|
||||||
|
"windows_x86_64_msvc",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "windows_aarch64_gnullvm"
|
||||||
|
version = "0.52.6"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "windows_aarch64_msvc"
|
||||||
|
version = "0.52.6"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "windows_i686_gnu"
|
||||||
|
version = "0.52.6"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "windows_i686_gnullvm"
|
||||||
|
version = "0.52.6"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "windows_i686_msvc"
|
||||||
|
version = "0.52.6"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "windows_x86_64_gnu"
|
||||||
|
version = "0.52.6"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "windows_x86_64_gnullvm"
|
||||||
|
version = "0.52.6"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "windows_x86_64_msvc"
|
||||||
|
version = "0.52.6"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec"
|
||||||
37
Cargo.toml
Normal file
37
Cargo.toml
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
[workspace]
|
||||||
|
resolver = "2"
|
||||||
|
members = [
|
||||||
|
"crates/tb-frontend",
|
||||||
|
"crates/tb-vm",
|
||||||
|
"crates/tb-runtime",
|
||||||
|
"crates/tb-ui",
|
||||||
|
"crates/tb-cli",
|
||||||
|
"crates/tb-ide",
|
||||||
|
]
|
||||||
|
|
||||||
|
[workspace.package]
|
||||||
|
version = "0.1.0"
|
||||||
|
edition = "2021"
|
||||||
|
license = "MIT"
|
||||||
|
repository = ""
|
||||||
|
authors = ["Georg Bauer"]
|
||||||
|
|
||||||
|
[workspace.dependencies]
|
||||||
|
# UI / Terminal
|
||||||
|
ratatui = "0.29"
|
||||||
|
crossterm = "0.28"
|
||||||
|
|
||||||
|
# Allgemein
|
||||||
|
anyhow = "1"
|
||||||
|
thiserror = "2"
|
||||||
|
log = "0.4"
|
||||||
|
|
||||||
|
# Interne Crates
|
||||||
|
tb-frontend = { path = "crates/tb-frontend" }
|
||||||
|
tb-vm = { path = "crates/tb-vm" }
|
||||||
|
tb-runtime = { path = "crates/tb-runtime" }
|
||||||
|
tb-ui = { path = "crates/tb-ui" }
|
||||||
|
|
||||||
|
[profile.release]
|
||||||
|
lto = true
|
||||||
|
codegen-units = 1
|
||||||
159
PLAN.md
Normal file
159
PLAN.md
Normal file
@@ -0,0 +1,159 @@
|
|||||||
|
# PLAN — Terminal Basic
|
||||||
|
|
||||||
|
Arbeitsplan für die Re-Implementierung des DOS-BASIC-Dialekts (1992) in Rust.
|
||||||
|
Dieses Dokument wird fortgeschrieben: erledigte Punkte werden abgehakt,
|
||||||
|
Entscheidungen mit Datum und Begründung festgehalten.
|
||||||
|
|
||||||
|
Konvention: `[ ]` offen · `[x]` erledigt · `[~]` in Arbeit
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Leitplanken
|
||||||
|
|
||||||
|
- **Referenzverhalten schlägt Eleganz.** Bei Zweifeln zählt das beobachtbare
|
||||||
|
Verhalten des Vorbilds (inkl. Fehlercodes, Rundung, Formatierung), nicht
|
||||||
|
das, was „richtiger" wäre. Abweichungen werden dokumentiert.
|
||||||
|
- **Markenrecht:** Der Name des Vorbilds wird in Code, Doku und Artefakten
|
||||||
|
nicht verwendet. Wir sprechen vom „Vorbild" bzw. „dem Dialekt".
|
||||||
|
- **Jede Phase endet mit lauffähigen Tests** gegen eine wachsende
|
||||||
|
Kompatibilitäts-Testsuite (Verzeichnis `tests/compat`, geplant).
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Phase 0 — Exploration und Grundsatzentscheidungen
|
||||||
|
|
||||||
|
### 0.1 Sprach- und Bibliotheksreferenz rekonstruieren
|
||||||
|
- [ ] Sprachreferenz zusammentragen: Anweisungen, Funktionen, Operatoren,
|
||||||
|
Typsystem (INTEGER, LONG, SINGLE, DOUBLE, STRING, CURRENCY,
|
||||||
|
feste Strings, `TYPE…END TYPE`), Typ-Suffixe (`% & ! # $ @`),
|
||||||
|
`DEFINT`-Familie, Sichtbarkeitsregeln (`SHARED`, `COMMON`, `STATIC`)
|
||||||
|
- [ ] Forms-/Steuerelemente-Referenz: Steuerelementtypen, Eigenschaften,
|
||||||
|
Methoden, Ereignisse, Standardwerte, Fokus- und Z-Reihenfolge
|
||||||
|
- [ ] Dateiformate dokumentieren: Quelltext (`.BAS`), Formulare (`.FRM`,
|
||||||
|
Textformat mit `VERSION`/`Begin…End`-Blöcken), Projekt (`.MAK`)
|
||||||
|
- [ ] Laufzeitfehler-Katalog (Codes + Meldungstexte) erfassen
|
||||||
|
- [ ] Testkorpus aufbauen: kleine Referenzprogramme, deren erwartete Ausgabe
|
||||||
|
dokumentiert ist (Grundlage der Kompatibilitäts-Testsuite)
|
||||||
|
|
||||||
|
### 0.2 VM-/Runtime-Entscheidung (Aufstellung der Optionen)
|
||||||
|
|
||||||
|
Anforderungen an die Ausführungsschicht: BASIC-Fehlersemantik
|
||||||
|
(`ON ERROR GOTO`/`RESUME` mit `ERR`/`ERL`), `GOSUB`/`RETURN`,
|
||||||
|
unterbrechbare Ausführung (Debugger-Einzelschritt, Strg+Untbr,
|
||||||
|
ereignisgesteuerte Forms-Hauptschleife), dynamische Strings/Arrays mit
|
||||||
|
BASIC-Semantik, serialisierbares Kompilat, gute Fehlerortung (Zeile/Spalte).
|
||||||
|
|
||||||
|
| Option | Vorteile | Nachteile | Eignung |
|
||||||
|
|---|---|---|---|
|
||||||
|
| **1. Eigene Bytecode-VM in Rust („TBVM")** | Volle Kontrolle über Semantik (Fehlerbehandlung, GOSUB, Events, Suspend/Resume); Bytecode als `.tbc` serialisierbar; Debugger-Integration trivial (Zeileninfo im Bytecode); keine Fremdabhängigkeit | Eigenaufwand für VM, GC/Refcounting für Strings/Arrays; „nur" Interpreter-Geschwindigkeit | **Empfohlen** — Interpreter-Tempo genügt für 80×25-Programme bei Weitem |
|
||||||
|
| **2. Tree-Walking-Interpreter** | Schnellster Weg zu ersten laufenden Programmen; ideal zum Validieren der Semantik | Langsam; Debugger/Resume-Semantik unsauber; wäre später Wegwerfcode | Optional als Bootstrap in Phase 1, dann ersetzen |
|
||||||
|
| **3. WebAssembly-Ziel (wasmtime/wasmer)** | Ausgereifte VMs mit JIT (Cranelift); portables, standardisiertes Kompilat; Sandbox; theoretisch Browser-Ausführung | BASIC-Semantik passt schlecht: `ON ERROR`/`RESUME`, `GOSUB` und unterbrechbare Ausführung müssen aufwendig transformiert werden (Relooper/State-Machine); Strings/Arrays komplett selbst verwalten; Debugging über zwei Ebenen; schwere Abhängigkeit | Später als **zweites Backend** denkbar (gleiche IR), nicht als Start |
|
||||||
|
| **4. Cranelift direkt (JIT auf nativen Code)** | Native Geschwindigkeit; Rust-eigenes Projekt, gut eingebettet | Gleiche Semantik-Transformationsprobleme wie WASM; kein portables Kompilat; JIT auf allen drei Plattformen pflegen | Nur falls Performance je Thema wird — unwahrscheinlich |
|
||||||
|
| **5. LLVM-AOT (inkwell)** | Maximale Performance, echte Executables | Sehr schwere Toolchain-Abhängigkeit (LLVM-Build je Plattform); lange Kompilierzeiten; Debugger/Edit-Run-Zyklus der IDE leidet massiv | Ungeeignet für dieses Projekt |
|
||||||
|
| **6. Transpilation auf fremde Skript-VM (Lua via mlua/piccolo)** | Ausgereifte VM mit GC geschenkt | Semantik-Mismatch (Zahlentypen, Fehler-/Eventmodell, 1-basierte vs. BASIC-Arrays mit `OPTION BASE`); Fehlerortung und Debugger bilden schlecht ab | Ungeeignet |
|
||||||
|
| **7. Transpilation nach Rust (AOT)** | Native Binaries, keine VM | Kein Interpretermodus → IDE-Kernfeatures (Direktfenster, Start ohne Build-Wartezeit, Debugger) praktisch unmöglich; Rust-Toolchain als Laufzeitvoraussetzung | Ungeeignet als Primärziel |
|
||||||
|
|
||||||
|
**Entscheidung (2026-09-01):** Eigene Stack-basierte Bytecode-VM (**Option 1, TBVM**).
|
||||||
|
Die IR/Bytecode-Schicht wird sauber vom Interpreter getrennt, sodass später ein
|
||||||
|
zweites Backend (WASM via Cranelift, Option 3) ergänzt werden kann, ohne das
|
||||||
|
Frontend anzufassen. Für die Ausführungsgeschwindigkeit typischer
|
||||||
|
Terminal-Programme ist ein Interpreter mehr als ausreichend; entscheidend sind
|
||||||
|
Debugger-Fähigkeit, exakte Fehlersemantik und der schnelle Edit-Run-Zyklus der IDE.
|
||||||
|
|
||||||
|
- [x] Optionen aufstellen und bewerten (siehe Tabelle)
|
||||||
|
- [ ] Bytecode-Grobdesign: Stack-Maschine, Konstantenpool, Zeilentabelle
|
||||||
|
für Diagnostik/Debugger, Aufrufkonventionen (SUB/FUNCTION vs. GOSUB)
|
||||||
|
- [ ] Speichermodell für Werte: Tagged Enum vs. NaN-Boxing; Refcounting
|
||||||
|
für Strings/Arrays (kein Zyklenrisiko im Dialekt → Rc genügt)
|
||||||
|
|
||||||
|
### 0.3 Ratatui-/Terminal-Spike
|
||||||
|
- [ ] 80×25-Zellenpuffer (Zeichen + Farbattribut) als eigenes Widget rendern;
|
||||||
|
Verhalten bei kleineren/größeren Terminals festlegen (Letterboxing?)
|
||||||
|
- [ ] Codepage-437-Abbildung auf Unicode (Rahmenzeichen, Symbole) prüfen —
|
||||||
|
Darstellungstest unter Windows Terminal, gnome-terminal, iTerm2
|
||||||
|
- [ ] 16-Farben-Palette und Blink/Intensity-Attribut abbilden
|
||||||
|
- [ ] Maus-Ereignisse (crossterm) und Sondertasten (F1–F12, Alt-Kombis) testen;
|
||||||
|
bekannte Terminal-Einschränkungen dokumentieren
|
||||||
|
- [ ] Ereignisschleifen-Architektur: Terminal-Events → Event-Queue → VM-Ticks
|
||||||
|
|
||||||
|
## Phase 1 — Sprach-Frontend (`tb-frontend`)
|
||||||
|
- [ ] Lexer inkl. Typ-Suffixe, Zeilennummern/Labels, `REM`/`'`-Kommentare,
|
||||||
|
case-insensitive Keywords
|
||||||
|
- [ ] AST für Module, Prozeduren, Anweisungen, Ausdrücke, Deklarationen
|
||||||
|
- [ ] Parser (zeilenorientiert, fehlertolerant — die IDE prüft pro Zeile)
|
||||||
|
- [ ] Semantik: Symboltabellen, implizite Deklaration, `DEFINT`-Regeln,
|
||||||
|
Typprüfung und -konvertierung, `OPTION EXPLICIT`/`OPTION BASE`,
|
||||||
|
Array-Dimensionierung (statisch/dynamisch, `REDIM`)
|
||||||
|
- [ ] Diagnostik mit exakten Positionen und den Meldungstexten des Vorbilds
|
||||||
|
- [ ] Meilenstein: kompletter Testkorpus parst und wird typgeprüft
|
||||||
|
|
||||||
|
## Phase 2 — Bytecode und VM (`tb-vm`)
|
||||||
|
- [ ] Bytecode-Format und Serialisierung (`.tbc`)
|
||||||
|
- [ ] Codegenerator AST → Bytecode
|
||||||
|
- [ ] Interpreter: Ausdrücke, Kontrollfluss (`IF`, `SELECT CASE`, Schleifen,
|
||||||
|
`GOTO`/`GOSUB`), Prozeduraufrufe, `BYREF`-Semantik
|
||||||
|
- [ ] Fehlerbehandlung: `ON ERROR GOTO/RESUME`, `ERR`/`ERL`, Fehlerkaskaden
|
||||||
|
- [ ] Unterbrechbarkeit: Tick-Grenzen, Breakpoints, Einzelschritt,
|
||||||
|
Variableninspektion (Grundlage für IDE-Debugger)
|
||||||
|
- [ ] Meilenstein: Konsolen-Testkorpus läuft mit korrekter Ausgabe (`tbdosc run`)
|
||||||
|
|
||||||
|
## Phase 3 — Laufzeitbibliothek (`tb-runtime`) und Bildschirm (`tb-ui::screen`)
|
||||||
|
- [ ] Strings: `LEFT$`, `MID$` (auch als Anweisung), `INSTR`, `STR$`/`VAL`,
|
||||||
|
`SPACE$`, `STRING$`, `LTRIM$`/`RTRIM$`, `UCASE$`/`LCASE$` …
|
||||||
|
- [ ] Zahlenformatierung: `PRINT`-Zonen, `PRINT USING` (vollständig),
|
||||||
|
Banker's Rounding, `CINT`/`CLNG`/`CSNG`/`CDBL`/`CCUR`
|
||||||
|
- [ ] Mathematik: `RND`/`RANDOMIZE` (kompatibler PRNG!), trigonometrische
|
||||||
|
Funktionen, Integer-Überlaufverhalten (Fehler 6)
|
||||||
|
- [ ] Datei-E/A: `OPEN` (sequenziell/random/binär), `INPUT#`/`LINE INPUT#`,
|
||||||
|
`PRINT#`/`WRITE#`, `GET`/`PUT` mit Record-Typen, `EOF`/`LOF`/`SEEK`,
|
||||||
|
Pfadsemantik plattformübergreifend
|
||||||
|
- [ ] Bildschirm: `PRINT`, `LOCATE`, `COLOR`, `CLS`, `INPUT`, `INKEY$`,
|
||||||
|
`CSRLIN`/`POS`, `WIDTH`, `VIEW PRINT` auf dem Zellenpuffer
|
||||||
|
- [ ] Meilenstein: klassische Konsolenprogramme laufen unverändert
|
||||||
|
|
||||||
|
## Phase 4 — Forms-Engine (`tb-ui::forms`)
|
||||||
|
- [ ] Formular-Modell: Eigenschaften, Lade-/Entladezyklus, `SHOW`/`HIDE`
|
||||||
|
(modal/nicht-modal)
|
||||||
|
- [ ] Steuerelemente: CommandButton, TextBox, ListBox, ComboBox, CheckBox,
|
||||||
|
OptionButton, Frame, Label, HScrollBar/VScrollBar, PictureBox (Text),
|
||||||
|
Timer — mit allen Eigenschaften/Methoden/Ereignissen des Vorbilds
|
||||||
|
- [ ] Menüsystem (Menüleiste, Shortcuts, Access Keys)
|
||||||
|
- [ ] Fokus-/Tab-Reihenfolge, Access-Keys, Maussteuerung
|
||||||
|
- [ ] `.FRM`-Dateiformat lesen/schreiben (Kompatibilität zu Originaldateien)
|
||||||
|
- [ ] Ereignisdispatch: Event-Queue ↔ VM (Ereignisprozeduren `Name_Ereignis`)
|
||||||
|
- [ ] Meilenstein: Beispiel-Formularprogramme aus dem Testkorpus laufen
|
||||||
|
|
||||||
|
## Phase 5 — IDE (`tb-ide`)
|
||||||
|
- [ ] IDE-Rahmen: Menüleiste, MDI-artige Fensterverwaltung, Statuszeile,
|
||||||
|
klassisches Farbschema
|
||||||
|
- [ ] Editor: Syntaxprüfung/-normalisierung pro Zeile (Keywords groß,
|
||||||
|
Leerzeichen), Suchen/Ersetzen, Hilfe-Verweise
|
||||||
|
- [ ] Projektverwaltung (`.MAK`): mehrere Module/Formulare
|
||||||
|
- [ ] Formular-Designer: Steuerelemente platzieren/verschieben/skalieren,
|
||||||
|
Eigenschaftenfenster
|
||||||
|
- [ ] Ausführen aus der IDE: Start/Unterbrechen/Fortsetzen/Neustart
|
||||||
|
- [ ] Debugger: Breakpoints, Einzelschritt/Prozedurschritt, Direktfenster,
|
||||||
|
Überwachungsausdrücke
|
||||||
|
- [ ] Meilenstein: Programm komplett in der IDE schreiben, gestalten,
|
||||||
|
debuggen und ausführen
|
||||||
|
|
||||||
|
## Phase 6 — Kompatibilität, Politur, Distribution
|
||||||
|
- [ ] Kompatibilitäts-Testsuite ausbauen (Snapshot-Tests der Bildschirmausgabe)
|
||||||
|
- [ ] Plattformtests: Windows Terminal, Linux (mind. 2 Emulatoren), macOS
|
||||||
|
- [ ] Performance-Pass über die VM (nur falls nötig)
|
||||||
|
- [ ] `tbdosc build` → binäres Ergebnis: `.tbc`-Bytecode bzw. eigenständig
|
||||||
|
ausführbares Programm (Bytecode + eingebetteter Runner)
|
||||||
|
- [ ] Dokumentation: Sprachreferenz, Migrationshinweise, Beispielprogramme
|
||||||
|
- [ ] CI (GitHub Actions: Build + Tests auf allen drei Plattformen), Releases
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Offene Fragen
|
||||||
|
|
||||||
|
- Umgang mit `CURRENCY` (`@`): als i64-Festkomma (×10 000) — klären, ob das
|
||||||
|
Vorbild ihn überhaupt in allen Kontexten unterstützt
|
||||||
|
- ISAM-Dateiunterstützung des Vorbilds: nachbilden oder als Nicht-Ziel erklären?
|
||||||
|
- `PEEK`/`POKE`/`CALL INTERRUPT` u. ä. Hardware-Nähe: sinnvolle Teilmenge
|
||||||
|
emulieren (z. B. Bildschirmspeicher B800) oder Laufzeitfehler?
|
||||||
|
- Verhalten bei Terminals < 80×25: Mindestgröße erzwingen oder scrollen?
|
||||||
|
- Lizenzwahl (MIT im Rahmen angenommen — bestätigen)
|
||||||
51
README.md
Normal file
51
README.md
Normal file
@@ -0,0 +1,51 @@
|
|||||||
|
# Terminal Basic
|
||||||
|
|
||||||
|
Eine plattformübergreifende Re-Implementierung des letzten großen BASIC-Dialekts
|
||||||
|
für DOS (1992) — Sprache, Laufzeitbibliothek, Forms-Engine und IDE — in Rust,
|
||||||
|
mit [Ratatui](https://ratatui.rs) als Terminal-UI-Schicht.
|
||||||
|
|
||||||
|
> Dieses Projekt ist eine unabhängige Neuentwicklung und steht in keiner
|
||||||
|
> Verbindung zu Microsoft. Produktnamen Dritter werden bewusst nicht verwendet.
|
||||||
|
|
||||||
|
## Ziele
|
||||||
|
|
||||||
|
- **Volle Sprachkompatibilität**: alle Sprachelemente des Dialekts —
|
||||||
|
Prozeduren (`SUB`/`FUNCTION`), benutzerdefinierte Typen, `GOSUB`,
|
||||||
|
`ON ERROR`/`RESUME`, Typ-Suffixe, feste und dynamische Arrays,
|
||||||
|
`PRINT USING`, `DATA`/`READ` usw.
|
||||||
|
- **Volle Library-Kompatibilität für die DOS-Oberflächenprogrammierung**:
|
||||||
|
die ereignisgesteuerte Forms-Engine mit allen Steuerelementen, Menüs,
|
||||||
|
Maus- und Tastaturereignissen, nachgebildet auf einem emulierten
|
||||||
|
80×25-Textbildschirm (Codepage 437, 16 Farben) über Ratatui.
|
||||||
|
- **Plattformübergreifend**: läuft in Terminals unter Linux, macOS und Windows.
|
||||||
|
- **Compiler + VM**: der Compiler erzeugt Bytecode für eine eigene virtuelle
|
||||||
|
Maschine (TBVM); die Abwägung der Runtime-Optionen ist in
|
||||||
|
[PLAN.md](PLAN.md) dokumentiert.
|
||||||
|
- **IDE im Terminal**: Nachbildung der klassischen DOS-IDE mit Editor,
|
||||||
|
Formular-Designer, Direktfenster und Debugger.
|
||||||
|
|
||||||
|
## Aufbau des Workspace
|
||||||
|
|
||||||
|
| Crate | Inhalt |
|
||||||
|
|---|---|
|
||||||
|
| `tb-frontend` | Lexer, Parser, AST, semantische Analyse |
|
||||||
|
| `tb-vm` | Bytecode-Format, Codegenerator, virtuelle Maschine (TBVM) |
|
||||||
|
| `tb-runtime` | Laufzeitbibliothek: Strings, Mathematik, Datei-E/A, Datum/Zeit, Fehlercodes |
|
||||||
|
| `tb-ui` | Textbildschirm-Emulation und Forms-Engine auf Ratatui |
|
||||||
|
| `tb-cli` | `tbdosc`: Standalone-Compiler — wandelt Quellen und Projekte in binäre Ergebnisse um |
|
||||||
|
| `tb-ide` | `tbdos`: die integrierte Entwicklungsumgebung (TUI) zum Erstellen von Programmen |
|
||||||
|
|
||||||
|
## Status
|
||||||
|
|
||||||
|
Projektrahmen. Die Implementierungs- und Explorationsschritte sind in
|
||||||
|
[PLAN.md](PLAN.md) beschrieben; dort wird der Fortschritt fortgeschrieben.
|
||||||
|
|
||||||
|
## Bauen
|
||||||
|
|
||||||
|
```
|
||||||
|
cargo build
|
||||||
|
cargo run -p tb-cli # tbdosc — Standalone-Compiler
|
||||||
|
cargo run -p tb-ide # tbdos — IDE (TUI)
|
||||||
|
```
|
||||||
|
|
||||||
|
Benötigt wird nur eine aktuelle stabile Rust-Toolchain.
|
||||||
18
crates/tb-cli/Cargo.toml
Normal file
18
crates/tb-cli/Cargo.toml
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
[package]
|
||||||
|
name = "tb-cli"
|
||||||
|
description = "Terminal Basic: Standalone-Kommandozeilen-Compiler (tbdosc)"
|
||||||
|
version.workspace = true
|
||||||
|
edition.workspace = true
|
||||||
|
license.workspace = true
|
||||||
|
authors.workspace = true
|
||||||
|
|
||||||
|
[[bin]]
|
||||||
|
name = "tbdosc"
|
||||||
|
path = "src/main.rs"
|
||||||
|
|
||||||
|
[dependencies]
|
||||||
|
tb-frontend.workspace = true
|
||||||
|
tb-vm.workspace = true
|
||||||
|
tb-runtime.workspace = true
|
||||||
|
tb-ui.workspace = true
|
||||||
|
anyhow.workspace = true
|
||||||
13
crates/tb-cli/src/main.rs
Normal file
13
crates/tb-cli/src/main.rs
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
//! `tbdosc` — Standalone-Compiler von Terminal Basic.
|
||||||
|
//!
|
||||||
|
//! Wandelt Quelldateien und Projekte in binäre Ergebnisse (`.tbc`-Bytecode
|
||||||
|
//! bzw. eigenständig ausführbare Programme) um. Geplante Unterbefehle
|
||||||
|
//! (siehe PLAN.md):
|
||||||
|
//! - `tbdosc build <projekt|datei.bas>` Kompilieren zu binärem Ergebnis
|
||||||
|
//! - `tbdosc run <datei.bas>` Kompilieren und sofort ausführen
|
||||||
|
//! - `tbdosc check <datei.bas>` Nur Syntax-/Semantikprüfung
|
||||||
|
|
||||||
|
fn main() -> anyhow::Result<()> {
|
||||||
|
println!("tbdosc — Terminal Basic Compiler (Projektrahmen, noch ohne Funktion)");
|
||||||
|
Ok(())
|
||||||
|
}
|
||||||
11
crates/tb-frontend/Cargo.toml
Normal file
11
crates/tb-frontend/Cargo.toml
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
[package]
|
||||||
|
name = "tb-frontend"
|
||||||
|
description = "Terminal Basic: Lexer, Parser, AST und semantische Analyse"
|
||||||
|
version.workspace = true
|
||||||
|
edition.workspace = true
|
||||||
|
license.workspace = true
|
||||||
|
authors.workspace = true
|
||||||
|
|
||||||
|
[dependencies]
|
||||||
|
thiserror.workspace = true
|
||||||
|
log.workspace = true
|
||||||
4
crates/tb-frontend/src/ast.rs
Normal file
4
crates/tb-frontend/src/ast.rs
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
//! AST-Definitionen: Module, Prozeduren (`SUB`/`FUNCTION`), Anweisungen, Ausdrücke,
|
||||||
|
//! benutzerdefinierte Typen (`TYPE … END TYPE`), Deklarationen.
|
||||||
|
|
||||||
|
// Platzhalter — wird in Phase 1 ausgearbeitet (siehe PLAN.md)
|
||||||
13
crates/tb-frontend/src/lexer.rs
Normal file
13
crates/tb-frontend/src/lexer.rs
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
//! Lexer: zerlegt Quelltext in Tokens.
|
||||||
|
//!
|
||||||
|
//! Besonderheiten des BASIC-Dialekts, die hier abgebildet werden müssen:
|
||||||
|
//! - Typ-Suffixe an Bezeichnern und Literalen (`%`, `&`, `!`, `#`, `$`, `@`)
|
||||||
|
//! - Zeilennummern und Labels
|
||||||
|
//! - Keywords sind case-insensitiv, der Editor normalisiert später auf Großschreibung
|
||||||
|
//! - Fortsetzung/Trennung von Anweisungen mit `:` und Kommentare mit `'` und `REM`
|
||||||
|
|
||||||
|
#[derive(Debug, Clone, PartialEq)]
|
||||||
|
pub enum Token {
|
||||||
|
// Platzhalter — wird in Phase 1 ausgearbeitet (siehe PLAN.md)
|
||||||
|
Eof,
|
||||||
|
}
|
||||||
17
crates/tb-frontend/src/lib.rs
Normal file
17
crates/tb-frontend/src/lib.rs
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
//! Frontend des Terminal-Basic-Compilers.
|
||||||
|
//!
|
||||||
|
//! Enthält Lexer, Parser, AST-Definitionen und die semantische Analyse
|
||||||
|
//! (Symboltabellen, Typprüfung, implizite Deklarationen, `DEFINT`-Regeln usw.).
|
||||||
|
//! Ausgabe des Frontends ist ein typgeprüfter AST bzw. eine Zwischen-
|
||||||
|
//! repräsentation (IR), die von `tb-vm` in Bytecode übersetzt wird.
|
||||||
|
|
||||||
|
pub mod lexer;
|
||||||
|
pub mod parser;
|
||||||
|
pub mod ast;
|
||||||
|
|
||||||
|
/// Quelltextposition für Diagnostik (1-basiert, wie im klassischen IDE-Vorbild).
|
||||||
|
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
|
||||||
|
pub struct SourcePos {
|
||||||
|
pub line: u32,
|
||||||
|
pub column: u32,
|
||||||
|
}
|
||||||
6
crates/tb-frontend/src/parser.rs
Normal file
6
crates/tb-frontend/src/parser.rs
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
//! Parser: baut aus dem Tokenstrom den AST.
|
||||||
|
//!
|
||||||
|
//! Der Parser arbeitet zeilenorientiert (eine logische Zeile = eine oder mehrere
|
||||||
|
//! Anweisungen), wie es das IDE-Vorbild mit seiner Zeile-für-Zeile-Prüfung tut.
|
||||||
|
|
||||||
|
// Platzhalter — wird in Phase 1 ausgearbeitet (siehe PLAN.md)
|
||||||
20
crates/tb-ide/Cargo.toml
Normal file
20
crates/tb-ide/Cargo.toml
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
[package]
|
||||||
|
name = "tb-ide"
|
||||||
|
description = "Terminal Basic: integrierte Entwicklungsumgebung im Terminal"
|
||||||
|
version.workspace = true
|
||||||
|
edition.workspace = true
|
||||||
|
license.workspace = true
|
||||||
|
authors.workspace = true
|
||||||
|
|
||||||
|
[[bin]]
|
||||||
|
name = "tbdos"
|
||||||
|
path = "src/main.rs"
|
||||||
|
|
||||||
|
[dependencies]
|
||||||
|
tb-frontend.workspace = true
|
||||||
|
tb-vm.workspace = true
|
||||||
|
tb-runtime.workspace = true
|
||||||
|
tb-ui.workspace = true
|
||||||
|
ratatui.workspace = true
|
||||||
|
crossterm.workspace = true
|
||||||
|
anyhow.workspace = true
|
||||||
11
crates/tb-ide/src/main.rs
Normal file
11
crates/tb-ide/src/main.rs
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
//! `tbdos` — die integrierte Entwicklungsumgebung von Terminal Basic (TUI).
|
||||||
|
//!
|
||||||
|
//! Nachbildung der klassischen DOS-IDE: Menüleiste, Editor mit
|
||||||
|
//! Syntaxprüfung pro Zeile, Formular-Designer, Direktfenster,
|
||||||
|
//! Debugger (Einzelschritt, Breakpoints, Überwachungsausdrücke).
|
||||||
|
//! Siehe PLAN.md, Phase 5.
|
||||||
|
|
||||||
|
fn main() -> anyhow::Result<()> {
|
||||||
|
println!("tbdos — Terminal Basic IDE (Projektrahmen, noch ohne Funktion)");
|
||||||
|
Ok(())
|
||||||
|
}
|
||||||
11
crates/tb-runtime/Cargo.toml
Normal file
11
crates/tb-runtime/Cargo.toml
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
[package]
|
||||||
|
name = "tb-runtime"
|
||||||
|
description = "Terminal Basic: Laufzeitbibliothek (Strings, Mathematik, Datei-E/A, Datum/Zeit)"
|
||||||
|
version.workspace = true
|
||||||
|
edition.workspace = true
|
||||||
|
license.workspace = true
|
||||||
|
authors.workspace = true
|
||||||
|
|
||||||
|
[dependencies]
|
||||||
|
thiserror.workspace = true
|
||||||
|
log.workspace = true
|
||||||
3
crates/tb-runtime/src/datetime.rs
Normal file
3
crates/tb-runtime/src/datetime.rs
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
//! Datums- und Zeitfunktionen der Laufzeitbibliothek.
|
||||||
|
|
||||||
|
// Platzhalter — wird in Phase 3 ausgearbeitet (siehe PLAN.md)
|
||||||
4
crates/tb-runtime/src/errors.rs
Normal file
4
crates/tb-runtime/src/errors.rs
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
//! Laufzeitfehler: Codes und Meldungstexte kompatibel zum Vorbild
|
||||||
|
//! (z. B. 6 = Overflow, 9 = Subscript out of range, 53 = File not found).
|
||||||
|
|
||||||
|
// Platzhalter — wird in Phase 3 ausgearbeitet (siehe PLAN.md)
|
||||||
3
crates/tb-runtime/src/fileio.rs
Normal file
3
crates/tb-runtime/src/fileio.rs
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
//! Datei-E/A der Laufzeitbibliothek (sequenziell, Random Access, binär).
|
||||||
|
|
||||||
|
// Platzhalter — wird in Phase 3 ausgearbeitet (siehe PLAN.md)
|
||||||
11
crates/tb-runtime/src/lib.rs
Normal file
11
crates/tb-runtime/src/lib.rs
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
//! Laufzeitbibliothek von Terminal Basic.
|
||||||
|
//!
|
||||||
|
//! Implementiert die eingebauten Funktionen und Anweisungen des Dialekts,
|
||||||
|
//! gruppiert nach Themen. Ziel ist verhaltensgleiche Nachbildung inklusive
|
||||||
|
//! Rundungs-, Formatierungs- und Fehlerverhalten (siehe PLAN.md, Phase 3).
|
||||||
|
|
||||||
|
pub mod strings; // LEFT$, MID$, INSTR, STR$, VAL, Formatierung mit PRINT USING …
|
||||||
|
pub mod math; // Arithmetik, Rundung (Banker's Rounding), RND/RANDOMIZE …
|
||||||
|
pub mod fileio; // OPEN/CLOSE/PRINT#/INPUT#/GET/PUT, sequenziell/random/binär
|
||||||
|
pub mod datetime; // DATE$, TIME$, TIMER
|
||||||
|
pub mod errors; // Laufzeitfehler-Codes und -Meldungen des Vorbilds
|
||||||
3
crates/tb-runtime/src/math.rs
Normal file
3
crates/tb-runtime/src/math.rs
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
//! Mathematische Funktionen der Laufzeitbibliothek.
|
||||||
|
|
||||||
|
// Platzhalter — wird in Phase 3 ausgearbeitet (siehe PLAN.md)
|
||||||
3
crates/tb-runtime/src/strings.rs
Normal file
3
crates/tb-runtime/src/strings.rs
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
//! String-Funktionen der Laufzeitbibliothek.
|
||||||
|
|
||||||
|
// Platzhalter — wird in Phase 3 ausgearbeitet (siehe PLAN.md)
|
||||||
13
crates/tb-ui/Cargo.toml
Normal file
13
crates/tb-ui/Cargo.toml
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
[package]
|
||||||
|
name = "tb-ui"
|
||||||
|
description = "Terminal Basic: Bildschirm-Runtime und Forms-Engine auf Ratatui"
|
||||||
|
version.workspace = true
|
||||||
|
edition.workspace = true
|
||||||
|
license.workspace = true
|
||||||
|
authors.workspace = true
|
||||||
|
|
||||||
|
[dependencies]
|
||||||
|
ratatui.workspace = true
|
||||||
|
crossterm.workspace = true
|
||||||
|
thiserror.workspace = true
|
||||||
|
log.workspace = true
|
||||||
5
crates/tb-ui/src/events.rs
Normal file
5
crates/tb-ui/src/events.rs
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
//! Ereignismodell: Abbildung von Terminal-Ereignissen (crossterm) auf die
|
||||||
|
//! Ereignisse des Dialekts (Click, GotFocus, KeyPress, Load, Unload …)
|
||||||
|
//! und die Ereigniswarteschlange für die VM-Hauptschleife.
|
||||||
|
|
||||||
|
// Platzhalter — wird in Phase 4 ausgearbeitet (siehe PLAN.md)
|
||||||
6
crates/tb-ui/src/forms.rs
Normal file
6
crates/tb-ui/src/forms.rs
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
//! Forms-Engine: Formulare, Steuerelemente, Eigenschaften, Methoden.
|
||||||
|
//!
|
||||||
|
//! Ziel ist volle Kompatibilität zum Forms-Modell des Vorbilds inklusive
|
||||||
|
//! des textbasierten Formular-Dateiformats (`.FRM`).
|
||||||
|
|
||||||
|
// Platzhalter — wird in Phase 4 ausgearbeitet (siehe PLAN.md)
|
||||||
13
crates/tb-ui/src/lib.rs
Normal file
13
crates/tb-ui/src/lib.rs
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
//! Bildschirm-Runtime und Forms-Engine von Terminal Basic, aufbauend auf Ratatui.
|
||||||
|
//!
|
||||||
|
//! Zwei Schichten:
|
||||||
|
//! 1. `screen`: Emulation des 80×25-Textbildschirms (Codepage 437, 16 Farben,
|
||||||
|
//! Cursor) als Zeichenpuffer, gerendert über Ratatui. Darauf setzen die
|
||||||
|
//! klassischen Anweisungen `PRINT`, `LOCATE`, `COLOR`, `CLS`, `INPUT` auf.
|
||||||
|
//! 2. `forms`: ereignisgesteuerte Forms-Engine — Fenster, Steuerelemente
|
||||||
|
//! (Schaltflächen, Textfelder, Listen …), Menüs, Fokusreihenfolge,
|
||||||
|
//! Tastatur- und Mausereignisse.
|
||||||
|
|
||||||
|
pub mod screen;
|
||||||
|
pub mod forms;
|
||||||
|
pub mod events;
|
||||||
4
crates/tb-ui/src/screen.rs
Normal file
4
crates/tb-ui/src/screen.rs
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
//! Textbildschirm-Emulation: Zellenpuffer (Zeichen + Attribut), Cursor,
|
||||||
|
//! Codepage-437-Abbildung auf Unicode, Rendering über Ratatui.
|
||||||
|
|
||||||
|
// Platzhalter — wird in Phase 0/3 ausgearbeitet (siehe PLAN.md)
|
||||||
12
crates/tb-vm/Cargo.toml
Normal file
12
crates/tb-vm/Cargo.toml
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
[package]
|
||||||
|
name = "tb-vm"
|
||||||
|
description = "Terminal Basic: Bytecode-Definition, Codegenerator und virtuelle Maschine"
|
||||||
|
version.workspace = true
|
||||||
|
edition.workspace = true
|
||||||
|
license.workspace = true
|
||||||
|
authors.workspace = true
|
||||||
|
|
||||||
|
[dependencies]
|
||||||
|
tb-frontend.workspace = true
|
||||||
|
thiserror.workspace = true
|
||||||
|
log.workspace = true
|
||||||
3
crates/tb-vm/src/bytecode.rs
Normal file
3
crates/tb-vm/src/bytecode.rs
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
//! Bytecode-Format der TBVM: Opcodes, Konstantenpool, Modul-/Prozedurtabellen.
|
||||||
|
|
||||||
|
// Platzhalter — wird in Phase 2 ausgearbeitet (siehe PLAN.md)
|
||||||
3
crates/tb-vm/src/codegen.rs
Normal file
3
crates/tb-vm/src/codegen.rs
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
//! Codegenerator: übersetzt den typgeprüften AST aus `tb-frontend` in TBVM-Bytecode.
|
||||||
|
|
||||||
|
// Platzhalter — wird in Phase 2 ausgearbeitet (siehe PLAN.md)
|
||||||
6
crates/tb-vm/src/interp.rs
Normal file
6
crates/tb-vm/src/interp.rs
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
//! Interpreterschleife der TBVM.
|
||||||
|
//!
|
||||||
|
//! Läuft kooperativ: die Ausführung kann an Anweisungsgrenzen angehalten werden
|
||||||
|
//! (Debugger, Ereignisverarbeitung der Forms-Engine, Strg+Untbr).
|
||||||
|
|
||||||
|
// Platzhalter — wird in Phase 2 ausgearbeitet (siehe PLAN.md)
|
||||||
13
crates/tb-vm/src/lib.rs
Normal file
13
crates/tb-vm/src/lib.rs
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
//! Virtuelle Maschine für Terminal Basic (TBVM).
|
||||||
|
//!
|
||||||
|
//! Eigene Stack-basierte Bytecode-VM (Entscheidung siehe PLAN.md, Abschnitt
|
||||||
|
//! „VM-/Runtime-Optionen"). Kernanforderungen:
|
||||||
|
//! - Serialisierbares Bytecode-Format (`.tbc`) als Compiler-Ziel
|
||||||
|
//! - Unterbrechbar/wiederaufnehmbar für Debugger (Einzelschritt, Breakpoints)
|
||||||
|
//! und für die ereignisgesteuerte Forms-Hauptschleife
|
||||||
|
//! - BASIC-Fehlersemantik (`ON ERROR GOTO`, `RESUME`, `ERR`/`ERL`)
|
||||||
|
//! - `GOSUB`/`RETURN` neben regulären Prozeduraufrufen
|
||||||
|
|
||||||
|
pub mod bytecode;
|
||||||
|
pub mod codegen;
|
||||||
|
pub mod interp;
|
||||||
Reference in New Issue
Block a user