Skip to content
This repository has been archived by the owner on Dec 13, 2021. It is now read-only.

What can I build with arret? #148

Open
colelawrence opened this issue Sep 19, 2019 · 3 comments
Open

What can I build with arret? #148

colelawrence opened this issue Sep 19, 2019 · 3 comments

Comments

@colelawrence
Copy link

colelawrence commented Sep 19, 2019

I came across Arret while experimenting with Tree-Sitter, and I really like the choices you've made in designing Arret.

What are Arret's capabilities in regards to binding to other Rust/C library interfaces? How much work is involved in putting together a web server example?

Cheers.

--- edit ---

I just realized I missed a large part of the documentation regarding RFI in the runtime.
https://rustdoc.arret-lang.org/arret_runtime/index.html

So, it looks like it would be possible I can definitely do more research from here, though.

@etaoins
Copy link
Owner

etaoins commented Sep 20, 2019

Thanks @colelawrence, I've been wondering the same thing myself 😀

While a web server might be possible right now, my focus for the rest of the year is probably going to be on three things:

  1. Implementing core data structures. While I'm happy with Int/Float/Str/Sym/List, Vector is just barely implemented on top of Rust vectors and Map/Set don't make it beyond the parser. I'd like to implement them using something like Clojure's persistent data structures. I've done this previously in C++ so I'll hopefully have an easier go this time.

  2. Working on the asynchronous model. I'd like to support actor-like concurrency on top of function closures but some form of async/await would be nice as well

  3. Pattern matching. This is a nightmare to implement correctly but I love pattern matching too much to not do it.

I work on Arret mostly on the weekends when I have time and kind of meander through what I find interesting at the time. If you have any specific questions/feedback/bug reports/etc. please ask them; that will be a better motivator than boredom!

@colelawrence
Copy link
Author

@etaoins would async/await and/or actor systems be a standard library feature implemented as macros? Thanks for the response!

@etaoins
Copy link
Owner

etaoins commented Sep 25, 2019

For the actor system compiler support should be complete. There's an implicit Task parameter passed to every function that threads through the current Arret task. Right now this is just the garbage collected heap, but once actors are supported this can carry the actor context as well. The unit tests already run multiple Arret tasks concurrently so I'm confident that Arret is essentially thread safe.

The core runtime would need to grow an event loop, primitives for sending messages between actors, etc. which would be exposed at a higher-level by the standard library. This hasn't been started yet but it shouldn't be an immense amount of work.

For async/await I'm planning on doing something similar to what C#/Rust/etc. do where they rewrite async functions to a state machine built on top of a Promise type. I've never done this before so I'm expecting it to be pretty daunting. Hopefully the fact Arret is garbage collected lets it avoid some of the pain Rust has had with async/await.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants