3 ms·
So for interpreted languages with types that are written in C, how is the engine supposed to tell C it already checked all the arg types manually in the interpr
by jancsika 5mo ago
So for interpreted languages with types that are written in C, how is the engine supposed to tell C it already checked all the arg types manually in the interpreter? In other words: it's safe to go ahead and dereference this function and invoke it with these args.
Seems like C technically requires function declarations for every possible signature. That quickly explodes into hundreds or thousands of function declarations in the header and switch statement.
Edit: clarification
- pizlonator 5mo agoI’ve thought about how to let folks prove to Fil-C that Fil-C’s checks are obviated by some higher level checks. It’s a super hard problem! I don’t have a good answer, but I also can’t prove that it’s impossible
- actionfromafar 5mo agoSomething something compile Fil-C to WASM64?
- pizlonator 5mo agoI don’t see how that would help
- pjmlp 5mo agoI guess it is the imaginary security that WebAssembly advocates tend to sell, without telling the part that linear memory segments don't have bounds checking within their internals.
- codebje 5mo agoIf you have an interpreted language, you don't have a C function corresponding to each language function. You have a C interpreter loop with a "current instruction" pointer. When the current interpreted instruction is a call, you check all the things you need to check, push the current IP to a stack, and set the IP to the first instruction of the function. C's type checker never sees the interpreted language's functions.