From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Simon Tournier Newsgroups: gmane.lisp.guile.user Subject: Re: using guile like a awk filter in a C program. Date: Wed, 22 May 2024 12:39:05 +0200 Message-ID: <87ikz63zcm.fsf@gmail.com> References: <60c7c61c6dea289c9a1d8e59829f9c91@univ-nantes.fr> <87v83ce2en.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="7161"; mail-complaints-to="usenet@ciao.gmane.io" To: Pierre Lindenbaum , guile-user@gnu.org Original-X-From: guile-user-bounces+guile-user=m.gmane-mx.org@gnu.org Wed May 22 17:20:32 2024 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 1s9nlY-0001gM-QW for guile-user@m.gmane-mx.org; Wed, 22 May 2024 17:20:32 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1s9nko-0006lm-K0; Wed, 22 May 2024 11:19:46 -0400 Original-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 1s9nkl-0006lU-8P for guile-user@gnu.org; Wed, 22 May 2024 11:19:44 -0400 Original-Received: from mail-wr1-x42d.google.com ([2a00:1450:4864:20::42d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1s9nki-0003p3-KW for guile-user@gnu.org; Wed, 22 May 2024 11:19:43 -0400 Original-Received: by mail-wr1-x42d.google.com with SMTP id ffacd0b85a97d-354eb55b288so133194f8f.0 for ; Wed, 22 May 2024 08:19:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1716391179; x=1716995979; darn=gnu.org; h=content-transfer-encoding:mime-version:message-id:date:references :in-reply-to:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=vuBZDLAOYgBTkPLxP8iCpwVNBlsoksrrTWGRBFl39xI=; b=OQhahpLJxqOKiOEmQpDXUnAh4W75FA/z//RS17owasRhDttbs7Nw+2g4KQfpJxQShw iKpt4ly7vlAvMU9aJbI7mrEQiVPln+22cj1lsdmIziTsrjH4vbx6gvHQJE+xPWzViloy DcgnXTBqiysZJRa7aI3VBgWzflXRORqfFMv1but6IqLGunhrJfDcRE8mrvYzQ3f0WTOJ s9GYZrG7xX4acvfViNPLg5Idj8NCCpb7TZ9WopyY/YKISPYg75DuYMFiMA5IGjtM9wKq siD8gMMoeRXv/mA78QJwdU3EwABskC3efEM55acT34FTHdBTfd08oS42tvei3qIMyQyl wLnw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716391179; x=1716995979; h=content-transfer-encoding:mime-version:message-id:date:references :in-reply-to:subject:to:from:x-gm-message-state:from:to:cc:subject :date:message-id:reply-to; bh=vuBZDLAOYgBTkPLxP8iCpwVNBlsoksrrTWGRBFl39xI=; b=JwwcT4fWmmEZQweAa/ropEeJ6sL+ZyFjwF4+B3ngTdY8yq/wYjQpfcaMH4pD3f+KgS t9YqkjNG/Y+sfnVk/aeNUUPQ0VdRsw3jyb2fV3Bv1n0OUwjQESZh5DmS4TTQRYz1ALia ewuWvbAatO5lhaPrf2DgVkGy+dCUbwV9B5Dk6LwtzH2m9JY0fX56KltzB9orngdPrgmg +3q5qgc2EaBTLTeAvk7w6vPMOCZmXu1tMol/Q8xrbg918vPMojIg+jMGVFAHaqVth82T PTx+anEoRxGkbzEQyJIIZ3wkhN/7FjZAI/SZNE2V0qZ798Mg2yiAhPWHs+rOgFTYC/Zd gcqA== X-Forwarded-Encrypted: i=1; AJvYcCW/zasdE/qSMuP5r8qosiiAZYW5kshLrE6dTFh1D7Wv2kmHFOvGh7Ks4mhVmgY7vftKsf4Xb/cDZOJKPy3wnlI+tFg= X-Gm-Message-State: AOJu0YxLX1rT/3DH9w6/2W2sWTdLhIQp2brvRgujmu7+VZI6stzkEEN/ 7KID/67jmxkiSZA/2+4OsgvxuQVHBdjEugaF6HBgEFoe991q1K2l+M+EAQ== X-Google-Smtp-Source: AGHT+IHi7ww1KO0V9wmBxfjPC+5iC0AB9a3f6NhSqOgdiFfgo0Um6TXeNAZRr+a77Vqkvic+T8XbDA== X-Received: by 2002:adf:f5c3:0:b0:34d:364:22ed with SMTP id ffacd0b85a97d-354d8c74af4mr1689178f8f.1.1716391178967; Wed, 22 May 2024 08:19:38 -0700 (PDT) Original-Received: from lili ([2a01:e0a:59b:9120:c865:f7ad:a866:6eca]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3502b8a78e8sm34895070f8f.61.2024.05.22.08.19.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 May 2024 08:19:38 -0700 (PDT) In-Reply-To: Received-SPF: pass client-ip=2a00:1450:4864:20::42d; envelope-from=zimon.toutoune@gmail.com; helo=mail-wr1-x42d.google.com X-Spam_score_int: -4 X-Spam_score: -0.5 X-Spam_bar: / X-Spam_report: (-0.5 / 5.0 requ) BAYES_00=-1.9, DATE_IN_PAST_03_06=1.592, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.29 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-bounces+guile-user=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.lisp.guile.user:19672 Archived-At: Hi Pierre, > I want to call scheme from C. Well, I would start with: https://www.gnu.org/software/guile/manual/html_node/A-Sample-Guile-Main-Pro= gram.html Then maybe: https://www.gnu.org/software/guile/manual/html_node/General-Libguile-Concep= ts.html Personally, I have never done that. The memory management can be painful. And instead of directly using libguile, my first attempt would be a very simplistic approach: call system() or popen(), i.e., start Guile this way and process some script. If that is not doable because the objects to process are alive inside only the C program, that=E2=80=99s = an indication it will not be straightforward. ;-) Somehow, I do not know about your question. :-) Cheers, simon