mobarski / morty Goto Github PK
View Code? Open in Web Editor NEWMorty programming language, Morty virtual machine and MortyVM assembler
License: GNU General Public License v3.0
Morty programming language, Morty virtual machine and MortyVM assembler
License: GNU General Public License v3.0
I just found this in my stash and thought it might be yet another source of inspiration. I don't have anything specific in mind and just wanted to share it with you ๐.
It's probably too early to look into this, but I'd like to point out an interesting technique which is both simple to implement and has basically no user-level cognitive load associated (unlike ownership stuff like in Rust, unlike manual memory management with realloc()
free()
, unlike garbage collection with manually managed cycles due to weak pointers, etc.).
https://slightknack.dev/blog/vaporization/
The downside is it's not suitable for every language - especially because it needs some compile-time guarantees to work correctly and these might not be offered by Morty - IDK ๐.
I see you're doing plenty of interesting benchmarks. I was thinking that according to my understanding, Morty is pretty much "aliasing-safe" and thus it might greatly benefit from using restrict
(either in the virtual machine itself or in the transpiled Morty to C).
Have you thought about using restrict
?
I like how Morty approaches the "implicit" stack content (with comments in parens). There is one more thing which is verbose in stack languages and at the same time potentially inefficient. Namely shuffling of values on the stack if they're not in the order one needs them.
I was looking for a way how to solve it and found Quark with its stack manipulation syntax.
I think it's worth thinking about making such shuffling easier for the user (actually the fact, that all "functions" in Morty depend on the order of arguments becomes the main driver behind this need).
Another idea would be to not introduce generic stack manipulation syntax, but rather a built-in function with variable number of arguments which would do the shuffling.
Yet another idea would be to simply allow special shuffling syntax only at the place when calling a function. Basically saying "if the function is called without explicit arguments, it behaves like standard combinator, but if it's called with at least one explicit argument it's regarded as these were first popped from the stack and then passed explicitly as arguments (this latter case would allow for compile-time check whether the number of arguments is correct which could improve general app safety).
Btw. there are some other more or less crazy ideas in henrystanley/Quark#2 . Feel free to take a look ๐.
Interesting source of inspiration for easy parallelism (os-level threads) in a concatenative language is Blacklight. It also has built-in support for queued communication between threads and overall it looks quite clean with the concept of three stacks.
Although as it's currently implemented in the VM (which is written in Go lang), each modification (rot, swap, ... incl. any value addition & removal) of either stack requires a mutex lock & unlock. This means pretty slow operation in general. But maybe the clean API can be implemented in a more efficient way (I'm thinking of thread local storage etc.).
Today I accidentally discovered https://github.com/robertmuth/Cwerg . I didn't look into it in much detail, but it seemed there could be some knowledge hidden which morty could leverage.
Feel free to close this issue as it's only informative and has no actionable items.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.