Git Product home page Git Product logo

morty's People

Contributors

mobarski avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

ismael-vc

morty's Issues

Vaporization as heap memory management technique

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 ๐Ÿ˜‰.

Use "restrict" to achieve even higher performance in benchmarks

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?

Convenient syntax for shuffling (incl. removal) of values on the stack

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 ๐Ÿ˜‰.

Parallelism and concurrency

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.).

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.