carp-lang / carp-lang/Carp

Project.config

Open
#898 2 comments 0 reactions 0 assignees View on GitHub
under discussion
Dominant language
Haskell
Stars
6k
Forks
187
Avg merge
8d 22h
Merged PRs (30d)
4

Description

While tinkering with the compiler (related to #889) I've run into a problem : when giving a title to the core library project via
`(Project.config "title" "core")`, the config is propagated to any code loading it (that is any code compiled without the *--no-core" option. It means that any project that does not set it's own project title would end up named "core" instead of "Untitled". In particular, this is a problem for the compiler test suite, which fails because the executable that are ran are not the one expected.

Now, this last issue is not that big, as the fix is simply to not title "core", as was done previously. However this behavior also means that any titled library that is loaded by a user after calling `Project.title` would override the name of the user's project, which may be counter-intuitive.

What I propose is that some or all of a project's config should only be changeable in the project's "main" file (that is the one on which carp is called first when compiling in batch mode, or in the REPL when using it. What do you think ?

Contributor guide

Open the contributing guide

Research direction

Start by examining how Project.config and Project.title propagate settings from loaded libraries, then reproduce the compiler test-suite failure described in the issue. Determine whether project configuration should be limited to the main file; done requires an agreed behavior and passing compiler tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
haskell
Domain
compilers
Issue type
Bug
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.