rhaiscript / rhaiscript/rhai

threads

Open
#36 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

new feature
Dominant language
Rust
Stars
5.7k
Forks
249
Avg merge
1d 14h
Merged PRs (30d)
23

Description

Implement basic threads:

// syntax is a to-do, too, a bit
//spawns a new thread with the identifier 'myname'. Thread names are optional
thread myname {
    stuff1();
    stuff2();
    etc();
}

join myname; //joins a thread, no-op if thread has already finished

let x = 5;
let y = 6;

// captures variables for a thread. Currently unsure if it should actually move them or just copy
// Not really sure about syntax here
thread |x, y| {
    print(x);
    print(y);
}

// all threads are joined when the main script thread is about to finish to prevent threads being stopped unexpectedly

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No implementation files, entry points, or tests are named. Start by reviewing the proposed thread and join syntax, variable-capture semantics, and main-thread shutdown behavior. Done requires settled syntax and semantics plus implementation and tests covering basic spawning, joining, captures, and automatic final joins.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
compilers
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.