4 ms·
I took an AI class that used Lisp. Language processing, knowledge based questions... What you can do in a few lines of Lisp code... Holy crap.
by fma 7y ago
I took an AI class that used Lisp. Language processing, knowledge based questions...
What you can do in a few lines of Lisp code... Holy crap.
- pjc50 7y agoWhat can you do in a few lines of Lisp that can't be done similarly in Python or Javascript? You can do amazing things in short strings of Perl or APL/J, they just tend not to be readable.
- jhbadger 7y agoMacros. You can actually add new syntax and paradigms to the language in Lisp. You can't do that in Python or Javascript. Yes, you might argue that "I don't need to change my language! It's fine the way it is". And it might be -- for now. But consider -- whatever you think about the merits of object-orientation, most languages like Javascript and Python had to be especially written to support it. Lisp could add object orientation to itself without creating a new language, a Lisp++, as it were. Lisp is future-proof the way other languages aren't.
- zmmmmm 7y agoThe question with that though is, is creating a unique DSL for every problem you solve actually a sustainable way to program? Once you do that, every single person who works on the code needs to understand all the implicit behavior of the DSL before they can use it. And any misunderstanding they have about it comes out as bugs. Yes, maybe OO had to be specifically added to Python, Java etc., but it's one OO that everyone uses, so when I encounter it in the wild I know exactly how it works.
- flavio81 7y ago>What can you do in a few lines of Lisp that can't be done similarly in Python or Javascript? To pick just an example: Anybody can create a Brainfuck (programming language) interpreter in a few lines of Python or Js code. With Common Lisp you could create a Brainfuck compiler (that compiles down to native code and thus has native code speed) in the same amount of lines of code. Or maybe shorter. A different example: The circle-ellipse problem. It is solved easily in Common Lisp (few lines of code), because the CLOS OOP system is more powerful than the OOP systems in Java, C++, Python, Javascript and many other languages.