From patchwork Mon Apr 17 00:10:37 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Andy Tai X-Patchwork-Id: 49198 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 7BC4417457; Mon, 17 Apr 2023 01:11:24 +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=-3.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS 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 62C1917435 for ; Mon, 17 Apr 2023 01:11:21 +0100 (BST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1poCSX-0005pt-9O; Sun, 16 Apr 2023 20:11:05 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1poCSV-0005pW-8M for guix-patches@gnu.org; Sun, 16 Apr 2023 20:11:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1poCSU-0008Fh-Rt for guix-patches@gnu.org; Sun, 16 Apr 2023 20:11:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1poCSU-0000Yt-CC for guix-patches@gnu.org; Sun, 16 Apr 2023 20:11:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#62891] [PATCH] gnu: Add quirrel Resent-From: Andy Tai Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 17 Apr 2023 00:11:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 62891 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 62891@debbugs.gnu.org Cc: Andy Tai X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.16816902492136 (code B ref -1); Mon, 17 Apr 2023 00:11:02 +0000 Received: (at submit) by debbugs.gnu.org; 17 Apr 2023 00:10:49 +0000 Received: from localhost ([127.0.0.1]:52703 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1poCSG-0000YO-Pf for submit@debbugs.gnu.org; Sun, 16 Apr 2023 20:10:49 -0400 Received: from lists.gnu.org ([209.51.188.17]:48382) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1poCSE-0000YG-Mv for submit@debbugs.gnu.org; Sun, 16 Apr 2023 20:10:47 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1poCSE-0005os-53 for guix-patches@gnu.org; Sun, 16 Apr 2023 20:10:46 -0400 Received: from mail-pj1-x1034.google.com ([2607:f8b0:4864:20::1034]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1poCSB-0008A5-C1 for guix-patches@gnu.org; Sun, 16 Apr 2023 20:10:45 -0400 Received: by mail-pj1-x1034.google.com with SMTP id f2so15268219pjs.3 for ; Sun, 16 Apr 2023 17:10:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1681690241; x=1684282241; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:sender:from:to:cc:subject:date:message-id:reply-to; bh=pJxSEIoN7TpgjHRNY8hTPTfrcE/gHhpp50dYLk4i3zk=; b=Qh42oxyP7OInzyL5jWx9maOHuxlhBmGMFyF2nshI8PaGRJB6KTUhGiZRwyIEhOMvXM HPhqcMbkAtQVL0hM7r7ma69YN6fDBEfprtSoK0S7eetZ0WgT2RsY1/UR+n6BBXUBYDva wdSN6SndsS+UjCXYQNnNkFBCgdBPnyVeoQi5csvs8iDcM3Uv4o1PZ81Mo0+yYsZjESXM nAEtKf0lbneAbLB6guGCeZBjWlUAp5yPBl5d5U7bXT5AKFLeMHUQISBv3xcD/XfvX/Uw pWuIPbGdq0adQJXg7mF20dE8jHvKsO3gw8Z9r4/+mEWOzdnfySRTFjMAtXXR7bxygjxa D33A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1681690241; x=1684282241; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:sender:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=pJxSEIoN7TpgjHRNY8hTPTfrcE/gHhpp50dYLk4i3zk=; b=WGmq1+tFxxoNUM5t2RnuspS3utZIXTJfSnfB6CkEnG+68zdrP2gswVL7XtxsC7aMEe SYK+8usXssQCZJ0yupFOC6XCt4QF5HSqGg1wzsN/b886fyNlbzb3yj63TR5Ft/k/0f42 8bK7EYwCR+IuTFQPVkwYIVQ2wvUGSwnicUsAqh8QGGer//u40ZbN5avhUgQFLcA74Ynz 4Uf8HE1uPbNDcV3gln7CpVHpoAuU0pzor1XK/ICyilSHMPTjoHdpycf4XnYYu0RYBGhE tbv0TbCmGe2l4OK6npid9GytvVVfWPwzKWp4nVGvIcoHiEV2NnwLjx1t56kCuW98skUA pzNQ== X-Gm-Message-State: AAQBX9eux56e9o8TOjkevIov2mSCO6/BfjaZpZnfdUTKOvDt8ARY7bcL Re7Bkc3NeZrRPYmdYsK7ex1rZvhhkCU= X-Google-Smtp-Source: AKy350Yyv0sdTGErQu0jenjI7PGatk/56jLUs9JgfozqDzqmJAWSRzYx8KYCkTslSUDxf5FZefuOug== X-Received: by 2002:a17:903:1d1:b0:1a6:c12d:9027 with SMTP id e17-20020a17090301d100b001a6c12d9027mr5306663plh.56.1681690240997; Sun, 16 Apr 2023 17:10:40 -0700 (PDT) Received: from localhost.localdomain ([98.37.226.98]) by smtp.googlemail.com with ESMTPSA id kg14-20020a17090b340e00b00246cfdb570asm2785059pjb.27.2023.04.16.17.10.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 16 Apr 2023 17:10:40 -0700 (PDT) From: Andy Tai Date: Sun, 16 Apr 2023 17:10:37 -0700 Message-Id: <20230417001037.6464-1-atai@atai.org> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::1034; envelope-from=lichengtai@gmail.com; helo=mail-pj1-x1034.google.com X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.25, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no autolearn_force=no X-Spam_action: no action 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-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches * gnu/packages/squirrel.scm (quirrel): New variable --- gnu/packages/squirrel.scm | 64 ++++++++++++++++++++++++++++++++++++++- 1 file changed, 63 insertions(+), 1 deletion(-) base-commit: 9a5e1dc1f16f5f8c056e64f2077b035784003673 diff --git a/gnu/packages/squirrel.scm b/gnu/packages/squirrel.scm index 1b9489882f..818f04ebf9 100644 --- a/gnu/packages/squirrel.scm +++ b/gnu/packages/squirrel.scm @@ -1,5 +1,5 @@ ;;; GNU Guix --- Functional package management for GNU -;;; Copyright © 2019 Li-cheng (Andy) Tai +;;; Copyright © 2019, 2023 Li-Cheng (Andy) Tai ;; ;;; This file is part of GNU Guix. ;;; @@ -22,6 +22,7 @@ (define-module (gnu packages squirrel) #:use-module (gnu packages sphinx) #:use-module (guix build-system cmake) #:use-module (guix download) + #:use-module (guix git-download) #:use-module ((guix licenses) #:prefix license:) #:use-module (guix build utils) #:use-module (guix packages) @@ -81,3 +82,64 @@ (define-public squirrel size, memory bandwidth, and real-time requirements of applications like video games.") (license license:expat))) + + + +(define-public quirrel + (package + (name "quirrel") + (version "4.6") + (source (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/GaijinEntertainment/quirrel.git") + (commit "bef3fc5"))) + (file-name (git-file-name name version)) + (sha256 + (base32 + "10pd1l8gbp8kyak9caklp061nnp2lqvnb21wwg7zjd75pp0xf63s")))) + (build-system cmake-build-system) + (arguments + '(#:configure-flags '("-DDISABLE_STATIC=ON") + #:tests? #f ;no tests + #:phases (modify-phases %standard-phases + ;; TODO: build and install doc files like squirrel above + (add-after 'install 'install-headers + (lambda* (#:key outputs #:allow-other-keys) + (let* ((out (assoc-ref outputs "out")) + (include-dir (string-append out "/include"))) + (mkdir-p include-dir) + (for-each (lambda (header-file) + (copy-recursively header-file + (string-append + include-dir "/" + (basename header-file)))) + (find-files "../include"))) #t))))) + (native-inputs `(("cmake" ,cmake-minimal) + ("python-sphinx" ,python-sphinx))) + (home-page "https://github.com/GaijinEntertainment/quirrel") + (synopsis "Script language that is based on Squirrel language and is +inspired by Python, Javascript and especially Lua") + (description + "Quirrel is a script language that is based on Squirrel language and is +inspired by Python, Javascript and especially Lua, with + + Lexical scoping + Higher order functions, closures and lambda + Classes and inheritance + Tail recursion + Delegation + String interpolation + Exception handling + Cooperative threads (coroutines) + Generators + Performance - Quirrel is fast and small (comparable with Lua and sometimes even faster) + Both compiler and virtual machine fit together in about 13k lines of C++ code and add only around 100kb-150kb the executable size. + Automatic memory management (CPU bursts free - reference counting and GC) + Optional 16bits characters strings + Dynamic typing type system is close to Javascript but stricter and simpler (there is integer type and no 'undefined') + Powerful embedding api + Modules + Hot-reload (if you implement it in your code) + Open Source MIT License") + (license license:expat)))