5 ms·
I don't see a reason why some FP languages (e.g. lisp, or elisp) aren't IDE friendly. It might well be because where there is unpopularity, there is less effort
by smithza 6y ago
I don't see a reason why some FP languages (e.g. lisp, or elisp) aren't IDE friendly. It might well be because where there is unpopularity, there is less effort to integrate, promote and maintain. If everything is a function and functions have positional parameters and everything named can be in a symbol table, why can't IDEs support (at least the basics of) FP languages?
- garmaine 6y agoRead the OP link.
- simias 6y agoI don't know much about modern IDEs because I don't use them, but I suspect that the very powerful lisp macro system can be an issue for good IDE integration. Think of something like the "loop" construct in Common Lisp: http://cl-cookbook.sourceforge.net/loop.html http://cl-cookbook.sourceforge.net/loop.html That's related with the problem the parent is talking about: it's very easy to create DSLs in in languages like Common Lisp, so people use them a lot. But for an IDE's parser, or even for a new coder discovering the codebase, it's pretty tricky to figure out what the code does. If somebody is ultra-familiar with Common Lisp but for some reason never learned how the loop construct worked they might be stumped when they encounter the following code: (loop for x in '(foo 2) thereis (numberp x)) What does that do exactly? What will it evaluate? What will it return? Which one of these symbols are special keywords and which one just refer to variables or functions? Meanwhile if you code in, say, C, the macro system is so crappy and clunky that you basically avoid it for anything complicated. Writing a similar LOOP macro in C would be an absolute shitshow (not that it prevented people from trying). As such C code tends to be much more verbose, but also much easier to follow if you know the core rules of the language.
- smithza 6y agoPerhaps if Macros where not such a mainstay and powerful element of some FP langs (I am not arguing against them), this argument would not be so strong. Macros in C/C++ are difficult for IDEs to deal with too, save for constants. Seeing though that macros are near fundamental to some FP langs, I understand better the driver for the design of Keli.
- r-w 6y agoWhat gave you the idea that most FP uses macros? Much code in functional languages uses no macros at all. Perhaps you are confusing FP with Lisp.
- jlarocco 6y agoThat's an interesting theory, but not true in practice. Common Lisp IDEs are great and don't have any problems with macros. Even going back to the 70s and 80s, with Lisp machines. Using Slime, the Common Lisp IDE mode in Emacs, there are at least four ways to answer your loop questions: 1. Ctrl-x, Ctrl-/ to look it up in the Lisp spec 2. Alt-. to jump to the definition 3. Alt-x slime-macro-expand-1 or Alt-x slime-macro-expand-all to see what code the macro generates 4. Execute it in the REPL and see what it does. Option 1 only works for things defined in the standard, obviously, but options 2-4 work for everything.