unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: Christine Lemmer-Webber <cwebber@dustycloud.org>
To: jgart <jgart@dismail.de>
Cc: 58898@debbugs.gnu.org
Subject: [bug#58898] [PATCH v4] gnu: Add carp.
Date: Sun, 30 Oct 2022 13:18:22 -0400	[thread overview]
Message-ID: <875yg1jkjs.fsf@dustycloud.org> (raw)
In-Reply-To: <20221030163024.2244-1-jgart@dismail.de>

Thanks!  It does compile and install.  I haven't figured out to how to
use it meaningfully though... 

Here's what happens to me:

cwebber@chicory:~/devel/guix$ carp
Welcome to Carp 0.5.5
This is free software with ABSOLUTELY NO WARRANTY.
Evaluate (help) for more information.
> (defn double [x]
    (* x 2))
(> 
> (double 2)
In file included from out/main.c:20:
/gnu/store/0xhn0vyjlcb2dv1h2333vhbj7j1vvrr6-carp-0.5.5-checkout/core/carp_long.h:90:5: error: 
      implicit declaration of function 'srand' is invalid in C99
      [-Werror,-Wimplicit-function-declaration]
    srand(seed);
    ^
/gnu/store/0xhn0vyjlcb2dv1h2333vhbj7j1vvrr6-carp-0.5.5-checkout/core/carp_long.h:90:5: note: 
      did you mean 'rand'?
/home/cwebber/.guix-profile/include/stdlib.h:52:5: note: 'rand' declared here
int rand (void);
    ^
In file included from out/main.c:21:
/gnu/store/0xhn0vyjlcb2dv1h2333vhbj7j1vvrr6-carp-0.5.5-checkout/core/carp_double.h:1:29: error: 
      use of undeclared identifier 'DBL_MAX'
const double CARP_DBL_MAX = DBL_MAX;
                            ^
/gnu/store/0xhn0vyjlcb2dv1h2333vhbj7j1vvrr6-carp-0.5.5-checkout/core/carp_double.h:68:12: error: 
      implicitly declaring library function 'acos' with type 'double (double)'
      [-Werror,-Wimplicit-function-declaration]
    return acos(x);
           ^
/gnu/store/0xhn0vyjlcb2dv1h2333vhbj7j1vvrr6-carp-0.5.5-checkout/core/carp_double.h:68:12: note: 
      include the header <math.h> or explicitly provide a declaration for 'acos'
/gnu/store/0xhn0vyjlcb2dv1h2333vhbj7j1vvrr6-carp-0.5.5-checkout/core/carp_double.h:72:12: error: 
      implicitly declaring library function 'asin' with type 'double (double)'
      [-Werror,-Wimplicit-function-declaration]
    return asin(x);
           ^
/gnu/store/0xhn0vyjlcb2dv1h2333vhbj7j1vvrr6-carp-0.5.5-checkout/core/carp_double.h:72:12: note: 
      include the header <math.h> or explicitly provide a declaration for 'asin'
/gnu/store/0xhn0vyjlcb2dv1h2333vhbj7j1vvrr6-carp-0.5.5-checkout/core/carp_double.h:76:12: error: 
      implicitly declaring library function 'atan' with type 'double (double)'
      [-Werror,-Wimplicit-function-declaration]
    return atan(x);
           ^
/gnu/store/0xhn0vyjlcb2dv1h2333vhbj7j1vvrr6-carp-0.5.5-checkout/core/carp_double.h:76:12: note: 
      include the header <math.h> or explicitly provide a declaration for 'atan'
/gnu/store/0xhn0vyjlcb2dv1h2333vhbj7j1vvrr6-carp-0.5.5-checkout/core/carp_double.h:88:12: error: 
      implicitly declaring library function 'cosh' with type 'double (double)'
      [-Werror,-Wimplicit-function-declaration]
    return cosh(x);
           ^
/gnu/store/0xhn0vyjlcb2dv1h2333vhbj7j1vvrr6-carp-0.5.5-checkout/core/carp_double.h:88:12: note: 
      include the header <math.h> or explicitly provide a declaration for 'cosh'
/gnu/store/0xhn0vyjlcb2dv1h2333vhbj7j1vvrr6-carp-0.5.5-checkout/core/carp_double.h:96:12: error: 
      implicitly declaring library function 'sinh' with type 'double (double)'
      [-Werror,-Wimplicit-function-declaration]
    return sinh(x);
           ^
/gnu/store/0xhn0vyjlcb2dv1h2333vhbj7j1vvrr6-carp-0.5.5-checkout/core/carp_double.h:96:12: note: 
      include the header <math.h> or explicitly provide a declaration for 'sinh'
/gnu/store/0xhn0vyjlcb2dv1h2333vhbj7j1vvrr6-carp-0.5.5-checkout/core/carp_double.h:100:12: error: 
      implicitly declaring library function 'tanh' with type 'double (double)'
      [-Werror,-Wimplicit-function-declaration]
    return tanh(x);
           ^
/gnu/store/0xhn0vyjlcb2dv1h2333vhbj7j1vvrr6-carp-0.5.5-checkout/core/carp_double.h:100:12: note: 
      include the header <math.h> or explicitly provide a declaration for 'tanh'
/gnu/store/0xhn0vyjlcb2dv1h2333vhbj7j1vvrr6-carp-0.5.5-checkout/core/carp_double.h:108:12: error: 
      implicitly declaring library function 'frexp' with type 'double (double, int *)'
      [-Werror,-Wimplicit-function-declaration]
    return frexp(x, exponent);
           ^
/gnu/store/0xhn0vyjlcb2dv1h2333vhbj7j1vvrr6-carp-0.5.5-checkout/core/carp_double.h:108:12: note: 
      include the header <math.h> or explicitly provide a declaration for 'frexp'
/gnu/store/0xhn0vyjlcb2dv1h2333vhbj7j1vvrr6-carp-0.5.5-checkout/core/carp_double.h:120:12: error: 
      implicitly declaring library function 'log10' with type 'double (double)'
      [-Werror,-Wimplicit-function-declaration]
    return log10(x);
           ^
/gnu/store/0xhn0vyjlcb2dv1h2333vhbj7j1vvrr6-carp-0.5.5-checkout/core/carp_double.h:120:12: note: 
      include the header <math.h> or explicitly provide a declaration for 'log10'
/gnu/store/0xhn0vyjlcb2dv1h2333vhbj7j1vvrr6-carp-0.5.5-checkout/core/carp_double.h:144:12: error: 
      implicitly declaring library function 'fmod' with type 'double (double, double)'
      [-Werror,-Wimplicit-function-declaration]
    return fmod(x, y);
           ^
/gnu/store/0xhn0vyjlcb2dv1h2333vhbj7j1vvrr6-carp-0.5.5-checkout/core/carp_double.h:144:12: note: 
      include the header <math.h> or explicitly provide a declaration for 'fmod'
In file included from out/main.c:22:
/gnu/store/0xhn0vyjlcb2dv1h2333vhbj7j1vvrr6-carp-0.5.5-checkout/core/carp_float.h:1:28: error: 
      use of undeclared identifier 'FLT_MAX'
const float CARP_FLT_MAX = FLT_MAX;
                           ^
/gnu/store/0xhn0vyjlcb2dv1h2333vhbj7j1vvrr6-carp-0.5.5-checkout/core/carp_float.h:47:12: error: 
      implicitly declaring library function 'fabsf' with type 'float (float)'
      [-Werror,-Wimplicit-function-declaration]
    return fabsf(x);
           ^
/gnu/store/0xhn0vyjlcb2dv1h2333vhbj7j1vvrr6-carp-0.5.5-checkout/core/carp_float.h:47:12: note: 
      include the header <math.h> or explicitly provide a declaration for 'fabsf'
/gnu/store/0xhn0vyjlcb2dv1h2333vhbj7j1vvrr6-carp-0.5.5-checkout/core/carp_float.h:51:12: error: 
      implicitly declaring library function 'acosf' with type 'float (float)'
      [-Werror,-Wimplicit-function-declaration]
    return acosf(x);
           ^
/gnu/store/0xhn0vyjlcb2dv1h2333vhbj7j1vvrr6-carp-0.5.5-checkout/core/carp_float.h:51:12: note: 
      include the header <math.h> or explicitly provide a declaration for 'acosf'
/gnu/store/0xhn0vyjlcb2dv1h2333vhbj7j1vvrr6-carp-0.5.5-checkout/core/carp_float.h:55:12: error: 
      implicitly declaring library function 'asinf' with type 'float (float)'
      [-Werror,-Wimplicit-function-declaration]
    return asinf(x);
           ^
/gnu/store/0xhn0vyjlcb2dv1h2333vhbj7j1vvrr6-carp-0.5.5-checkout/core/carp_float.h:55:12: note: 
      include the header <math.h> or explicitly provide a declaration for 'asinf'
/gnu/store/0xhn0vyjlcb2dv1h2333vhbj7j1vvrr6-carp-0.5.5-checkout/core/carp_float.h:59:12: error: 
      implicitly declaring library function 'atanf' with type 'float (float)'
      [-Werror,-Wimplicit-function-declaration]
    return atanf(x);
           ^
/gnu/store/0xhn0vyjlcb2dv1h2333vhbj7j1vvrr6-carp-0.5.5-checkout/core/carp_float.h:59:12: note: 
      include the header <math.h> or explicitly provide a declaration for 'atanf'
/gnu/store/0xhn0vyjlcb2dv1h2333vhbj7j1vvrr6-carp-0.5.5-checkout/core/carp_float.h:63:12: error: 
      implicitly declaring library function 'atan2f' with type 'float (float, float)'
      [-Werror,-Wimplicit-function-declaration]
    return atan2f(y, x);
           ^
/gnu/store/0xhn0vyjlcb2dv1h2333vhbj7j1vvrr6-carp-0.5.5-checkout/core/carp_float.h:63:12: note: 
      include the header <math.h> or explicitly provide a declaration for 'atan2f'
/gnu/store/0xhn0vyjlcb2dv1h2333vhbj7j1vvrr6-carp-0.5.5-checkout/core/carp_float.h:67:12: error: 
      implicitly declaring library function 'cosf' with type 'float (float)'
      [-Werror,-Wimplicit-function-declaration]
    return cosf(x);
           ^
/gnu/store/0xhn0vyjlcb2dv1h2333vhbj7j1vvrr6-carp-0.5.5-checkout/core/carp_float.h:67:12: note: 
      include the header <math.h> or explicitly provide a declaration for 'cosf'
/gnu/store/0xhn0vyjlcb2dv1h2333vhbj7j1vvrr6-carp-0.5.5-checkout/core/carp_float.h:71:12: error: 
      implicitly declaring library function 'coshf' with type 'float (float)'
      [-Werror,-Wimplicit-function-declaration]
    return coshf(x);
           ^
/gnu/store/0xhn0vyjlcb2dv1h2333vhbj7j1vvrr6-carp-0.5.5-checkout/core/carp_float.h:71:12: note: 
      include the header <math.h> or explicitly provide a declaration for 'coshf'
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
carp: callCommand: clang  -o out/Untitled -I /gnu/store/0xhn0vyjlcb2dv1h2333vhbj7j1vvrr6-carp-0.5.5-checkout/core/  -fPIC -g -std=c99 -D_DEFAULT_SOURCE -Wall -Werror -Wno-unused-variable -Wno-self-assign -lm out/main.c (exit 1): failed

Have you had any better luck?

jgart via Guix-patches via <guix-patches@gnu.org> writes:

> * gnu/packages/lisp.scm (carp): New variable.
>
> here's v4. v3 fails ;()
> ---
>  gnu/packages/lisp.scm | 57 +++++++++++++++++++++++++++++++++++++++++++
>  1 file changed, 57 insertions(+)
>
> diff --git a/gnu/packages/lisp.scm b/gnu/packages/lisp.scm
> index 4899943ba8..c7ba84c771 100644
> --- a/gnu/packages/lisp.scm
> +++ b/gnu/packages/lisp.scm
> @@ -55,6 +55,7 @@ (define-module (gnu packages lisp)
>    #:use-module (guix build-system gnu)
>    #:use-module (guix build-system ant)
>    #:use-module (guix build-system asdf)
> +  #:use-module (guix build-system haskell)
>    #:use-module (guix build-system trivial)
>    #:use-module (gnu packages admin)
>    #:use-module (gnu packages base)
> @@ -71,10 +72,14 @@ (define-module (gnu packages lisp)
>    #:use-module (gnu packages gl)
>    #:use-module (gnu packages glib)
>    #:use-module (gnu packages groff)
> +  #:use-module (gnu packages haskell-check)
> +  #:use-module (gnu packages haskell-web)
> +  #:use-module (gnu packages haskell-xyz)
>    #:use-module (gnu packages libffcall)
>    #:use-module (gnu packages libffi)
>    #:use-module (gnu packages libsigsegv)
>    #:use-module (gnu packages linux)
> +  #:use-module (gnu packages llvm)
>    #:use-module (gnu packages m4)
>    #:use-module (gnu packages maths)
>    #:use-module (gnu packages multiprecision)
> @@ -1268,6 +1273,58 @@ (define-public janet
>  assembler, PEG) is less than 1MB.")
>      (license license:expat)))
>  
> +(define-public carp
> +  (package
> +    (name "carp")
> +    (version "0.5.5")
> +    (source
> +     (origin
> +       (method git-fetch)
> +       (uri (git-reference
> +             (url "https://github.com/carp-lang/Carp")
> +             (commit (string-append "v" version))))
> +       (file-name (git-file-name name version))
> +       (sha256
> +        (base32 "14jdnv0ljqvpr9ych1plfw7hp5q57a8j1bv8h3v345x06z783d07"))))
> +    (build-system haskell-build-system)
> +    (arguments
> +      `(#:phases
> +         (modify-phases %standard-phases
> +           ;; Carp looks inside the sources checkout to know where to
> +           ;; find its core libraries and other files.
> +           ;; Carp emits C code and tries to compile it with an external
> +           ;; C compiler. On Linux it defaults to Clang.
> +           (add-after 'install 'set-carp-dir-and-path
> +             (lambda* (#:key inputs outputs #:allow-other-keys)
> +               (let ((out (assoc-ref outputs "out"))
> +                     (sources (assoc-ref inputs "source"))
> +                     (clang (assoc-ref inputs "clang")))
> +                 (wrap-program (string-append out "/bin/carp")
> +                   `("CARP_DIR" = (,sources))
> +                   `("PATH" = (,(string-append clang "/bin"))))
> +                 (wrap-program (string-append out "/bin/carp-header-parse")
> +                   `("CARP_DIR" = (,sources))
> +                   `("PATH" = (,(string-append clang "/bin"))))))))))
> +    (native-inputs (list ghc-hunit))
> +    (inputs (list bash-minimal
> +                  clang
> +                  ghc-blaze-markup
> +                  ghc-blaze-html
> +                  ghc-split
> +                  ghc-ansi-terminal
> +                  ghc-cmark
> +                  ghc-edit-distance
> +                  ghc-hashable
> +                  ghc-open-browser
> +                  ghc-optparse-applicative))
> +    (home-page "https://carp-lang.org/")
> +    (synopsis "Statically typed Lisp without a garbage collector")
> +    (description
> +"@code{carp} is a programming language designed to work well for
> +interactive and performance sensitive use cases like games, sound
> +synthesis and visualizations.")
> +    (license license:asl2.0)))
> +
>  (define-public lisp-repl-core-dumper
>    (package
>      (name "lisp-repl-core-dumper")





  reply	other threads:[~2022-10-30 17:21 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-30 16:02 [bug#58898] [PATCH] gnu: Add carp jgart via Guix-patches via
2022-10-30 16:15 ` [bug#58898] [PATCH v2] " jgart via Guix-patches via
2022-10-30 16:22 ` [bug#58898] [PATCH v3] " jgart via Guix-patches via
2022-10-30 16:30 ` [bug#58898] [PATCH v4] " jgart via Guix-patches via
2022-10-30 17:18   ` Christine Lemmer-Webber [this message]
2022-11-09  2:48     ` jgart via Guix-patches via
2022-10-30 21:38 ` [bug#58898] [PATCH v5] " jgart via Guix-patches via
2022-11-11  5:55 ` [bug#58898] [PATCH v2] " jgart via Guix-patches via
2022-11-11 13:32 ` [bug#58898] [PATCH v7] " jgart via Guix-patches via
2022-11-11 13:37 ` [bug#58898] [PATCH v8] " jgart via Guix-patches via
2022-11-12  9:07 ` bug#58898: [PATCH] " Raghav Gururajan via Guix-patches via

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=875yg1jkjs.fsf@dustycloud.org \
    --to=cwebber@dustycloud.org \
    --cc=58898@debbugs.gnu.org \
    --cc=jgart@dismail.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).