3 ms·
It's pretty easy to write dreadfully unmaintainable lisp.
by miloshadzic 7y ago
It's pretty easy to write dreadfully unmaintainable lisp.
- faichai 7y agoIs that mainly due to macros or something else? Macros is a whole other paradigm...
- mruts 7y agoI wouldn't call Lisp a functional language. Historically it's not functional, and in practice it usually isn't functional either. When I hear "functional", I usually interpret it to mean languages influenced or derived from the ML family of languages. Notable features of these languages include algebraic data types, match expressions, emphasis on monadic operations (fold, scan, map, etc), support for TCO, and a expressive static type system (though unfortunately not necessarily supported higher kinds), and a discouragement of mutations. Common Lisp doesn't really emphasize any of those things, and Scheme only a couple.
- pjmlp 7y agoThat is describing Miranda and Haskell. F#, Standard ML, Caml Light and Objective Caml would fail that bullet point list.
- mruts 7y agoWhat points do ML languages fail on? They have everything I listed.
- pjmlp 7y agoTCO (you need explicitly rec annotations), immutability (ref cells, array types), existence of imperative control structures.
- mruts 7y agoJust because you need a red annotation doesn’t mean they don’t have TCO. Most people consider Scala to have TCO, and you need rec annotations as well. Also I said mutation is discouraged for ML languages, not that it hard. Point taken about the imperative control structures, though.
- pjmlp 7y agoRight, the generated machine code also matters. Scala has partial TCO, surely not cross recursive calls like Scheme language standard requires and how it is defined from CS point of view. Same applies to F#, because neither JVM nor CLR have direct support for TCO.
- dragonwriter 7y agoLisp, while somewhat functional.in preferred style, is an impure functional language and, as such, supports, fairly easily, imperative code with mutable state, with all the pitfalls that involves. It's also usually untyped, and I think the hard to write bad functional code line is mostly true of statically typed pure functional code.
- DickieStarshine 7y agoWell, I wouldn't exactly say that Lisp (CL) is functional. Also, if you're referring to macros then that's fair.