google / google/codeworld

Main-by-hash

Offen
#1,296 3 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
enhancement
Vorherrschende Sprache
Haskell
Sterne
1.3k
Forks
201
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

Per discussion with @alphalambda

In the spirit of import-by-hash (#1195) and prelude-by-hash (#1245), it would be interesting to define main-by-hash. In this mode, the compiler would pass a `--main-is` option to GHC that points to something else besides the student code (which is in module `Main`). That something else could import `Main`, but define its own entry point that calls the student code.

There's one problem: if student code lacks a module header (as it usually does), then GHC interprets this to mean only export the `main` (or `program` in codeworld mode) symbol. So naively, student code would need to have a module header, and that's a heavy enough impediment to sink the feature.

Option 1: Convince GHC to add an option to change the interpretation of missing module headers. It would be an easy change, but maybe not easy to convince GHC developers of the importance.

Option 2: Rewrite student code to have an explicit module header. Rewriting student code has never been done before, though, because it makes it hard to match error messages in the compiled code to the correct location in the input.

For now, this is a low priority.

Beitragsleitfaden

Beitragsleitfaden öffnen

Rechercherichtung

Lies zunächst die verwandten Issues import-by-hash (#1195) und prelude-by-hash (#1245), und untersuche anschließend das Verhalten von GHCs --main-is für Studentencode ohne Modul-Header. Als abgeschlossen gilt die Aufgabe, wenn ein Ansatz ausgewählt wurde, der einen separaten Einstiegspunkt unterstützt und gleichzeitig genaue Positionen der Quellcodefehler beibehält.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
haskell
Bereich
compilers
Issue-Typ
Feature
Schwierigkeit
5/5
Geschätzter Aufwand
Über eine Woche
Aktivitätsstatus
Veraltet
Klarheit
Muss geklärt werden
Anfängerfreundlichkeit
25/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.