From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Andrew Gwozdziewycz Newsgroups: gmane.lisp.guile.user Subject: Re: C programs in Scheme syntax Date: Fri, 29 May 2020 09:27:12 -0700 Message-ID: <456E2DFA-825A-4C43-9686-0EE0C9AF4CE6@gmail.com> References: <87pnantoe5.fsf@fcs20.keithdiane.us> Mime-Version: 1.0 (1.0) Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="57065"; mail-complaints-to="usenet@ciao.gmane.io" Cc: guile-user To: Keith Wright Original-X-From: guile-user-bounces+guile-user=m.gmane-mx.org@gnu.org Fri May 29 18:27:31 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 1jehqz-000Eh2-IG for guile-user@m.gmane-mx.org; Fri, 29 May 2020 18:27:29 +0200 Original-Received: from localhost ([::1]:56498 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jehqy-0004Us-Ez for guile-user@m.gmane-mx.org; Fri, 29 May 2020 12:27:28 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:58866) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jehqn-0004U9-6x for guile-user@gnu.org; Fri, 29 May 2020 12:27:17 -0400 Original-Received: from mail-pj1-x1034.google.com ([2607:f8b0:4864:20::1034]:52104) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jehqm-0007UY-2u for guile-user@gnu.org; Fri, 29 May 2020 12:27:16 -0400 Original-Received: by mail-pj1-x1034.google.com with SMTP id cx22so1525480pjb.1 for ; Fri, 29 May 2020 09:27:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=content-transfer-encoding:from:mime-version:subject:date:message-id :references:cc:in-reply-to:to; bh=XRV/xgmxXZkGxvfQgvA1gPbyXLHQuwEVlQxS0nV7wpc=; b=GxHwTY2qqJBA7AeKKEwao7l0VHy0WwfuoZ0Qnaxu2JLA6jwMcrRM5AtcyV8o3iOS5D iy3XaHfCbOT2mzjrBSo8jhy0iB/8OqnVGJfMOhC1zUHX52asJP6bbnrL6QzlVuuzn/7m Iq0r1Ld+0CoTWGHZTygIzU24WzwD93CRXoUAIvo/PDb9cuIsoGgpLmwS86P03OtGyBH0 2qkkj9Kyl5DH7BasypCE6N9XeAt8M0bqyPsrG2Tbve4hNxZ1TOJow/3iz/rFZ6JsaTzB pLUUIvHxsTnFeN7+e8pCRyow/asQEEMuK92Y8ObKxiQehbnIof6O2ki+Jaj6Pm0DrMxt ANxA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:content-transfer-encoding:from:mime-version :subject:date:message-id:references:cc:in-reply-to:to; bh=XRV/xgmxXZkGxvfQgvA1gPbyXLHQuwEVlQxS0nV7wpc=; b=WYbThAbBNh1CFrCnS5FnyFTSjlD8EAlez2ObXdzJIV+R4H/WnKfMVIl/GMhPmEhwxr om5f+APQFzDugoL54/tfKswj+I3YgQh4v1CHsCWL4DpAOEQml21U6EyWiO0fOsxv4ycP Z+kANM0LFetR9QMvAa7oa11MQnuz1Y3Iowa7BF/0Qlj5bUfWwbO94radFz0ySSuYQUYB X3AYMputEZCf6MIwwDgBtoOPyrInygYX0K25OYqiIo8GRnfzo22U5lSROB6s3c2bwhxg P9MIr5UtbQDIhLh3l0ZvByZJKWUMvPq8LYcfp+Ap3KM3NOX9TuevQqwgX+ByubaFIeKo vZPA== X-Gm-Message-State: AOAM530QsRzlczRTam8tl79WsWrR5stbimDQ5eszpP1y+KSXXCO/yGvx Nisqpgl+cO65xvRjqZzcNrWrTaZV X-Google-Smtp-Source: ABdhPJw9Tv9DeLoxnIVFFZyvWYtAJ5woPiSk8EaTTV2bOoyvV3FmGsxGyIkxwCvOrTs7W7bYxJNbtQ== X-Received: by 2002:a17:90a:dc10:: with SMTP id i16mr10124323pjv.137.1590769633772; Fri, 29 May 2020 09:27:13 -0700 (PDT) Original-Received: from [192.168.0.27] (75-164-132-170.ptld.qwest.net. [75.164.132.170]) by smtp.gmail.com with ESMTPSA id t186sm5891005pfd.185.2020.05.29.09.27.12 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 29 May 2020 09:27:13 -0700 (PDT) In-Reply-To: <87pnantoe5.fsf@fcs20.keithdiane.us> X-Mailer: iPhone Mail (17E262) Received-SPF: pass client-ip=2607:f8b0:4864:20::1034; envelope-from=apgwoz@gmail.com; helo=mail-pj1-x1034.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, MIME_QP_LONG_LINE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN X-Spam_action: no action 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:16532 Archived-At: One might also take a look at PreScheme: https://en.wikipedia.org/wiki/Schem= e_48 which is a lowlevel Sexp based system that can generate C or Bytecode.=20= There=E2=80=99s also BitC, which was/is a sexp based lowlevel language. I ca= nnot recall if it compiled directly to C, or was itself a compiler to machin= e code.=20 These, both, are not direct answers to your question (which I think has a fa= irly straightforward answer), but might give you some alternative ideas to c= onsider. > On May 28, 2020, at 20:38, Keith Wright wrote: >=20 > =EF=BB=BFI am thinkging about a project that uses Scheme macros > to generate C code. To this end I want to encode C=20 > programs as S-expressions. For example, the C program > that is encoded in Ascii as >=20 > for (j=3D0;j<12;++j) a[j] =3D j*pi/6; >=20 > might be encoded as an S-expression as >=20 > (for ((=3D j 0)(< j 12) (++ j)) (=3D (sub a j)(/ (* j pi) 6))) >=20 > Note that this is not a valid Scheme program, even with > non-standard functions defined. It is a re-encoding > of the Ascii C syntax as an S-expression. >=20 > I think I have read about something like this, perhaps > on this list, I am not sure. (Note to future language > inventors: a single letter name makes a horrible Google > search query. Name things with made up but pronouncable > words---perl, fortran...) >=20 > I most need to convert S-expr encoded C, to Ascii encoded C, > but I am interested in > (a) programs to convert S-expresions to C > (b) specifications for the form of the S-expr encoding > (c) better plans; advice from those who have tried and failed. >=20 > Any pointers? >=20 > -- Keith >=20 >=20