google / google/codeworld

Prelude replacement by hash

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

Beschreibung

Documenting an idea that came up in discussion with @alphalambda.

In some cases, one wants to give students a different prelude: either to add more primitives, to restrict them, or some combination of those. For these cases, it would be interesting to let teachers implement their own custom prelude within CodeWorld itself. Then there'd be an option to `/compile` on the CodeWorld server that specifies a hash for the custom prelude. This would work similar to import-by-hash, except that the specified hash would be renamed to Prelude. The custom Prelude itself would be implemented with `PackageImports`. I've tested, and GHC will prefer a module named Prelude defined on the command line for the implicit prelude, while still allowing that module to import a Prelude explicitly from the package database.

The UI is a bit tricky. The original idea was to make this part of a UI for more guided activities that implement custom clients for the `/compile` API endpoint. That wouldn't be hard to support. But to select such a custom prelude in the main CodeWorld editor would need some extra UI complexity.

Beitragsleitfaden

Beitragsleitfaden öffnen

Rechercherichtung

Start by tracing the /compile API and its existing import-by-hash behavior, then review how PackageImports and the main CodeWorld editor handle Prelude selection. The work is done when a custom prelude can be selected by hash, renamed to Prelude for compilation, and the intended UI or guided-client path is defined.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
haskell
Bereich
api, frontend
Issue-Typ
Feature
Schwierigkeit
5/5
Geschätzter Aufwand
Über eine Woche
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
25/100

Neue Issues direkt in Ihr Postfach

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