LISP for Recursive Math Problems: Choosing Between Common Lisp and Scheme

  • Thread starter Thread starter qntty
  • Start date Start date
AI Thread Summary
For solving tedious, recursive math problems, Scheme is recommended over Common Lisp and Python due to its inherent support for tail-call optimization, which prevents stack overflow during recursion. While Python is a popular language, it does not optimize tail-call recursion, leading to potential issues with deep recursive calls. Scheme's design aligns well with functional programming techniques, making it a suitable choice for the task at hand.
qntty
Messages
289
Reaction score
4
I need a programming language primarily to solve tedious, recursive math problems. I've heard that lisp is good for this but don't know whether to go with common lisp or scheme. If there are any other languages that you think will do this better I'd like to hear of those too (I'd prefer not to use a CAS language like maple or mathematica).
 
Technology news on Phys.org


Python.
 


If I am not mistaken, Python does not optimize away tail-call recursion - it will simply put every instance of the function on the stack, eventually leading to an overflow. Scheme does this by design. Scheme and Lisp are much more natural for functional programming techniques than Python.

I suggest Scheme.
 
Thread 'Is this public key encryption?'
I've tried to intuit public key encryption but never quite managed. But this seems to wrap it up in a bow. This seems to be a very elegant way of transmitting a message publicly that only the sender and receiver can decipher. Is this how PKE works? No, it cant be. In the above case, the requester knows the target's "secret" key - because they have his ID, and therefore knows his birthdate.
Back
Top