summaryrefslogtreecommitdiff
path: root/Notes
diff options
context:
space:
mode:
authorJohn Hodge <tpg@ucc.asn.au>2019-11-02 11:03:51 +0800
committerJohn Hodge <tpg@ucc.asn.au>2019-11-02 11:03:51 +0800
commitb60a84ffbb31809bed57664dc0e8a90d632213ad (patch)
treee0ccf33abe8812939ef2063e64d6ffd86bed3dfc /Notes
parentd73beca6906a014370551e5de95f9b56538c45dc (diff)
downloadmrust-b60a84ffbb31809bed57664dc0e8a90d632213ad.tar.gz
standalone_miri - Notes and experimental (unused) implementation of abstract FFI layer
Diffstat (limited to 'Notes')
-rw-r--r--Notes/SMiri-GenericFfi.md46
1 files changed, 46 insertions, 0 deletions
diff --git a/Notes/SMiri-GenericFfi.md b/Notes/SMiri-GenericFfi.md
new file mode 100644
index 00000000..d43b44ad
--- /dev/null
+++ b/Notes/SMiri-GenericFfi.md
@@ -0,0 +1,46 @@
+Problem description:
+====================
+
+There's a collection of hard-coded FFI hooks in `miri.cpp` to handle both API
+rules (e.g. that the `write` syscall takes a count and a buffer of at least
+that valid size) and wrapping non-trivial or dangerous calls (e.g. the pthread
+ones).
+
+
+It would be more useful to have a runtime description/encoding of these APIs
+that runs safety checks and handles the magic.
+
+
+Requirements
+============
+
+- Validity checks (pointer validity, tags)
+ - These checks should provide useful error messages
+- Returned allocation tagging (valid size, opaque tags)
+ - Some returned allocations can be complex
+- Completely re-definining operations
+ - E.g. replacing pthread APIs with checked versions
+
+
+
+Design Ideas
+============
+
+Raw MIR?
+-------
+- Downside: How would it differ from actual MIR?
+
+
+Basic-alike instruction sequence
+--------------------------------
+- All lines start with a keyword
+ - `ASSIGN`
+ - `LET`
+ - `CALL`
+
+
+Simplified rust-ish language
+----------------------------
+- Basic type inference (uni-directional)
+- Full AST
+