5 ms·
This article really makes me want to learn lisp. Is there a risk that lisp’s extensibility creates lots of very specific dialects of lisp that can be difficult
by lordleft 7y ago
This article really makes me want to learn lisp. Is there a risk that lisp’s extensibility creates lots of very specific dialects of lisp that can be difficult to share / understand?
- jlg23 7y agoIn my experience, yes. The rule to follow is to keep it simple and explicit. I have seen web request handlers that used a list method combination to save one line of code per handler for the price of less experienced devs spending 15 minutes and multiple failed attempts to explain their own 3-line handler the very day after they wrote it (not making this up).
- pmoriarty 7y agoLisps are a highly readable family of languages, so once you know one Lisp it's pretty easy to read the rest, and very quick to get up to speed in them so you can write your own code in pretty much any other Lisp dialect. I went from Common Lisp to Chicken Scheme to eLisp and found the transitions very painless. I've also peeked at code in various other Lisp dialects, and they've always been very readable to me. If you're asking instead about DSLs written in Lisp, then the relationship of those DSLs themselves to Lisp is up to the author of the DSL in question. They can make the DSL very similar to Lisp or very different. It's entirely up to them. Most of the Lisp code I've seen has stuck pretty close to Lisp itself, which makes it easy to read for anyone who knows Lisp.
- zwerdlds 7y agoFrom what I've picked up, creating Domain-Specific Languages is one of the Lisp family's strong points. Whether its a good thing or a bad thing is another matter.
- elwell 7y agoClojure best-practices warn against using macros when a function would do. It tends to complicate debugging and maintainability. However, macros are very powerful, and when they are the right tool for the job they can create magic and afford new ways of looking at a problem. On the other end of the spectrum, Racket[0] fully embraces the DSL-creating power of macros. To answer your question: I think that lisp's extensibility can be used to create something difficult to share/understand OR easier to share/understand [1]. Whereas some other languages might be limited by their ability to naturally express a domain-fitted solution, yet they make it easier to avoid creating a cryptic mess. So... lisps don't confuse people, people do. [0] - https://racket-lang.org/ https://racket-lang.org/ [1] - a good example of macro use is Compojure's use of a macro for http route definitions. https://github.com/weavejester/compojure#usage https://github.com/weavejester/compojure#usage
- oldmandutch 7y agoShort answer is yes. Lisp can be as poorly written as any language. But it does give you more rope to hang yourself.
- stopachka 7y agoGreat to hear this has sparked your curiosity. Reach out if you end up having any questions! As to the risk of specific dialects being too difficult to understand: this isn’t the case in practice. There’s a few of reasons for this, but the main one is that, you can’t deviate from lisp’s simple syntax too much — as soon as you do, it’s no longer a lisp, and can’t use macros in the same way
- dreamcompiler 7y agoActually yes. The biggest issue I've had with using Common Lisp on a software team is everybody building their own languages. The remedy for this is to agree on standard macros and practices that everyone will abide by. Easier said than done, since CL programmers all come to the table with their own particular ways of doing things.
- invisiblerobot 7y agoCreating languages in Racket https://queue.acm.org/detail.cfm?id=2068896 https://queue.acm.org/detail.cfm?id=2068896