From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: James Cooper Newsgroups: gmane.lisp.guile.user Subject: How best to produce a standalone executable with Guile? Date: Sun, 5 Apr 2020 05:28:10 +0000 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="117581"; mail-complaints-to="usenet@ciao.gmane.io" To: guile-user@gnu.org Original-X-From: guile-user-bounces+guile-user=m.gmane-mx.org@gnu.org Sun Apr 05 09:13:01 2020 Return-path: Envelope-to: guile-user@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jKzSl-000UT0-R8 for guile-user@m.gmane-mx.org; Sun, 05 Apr 2020 09:12:59 +0200 Original-Received: from localhost ([::1]:45266 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jKzSk-0006jd-4n for guile-user@m.gmane-mx.org; Sun, 05 Apr 2020 03:12:58 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:43295) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jKxpc-00072u-0J for guile-user@gnu.org; Sun, 05 Apr 2020 01:28:30 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jKxpZ-0005Rf-68 for guile-user@gnu.org; Sun, 05 Apr 2020 01:28:26 -0400 Original-Received: from mail-ot1-x335.google.com ([2607:f8b0:4864:20::335]:33217) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jKxpY-0005QN-BJ for guile-user@gnu.org; Sun, 05 Apr 2020 01:28:25 -0400 Original-Received: by mail-ot1-x335.google.com with SMTP id 22so11954309otf.0 for ; Sat, 04 Apr 2020 22:28:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aucklanduni.ac.nz; s=google; h=mime-version:from:date:message-id:subject:to; bh=uj9eSKrYKfaAsgFSxseOC6hdRW5ZalBGj/toJpu/gHE=; b=Lcw+ZslBcbruGWTGPb+nzO/2clB27YBOyEjYf4wkQyiLNp/Xoh8E4uIzA/bYyxQIGW TTyZ0wemts1CYm7lzjOcW83VporpGhTUCfEgxPXyqqfftx8WCaJ4RIflfdH+Iq+Rc9pO etcJqoVqcNfoqAAof2E/QDVkKbZCZ8q0c+6Tk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=uj9eSKrYKfaAsgFSxseOC6hdRW5ZalBGj/toJpu/gHE=; b=jNUwq9z+DPWmpTjxriLFdwcybJU3OMn9E2+Kefv5/4EeHbCgPiOeWUGHWzUyVEKoKH Bqh4xfDRM467LI6DphEmySPIlm3PgxuuGKTZHBDLApfajknzAsSlzDpxjCDOfO7ytkJj /0OwLhEY/mNgAHqqZPKp67h82MKd6e6jv3u7nZbDsg1x4F6Bs1hb6rpsJZmaLcsJam6+ 6bcILiZVBbusppWS0kanHxvW5CZoP+r4lOSr/4FttWQYmKYcrNH/Su6XmV8eqoeHfYg2 R5RJXelxIKUxmzDMet+UYsYxyg/hGSHRq9Llp2P/a36I830V6LTuWIF7XLS7HCEGXz95 xDyg== X-Gm-Message-State: AGi0PuYMtNGnDPBtCRkpIe4JRKH5gtMtPqoPbevf3EqQLSRUS/cTonbu Cmi3QcUK2JWipDVWEto/GelK3HrSaYmPHyK6qIIBjJ9AUQg= X-Google-Smtp-Source: APiQypLSSUnC2+cS7TblyGcG4T25VybuaAKfQR+PoLRezP9cM3u42oTGHh02qpFftIiPx/iJ3KeCIZd8E3EW25cV1qk= X-Received: by 2002:a05:6830:239b:: with SMTP id l27mr12971167ots.278.1586064501056; Sat, 04 Apr 2020 22:28:21 -0700 (PDT) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::335 X-Mailman-Approved-At: Sun, 05 Apr 2020 03:12:44 -0400 X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: General Guile related discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-user-bounces+guile-user=m.gmane-mx.org@gnu.org Original-Sender: "guile-user" Xref: news.gmane.io gmane.lisp.guile.user:16367 Archived-At: Hi Guile folks, I am currently experimenting with a handful of languages that include modern implementations of Concurrent ML, to determine which one appears best able to handle computationally- and message-heavy workloads (at least for my purposes, Computer Vision). Guile is one of the languages I am trying out with the Fibers library. My question is, how can I best go about creating Linux executables from Guile, where said programs benefit from the most ahead-of-time compilation and optimisation possible? I don't believe they strictly need to be standalone, as the environment I will be running the programs in will likely be the same as the development environment. So they can undoubtedly have dependencies on external libraries. Furthermore, I am perfectly happy with the process being a bit convoluted, as I can easily automate it with a makefile. I would, however, prefer if at all possible that the option to target other processor architectures remains available down the line (I assume using GCC can enable this, but I'm not sure). I have looked at all the sections of the Guile manual that appeared relevant, but to be honest I'm still a bit confused about what the best approach would be. *s* *9.4.5 Bytecode* in the manual seems to suggest that one can use guild to produce what will be a standalone executable that looks like an ELF binary to the system and runs on the Guile VM, but I'm entirely sure if I am reading it correctly. *s 6.18.5 Compiling Scheme Code* also discusses compilation but seems to denounce the practice explicitly. *s 9.3.8 Just-In-Time Native Code* talks about JIT compilation to native code for a given target. Is it possible to apply this process ahead-of-time? A potential alternative approach I can see is using the capabilities of running Guile code in a C program (compiled with GCC). This would presumably involve creating a template C program that just calls the appropriate Guile functions and passes the relevant command line parameters in. Any thoughts on what would likely produce the most efficient executable in the end? The target programs do not need to modify themselves at run-time (or really do anything dynamic) if that makes a difference. And does anyone know of pre-existing examples they could point me to? Please do let me know if there is further information I could provide that would help. Thanks in advance. Regards, James