carp-lang / carp-lang/Carp

Wrap all C stlib functions that return a pointer in a Result type

Open
#617 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

core-libs nice-to-have
Dominant language
Haskell
Stars
6k
Forks
187
Avg merge
8d 22h
Merged PRs (30d)
4

Description

Many C library functions return a null pointer on error, i.e. `malloc` and `fopen`, etc. To make these more safe, their return values should be wrapped in a `Result` type.

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

Start by inventorying the C standard-library functions that return pointers, using malloc and fopen as examples, and identify how Carp represents Result values. Determine the complete wrapper scope and expected error behavior before changing code. Done means every applicable pointer-returning C stdlib function returns a Result rather than exposing a nullable pointer.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.