Skip to content

Version 3

Fredrik Wieczerkowski requested to merge version3-new into master

This branch contains some work on making KiCS2 run with recent versions of the libraries and the frontend. This includes:

  • Updates to the newtype generation (see !5 (closed) and !7 (merged))
  • Rewriting the Makefiles
  • Using versioned output folders for the compilation artifacts (e.g. .curry/kics2-3.0.0/...)
  • Packaging the compiler for use with CPM and unvendoring most of the dependencies
  • Updating the code generation of contexts and applications (see !4 (closed) for details)
  • Using Stack to build the runtime libraries

Todo:

  • Ensure that basic expressions compile when using the REPL
  • Fix generation of typeclass contexts
  • Re-add the temporarily removed library modules to the Cabal file and make sure they compile (see !7 (merged))
  • Fix newtype generation (see !7 (merged))
  • Find a way of precompiling the runtime packages (kics2-runtime and kics2-libraries) without relying on (legacy) v1-commands from cabal-install (see !8 (merged))
  • Re-add CPM targets (see !9 (merged))
  • Re-add bootstrap targets (see !9 (merged))
  • Fix bug where partially exported higher-order newtypes cause type signatures of nondeterministic (nd_...) functions to be generated incorrectly (using the non-higher-order newtype C_... instead of HO_C_...)
    • This is e.g. the case in CPM.ErrorLogger where the module only exports the type ErrorLogger and the selector function runErrorLogger, however not the newtype constructor ErrorLogger
  • Fix bug where newtypes in higher-order data structures (including typeclass dictionaries) incorrectly use the first-order newtype instead of the higher-order variant. Consider the following example:
newtype X a = X (String -> a)
data D a = D (String -> X a)

D now incorrectly compiles to:

data C_D t0
  = C_D (Curry_Prelude.OP_List Curry_Prelude.C_Char -> Cover -> ConstStore
    -> C_X t0)
  | HO_C_D (Func (Curry_Prelude.OP_List Curry_Prelude.C_Char) (C_X t0))
  | ...

instead of

data C_D t0
  = ...
  | HO_C_D (Func (Curry_Prelude.OP_List Curry_Prelude.C_Char) (HO_C_X t0))
  | ...
Edited by Fredrik Wieczerkowski

Merge request reports