https://github.com/hiperiondev/stack_vm
Generic Stack VM for Scripting Languages
https://github.com/hiperiondev/stack_vm
scripting scripting-language stack virtual-machine vm
Last synced: 4 months ago
JSON representation
Generic Stack VM for Scripting Languages
- Host: GitHub
- URL: https://github.com/hiperiondev/stack_vm
- Owner: hiperiondev
- License: mit
- Created: 2024-04-26T19:04:05.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2024-08-31T00:40:52.000Z (almost 2 years ago)
- Last Synced: 2025-07-01T14:11:31.051Z (11 months ago)
- Topics: scripting, scripting-language, stack, virtual-machine, vm
- Language: C
- Homepage:
- Size: 737 KB
- Stars: 7
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## About The Project
Stack VM is a virtual machine oriented towards scripting languages, especially glue ones, prioritizing low memory consumption and predictability.
It has very useful features for use in microcontrollers such as: Fixed stack size, gc per frame with optional shrink and management of both local variables in the stack and a generic heap.
Functions that are not essential must be implemented through FFI (example: strings) but have the minimum constructs so that the VM can handle them.
Also the use of native data types has generic options for use as well as the definition of external functions to be interpreted within the VM.
## Features
- [x] Fully commented code in Doxygen format
- [x] 6 bits op (easily extendable)
- [x] An indirection register with automatic increment/decrement
- [x] Heap with automatic growth and optional shrink. Allocation management by bit mask (simple and fast)
- [x] Call with frame placement and stack space reservation for local variables
- [x] Heap management per frame with automatic release at the exit of the frame
- [x] Generic data objects in HEAP and static attribute (survive to frame GC)
- [x] Native external data management (via custom function)
- [x] Libraries for custom data types
- [x] Simple external functions (FFI)
- [x] Global variables and arrays allocated in heap
- [x] Can allocate local arrays
- [x] Arrays can contain any type of value, including arrays
- [x] Constants in the program area
- [x] Complete Assembler/Disassembler with directives easily expandable
## Usage
See [Documentation](https://stack-vm.readthedocs.io)
## Roadmap
See the [open issues](https://github.com/hiperiondev/stack_vm/issues) for a full list of proposed features (and known issues).
## Contributing
Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are **greatly appreciated**.
If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement".
Don't forget to give the project a star! Thanks again!
1. Fork it ()
2. Create your feature branch (`git checkout -b feature/fooBar`)
3. Commit your changes (`git commit -am 'Add some fooBar'`)
4. Push to the branch (`git push origin feature/fooBar`)
5. Create a new Pull Request
## License
Distributed under the MIT License. See `LICENSE.txt` for more information.
## Contact
*Emiliano Augusto Gonzalez - egonzalez.hiperion@gmail.com*
Project Link: [https://github.com/hiperiondev/stack_vm](https://github.com/hiperiondev/stack_vm)