I've done some programming in a more-or-less functional style, but I've never really studied pure functional programming.
What is the bare minimum needed to implement a functional language?
As far as I can tell, you need:
- The ability to define a function
- The ability to call a function
- parameter substitution
- Some kind of "if" operation that can prevent recursion like "?:".
- Testing operators or functions like "Less than" or "Equals"
- A core library of fundamental functions and operators (+ -...)
This implies that you do NOT need:
- Looping
- variables (except for parameters)
- sequential statements
This is for a very simple mathematical usage--I probably won't even implement string manipulation.
Would implementing a language like this significantly limit you in some way I'm not considering? Mostly I'm concerned about the lack of sequential statements and ability to define variables, can you really do without these "Normal" programming features?
sum (1..1000)
takes about one second). – Joey Adams Mar 1 '11 at 1:07