3 ms·
My dream for a language is a type system that can enforce runtime semantics, preferably at import. import 'mod::memcmp': O(1); where O(1) is big O notation.
by nwmcsween 9y ago
My dream for a language is a type system that can enforce runtime semantics, preferably at import.
import 'mod::memcmp': O(1);
where O(1) is big O notation.
- mrkgnao 9y agohttps://en.wikipedia.org/wiki/Hume_(programming_language) https://en.wikipedia.org/wiki/Hume_(programming_language)
- adrianN 9y agoThat would be a very restrictive programming environment, or type checking might fail or produce ridiculously large runtime bounds. It is not decidable whether a given Turing machine has runtime O(n^k) for a particular k, even if you're given the promise that such a k exists.
- tmzt 9y agoCould you make it an attribute of the symbol being exported, part of the contract, and use that to derive an estimated cost of the program? I could see this being used to choose between allocators or schedulers given specific requirements.