From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Keith Wright Newsgroups: gmane.lisp.guile.user Subject: C programs in Scheme syntax Date: Thu, 28 May 2020 23:23:46 -0400 Message-ID: <87pnantoe5.fsf@fcs20.keithdiane.us> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="111691"; mail-complaints-to="usenet@ciao.gmane.io" To: guile-user Original-X-From: guile-user-bounces+guile-user=m.gmane-mx.org@gnu.org Fri May 29 05:38:46 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 1jeVr3-000SyZ-Gf for guile-user@m.gmane-mx.org; Fri, 29 May 2020 05:38:45 +0200 Original-Received: from localhost ([::1]:39182 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jeVr2-0004kB-C9 for guile-user@m.gmane-mx.org; Thu, 28 May 2020 23:38:44 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:41168) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jeVqu-0004k4-8L for guile-user@gnu.org; Thu, 28 May 2020 23:38:36 -0400 Original-Received: from dsl.keithdiane.us ([66.92.74.188]:39682) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jeVqt-0001q5-Fh for guile-user@gnu.org; Thu, 28 May 2020 23:38:35 -0400 Original-Received: from fcs20.keithdiane.us (fcs20.keithdiane.us [192.168.1.119]) by fcs19.keithdiane.us (Postfix) with ESMTP id 61AC9218375; Thu, 28 May 2020 23:38:15 -0400 (EDT) Original-Received: by fcs20.keithdiane.us (Postfix, from userid 1000) id 6EEBD606D3; Thu, 28 May 2020 23:23:46 -0400 (EDT) Received-SPF: pass client-ip=66.92.74.188; envelope-from=kwright@keithdiane.us; helo=dsl.keithdiane.us X-detected-operating-system: by eggs.gnu.org: First seen = 2020/05/28 23:38:29 X-ACL-Warn: Detected OS = Linux 2.4.x [fuzzy] X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_PASS=-0.001 autolearn=_AUTOLEARN X-Spam_action: no action 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:16523 Archived-At: I am thinkging about a project that uses Scheme macros to generate C code. To this end I want to encode C programs as S-expressions. For example, the C program that is encoded in Ascii as for (j=0;j<12;++j) a[j] = j*pi/6; might be encoded as an S-expression as (for ((= j 0)(< j 12) (++ j)) (= (sub a j)(/ (* j pi) 6))) 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. 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...) 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. Any pointers? -- Keith