4 ms·
> Resource bounded languages such as Hume, which allow better analysis and implementation techniques by restricting how expressive the language is. Hume seems
by 7373737373 6y ago
> Resource bounded languages such as Hume, which allow better analysis and implementation techniques by restricting how expressive the language is.
Hume seems to use a finite state machine and recursive functions as its "substrate": https://www.macs.hw.ac.uk/~greg/hume/ https://www.macs.hw.ac.uk/~greg/hume/
There's a more intuitive way: In a virtual machine interpreter loop, increase a value (commonly called "gas") at every instruction step (or each block of instructions). Different instructions can have different costs.
The Ethereum Virtual Machine (EVM) uses this for example: https://blockgeeks.com/guides/ethereum-gas/ https://blockgeeks.com/guides/ethereum-gas/
Stackless Python as well: https://stackless.readthedocs.io/en/latest/library/stackless/pickling.html https://stackless.readthedocs.io/en/latest/library/stackless...
This can even work recursively: https://esolangs.org/wiki/RarVM https://esolangs.org/wiki/RarVM