mun icon indicating copy to clipboard operation
mun copied to clipboard

What is the take on error handling, multithreading, etc..

Open codec-abc opened this issue 4 years ago • 5 comments

Hi,

Interesting project you got there.

I, for one, looking for a language that would be a bit like Rust but at a higher level. In other way, I am looking for a language that has no null, explicit error handling (aka no exceptions), and a nice multi-threading story (maybe something like an actor model, at least something that avoid to shoot you in the feet). Bonus point if it can interoperate with Rust easily :)

So, what are the takes of Mun on nullability, error-handling and parallel and async computations?

codec-abc avatar Feb 10 '21 02:02 codec-abc

  • we won't support null, except functions that can check whether an extern C pointer is_null, similar to Rust.
  • we will have explicit error handling, similar to Rust
  • interop with Rust (but through C API) is our main target. Our main focus (i.e. the initial test case) is on Rust bindings, secondary focus is on the C++ bindings

We aren't sure about the multi-threading story yet

Wodann avatar Feb 21 '21 01:02 Wodann

We aren't sure about the multi-threading story yet

For an overview of potential goals, you can check my summary post https://github.com/vlang/v/issues/1868 .

dumblob avatar Feb 21 '21 01:02 dumblob

Thanks for the inspiration, @dumblob. I might be interpreting incorrectly (or adding my own thoughts), but I like the idea of task-based parallellisation. It allows us control over hot reloading of changed tasks, while unchanged tasks can keep running.

A data-driven approach might even allow for restarting of a task, if the task contains its initial state.

Wodann avatar Feb 21 '21 16:02 Wodann

Thanks for taking time to answer me. While we are at it, do you mind elaborating on functional programming and mutability. Looking at the pong example, it seems Mun is pretty standard here, with everything being mutable unless explicitly tell otherwise?

As a side note, feel free to close the issue whenever you want because I know some maintainers wants to keep their issues tidy and this isn't really an issue but rather a discussion.

codec-abc avatar Feb 21 '21 16:02 codec-abc

We went for simplicity on our initial implementation of variables and parameters, but are adding "immutable by default": #305

W.r.t. closing, I missclicked "comment" and hit "close with comment by accident"

Wodann avatar Feb 21 '21 17:02 Wodann