pc2 / pc2/sus-compiler

Operators should be defined as modules

Open
#58 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement Language Design
Dominant language
Rust
Stars
126
Forks
6
PR merge metrics
No merged PRs in 30d

Description

Instead of being a compiler builtin, our operators should be defined in a standard library .sus file

The naming scheme is still up in the air, but as an example:

module __add__ #(int MAX_A, int MAX_B) {
  interface __add__ : int #(MAX: MAX_A) a, int #(MAX: MAX_B) b -> int #(MAX: MAX_A+MAX_B)
  /* Implementation is a compiler built-in */
}

That way we also don't need to define the way these bounds evolve in the compiler itself, and thus the user can more easily see what's under the hood.

Contributor guide

Open the contributing guide

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 files, tests, or entry points are identified in the issue. Start by locating the compiler's operator and builtin handling, then inspect how standard library .sus modules are loaded; done means operators are represented through a standard-library module while their implementations remain compiler built-ins and bound evolution is no longer hard-coded there.

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
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.