From patchwork Wed Sep 7 18:31:47 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Garek Dyszel X-Patchwork-Id: 42276 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 2E54727BBEA; Wed, 7 Sep 2022 19:34:44 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,SPF_HELO_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 626C527BBE9 for ; Wed, 7 Sep 2022 19:34:43 +0100 (BST) Received: from localhost ([::1]:51036 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oVzso-0004vM-Bu for patchwork@mira.cbaines.net; Wed, 07 Sep 2022 14:34:42 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59800) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oVzrC-0003kz-Fs for guix-patches@gnu.org; Wed, 07 Sep 2022 14:33:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:39270) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oVzrC-00056E-5W for guix-patches@gnu.org; Wed, 07 Sep 2022 14:33:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oVzrB-0007vb-RE for guix-patches@gnu.org; Wed, 07 Sep 2022 14:33:01 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#57540] [RFC PATCH v2 01/19] gnu: Add ocaml-elpi. References: <79d544f7d8ba64b631a6f0f1d2ef0b08@disroot.org> In-Reply-To: <79d544f7d8ba64b631a6f0f1d2ef0b08@disroot.org> Resent-From: Garek Dyszel Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 07 Sep 2022 18:33:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 57540 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Julien Lepiller Cc: 57540@debbugs.gnu.org Received: via spool by 57540-submit@debbugs.gnu.org id=B57540.166257552430401 (code B ref 57540); Wed, 07 Sep 2022 18:33:01 +0000 Received: (at 57540) by debbugs.gnu.org; 7 Sep 2022 18:32:04 +0000 Received: from localhost ([127.0.0.1]:56201 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oVzqF-0007uG-Ro for submit@debbugs.gnu.org; Wed, 07 Sep 2022 14:32:04 -0400 Received: from knopi.disroot.org ([178.21.23.139]:52166) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oVzqC-0007ti-Ir for 57540@debbugs.gnu.org; Wed, 07 Sep 2022 14:32:01 -0400 Received: from localhost (localhost [127.0.0.1]) by disroot.org (Postfix) with ESMTP id AAE1549FB1; Wed, 7 Sep 2022 20:31:58 +0200 (CEST) X-Virus-Scanned: SPAM Filter at disroot.org Received: from knopi.disroot.org ([127.0.0.1]) by localhost (disroot.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 0Gi2oDSXmWyU; Wed, 7 Sep 2022 20:31:56 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=disroot.org; s=mail; t=1662575516; bh=jy0rRrWFl0DBgusVuCdqy7pFYKpeiyEucD56ZbboIgY=; h=From:To:Cc:Subject:Date; b=WPLjVg6XrAb45OIQNvJ8FJ0a9JcgXkQy8C5VS1M3uW5Fy6dGlePFOWK8GgPTgWYop VLKU1uPoaZLddKpX7m0iH0eKBK5QS09p0WqE6kJg0Uq/LfApCinm5errottA0PWAmT Ym6AMFmbzzlKoJ+gj8iQOuVHOtwg+v3dVQ1Ecp+x4RfeJ4609o/q9WbQtIwUrQEnSk kvm968Dr4i/IAxBZtn2JSE/JIerpTJLNAsh/O0ggsiJlXoXQhvC9hiIFVeQmDQ4fRr 7nM4sfBJ+YYZl/iS/HfxKyVFj8x6wQ5930/V7Fki4HCkcB1UFOsAfVCBG7QSPAr8Hh SFUq2R1uDh+kg== Date: Wed, 07 Sep 2022 14:31:47 -0400 Message-ID: <87sfl3vxws.fsf@disroot.org> Mime-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" Reply-to: Garek Dyszel X-ACL-Warn: , Garek Dyszel via Guix-patches X-Patchwork-Original-From: Garek Dyszel via Guix-patches via From: Garek Dyszel X-getmail-retrieved-from-mailbox: Patches Hi Julien, Thank you for your thoughtful suggestions! All patches are now split such that each package has its own patch. * Quickies > And then I wonder why you need that at all, if it doesn't change > compilation result? The file src/META.coq-elpi does not exist in the source tree. I changed the comment; hopefully it's less ambiguous now. > Please don't use #t at the end of phases anymore. Thanks for catching this! It's removed. > Instead of replacing this phase, maybe try #:test-target "test-suite" This worked, thanks! > If that means that future versions will have tests (for instance if > master has tests), maybe this should say it more explicitely. It looks like coq-mathcomp-analysis has no tests and no plans to include any tests in the traditional sense. I changed the comment to reflect that. * Other changes For all the ocaml packages, using #:test-target as suggested with the appropriate directory worked. There still remain three packages without tests, but tests were not supplied with those three. I had to add about 10 python packages in order to get the tests for ocaml-atd to pass. Some packages (python-pluggy-1.0, python-jsonschema-4.15, python-setuptools-scm-7) are present already in the Guix tree were required by the ocaml-atd tests. Is there a better way to include those packages without sending this patch through core-updates? Lists should now be formatted with @itemize (assuming I didn't miss any!). We now use git-references for most packages. In cases where git-references were not used, they were python packages. The tests with the PyPi versions passed, but using the git repository for the same package yielded failing tests. * Remaining issues This set of patches still is not ready to be merged; python-hatchling breaks Guix. The upstream hash differed this afternoon from a "guix hash -rx ." run from this morning, though the commit we are building from hasn't changed. The command "pytest -vv" in phase "check" fails with: "ERROR Missing dependencies: pluggy>=1.0.0". It seems that python-pluggy-1.0 built correctly, so maybe it is just not specified correctly in the inputs for python-hatchling? What do you think? Thanks again for the help! Garek * gnu/packages/ocaml.scm (ocaml-elpi): New variable. --- gnu/packages/ocaml.scm | 96 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 96 insertions(+) diff --git a/gnu/packages/ocaml.scm b/gnu/packages/ocaml.scm index 2fd519ca41..c4fa05b934 100644 --- a/gnu/packages/ocaml.scm +++ b/gnu/packages/ocaml.scm @@ -26,6 +26,7 @@ ;;; Copyright © 2021 Sarah Morgensen ;;; Copyright © 2022 Maxim Cournoyer ;;; Copyright © 2022 John Kehayias +;;; Copyright © 2022 Garek Dyszel ;;; ;;; This file is part of GNU Guix. ;;; @@ -8774,3 +8775,98 @@ (define-public ocaml-guile "The OCaml guile library provides high-level OCaml bindings to GNU Guile 3.0, supporting easy interop between OCaml and GNU Guile Scheme.") (license license:gpl3+))) + +(define-public ocaml-elpi + (package + (name "ocaml-elpi") + ;; For more information on which version works with Coq 8.15, + ;; see the relevant issue: + ;; https://github.com/math-comp/hierarchy-builder/issues/297 + ;; Here we use + ;; coq-elpi 1.14.0 + ocaml-elpi 1.15.2 + + ;; coq-mathcomp-hierarchy-builder 1.3.0 (Coq 8.15) + ;; + ;; The package ocaml-elpi@1.16.5 appears to require a different + ;; build process. + (version "1.15.2") + (source (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/LPCIC/elpi") + (commit (string-append "v" version)) + (recursive? #t))) + (file-name (git-file-name name version)) + (sha256 + (base32 + "0swzqabwrxqb6sz8zpild2lfcnk3l0zxi9fw61dy2g1pzws2j2jy")))) + (build-system dune-build-system) + (arguments + `(#:test-target "tests")) + (propagated-inputs (list ocaml-stdlib-shims + ocaml-ppxlib + ocaml-menhir + ocaml-re + ocaml-ppx-deriving + ocaml-atd + ocaml-camlp-streams + ocaml-biniou + ocaml-yojson)) + (native-inputs (list ocaml-ansiterminal ocaml-cmdliner time)) + (home-page "https://github.com/LPCIC/elpi") + (synopsis "ELPI - Embeddable λProlog Interpreter") + (description + "ELPI implements a variant of λProlog enriched with Constraint +Handling Rules, a programming language well suited to manipulate +syntax trees with binders. + +ELPI is designed to be embedded into larger applications written in +OCaml as an extension language. It comes with an API to drive the +interpreter and with an FFI for defining built-in predicates and data +types, as well as quotations and similar goodies that are handy to +adapt the language to the host application. + +This package provides both a command line interpreter (elpi) and a +library to be linked in other applications (eg by passing -package +elpi to ocamlfind). + +The ELPI programming language has the following features: + +@itemize +@item Native support for variable binding and substitution, via an Higher +Order Abstract Syntax (HOAS) embedding of the object language. The +programmer does not need to care about technical devices to handle +bound variables, like De Bruijn indices. + +@item Native support for hypothetical context. When moving under a binder +one can attach to the bound variable extra information that is +collected when the variable gets out of scope. For example when +writing a type-checker the programmer needs not to care about managing +the typing context. + +@item Native support for higher order unification variables, again via +HOAS. Unification variables of the meta-language (λProlog) can be +reused to represent the unification variables of the object language. +The programmer does not need to care about the unification-variable +assignment map and cannot assign to a unification variable a term +containing variables out of scope, or build a circular assignment. + +@item Native support for syntactic constraints and their meta-level +handling rules. The generative semantics of Prolog can be disabled by +turning a goal into a syntactic constraint (suspended goal). A +syntactic constraint is resumed as soon as relevant variables gets +assigned. Syntactic constraints can be manipulated by constraint +handling rules (CHR). + +@item Native support for backtracking. To ease implementation of search. + +@item The constraint store is extensible. The host application can declare +non-syntactic constraints and use custom constraint solvers to check +their consistency. + +@item Clauses are graftable. The user is free to extend an existing +program by inserting/removing clauses, both at runtime (using +implication) and at \"compilation\" time by accumulating files. +@end itemize + +ELPI is free software released under the terms of LGPL 2.1 or above.") + (license license:lgpl2.1)))