3 ms·
If your problem isn't well-suited to a functional approach, why are you using Lisp to solve it? Anyway, the Church-Turing thesis won't cause you any trouble. C
by sp332 15y ago
If your problem isn't well-suited to a functional approach, why are you using Lisp to solve it?
Anyway, the Church-Turing thesis won't cause you any trouble. C and Lisp are both "Turing-complete" which means that any program you can write in one will be representable in the other. I couldn't find a direct translation, but maybe this Fortran->Lisp converter from 1979 will show you how it's possible? http://www.nhplace.com/kent/Papers/Fortran-to-Lisp.html http://www.nhplace.com/kent/Papers/Fortran-to-Lisp.html
- zackmorris 15y agoThanks for the link. I try to write most of my code in a functional manner in c, so like, DRY, favoring functions instead of having a variable dependent on another variable, stuff like that. I want to make a tool at some point that takes a block of c code and converts it to lisp so that I can try various transformations and permutations like Mathematica does, or evolve the parse tree with genetic programming: http://www.geneticprogramming.com/Tutorial/ http://www.geneticprogramming.com/Tutorial/ Then I want to turn the lisp code back into c code and keep it readable. Off the top of my head, I might be able to represent any globals in c as a list and pass that along to the lisp functions, or better yet, ban globals for now. External library calls would probably also be banned, unless they are from a built-in library with no side effects. It's just much easier for me to proofread code than generate it so I'd really like to have a tool like this.