guile-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: C programs in Scheme syntax


From: Todor Kondić
Subject: Re: C programs in Scheme syntax
Date: Sat, 30 May 2020 10:13:22 +0000


> I have implemented a GNU Guile extension which compiles array operations to 
> machine code using LLVM: http://wedesoft.github.io/aiscm/
> I thought you might be interested since your example is an array operation.
>
> Regards
> Jan
>
> Am 29. Mai 2020 04:23:46 GMT+01:00 schrieb Keith Wright kwright@keithdiane.us:
>
> > 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
>
> --
>
> Diese Nachricht wurde von meinem Android-Gerät mit K-9 Mail gesendet.

Hah, probably everyone gets to this point after using Scheme for a while.

This is my fortran code generator.
https://gitlab.com/codetk/schemetran



reply via email to

[Prev in Thread] Current Thread [Next in Thread]