4 ms·
Risking being downmodded, I'd say Lisp is too "low level" for many common problems, which is great if your domain is parser/compiler construction/transformation
by vicaya 17y ago
Risking being downmodded, I'd say Lisp is too "low level" for many common problems, which is great if your domain is parser/compiler construction/transformation/combination. I have no problem with lisp syntax (I can even tolerate C++ templates :), but it (and most general purpose languages) feels less natural for many domain specific problems than languages catering to the domains.
A DSL family based on a flexible core (with a lispish intermediate language even) might be a viable approach.
In many situations, simplicity and restrictions (constraints) in DSLs is better than flexibility and expressiveness in a general purpose language, because it can offer new possibilities for domain specific optimizations due to domain specific constraints.
Just like new notations in math led to breakthroughs in many math branches, new syntax can bring new life to software in many specific domains.
The key to such systems seems to be making DSLs easy to build and optimize using a suite of common building blocks (human (cs people) friendly intermediate languages (like lisp as opposed to VM byte codes) and libraries.)
- lispm 17y agoThat's why Lisp was called 'AI assembler'. Literally hundreds of higher-level languages have been implemented on top of Lisp. One of those has been integrated into Common Lisp: CLOS, a high-level object-oriented language for programming dynamic systems, with meta-programming capabilities.
- vicaya 17y agoMost of these "high-level" languages are more of "extensions" (CLOS certainly feels like an extension) or alternative lispish languages than bona fide DSLs with DS constraints (that can be used for DS optimizations). The S-expression syntax feels foreign/messy in many domains.
- lispm 17y agoLanguages on top of Lisp can be all from extensions, to languages with their own syntax, parser, compiler, ... Examples for "high-level" languages on top of Lisp: Macsyma, Axiom, Refine, AP5, RacerPro, CycL, NESL, Reduce, PVS, the original ML, ... For a Lisp-like example see PDDL (Planning Domain Definition Language): (define (domain hanoi-domain) (:requirements :equality) (:predicates (disk ?x) (smaller ?x ?y) (on ?x ?y) (clear ?x)) (:action move-disk :parameters (?disk ?below-disk ?new-below-disk) :precondition (and (disk ?disk) (smaller ?disk ?new-below-disk) (not (= ?new-below-disk ?below-disk)) (not (= ?new-below-disk ?disk)) (not (= ?below-disk ?disk)) (on ?disk ?below-disk) (clear ?disk) (clear ?new-below-disk)) :effect (and (clear ?below-disk) (on ?disk ?new-below-disk) (not (on ?disk ?below-disk)) (not (clear ?new-below-disk))))) Tools like these are widely used in logistics domains, one of the domains where Lisp has been widely used. There is a competition between planning systems and PDDL is being used to describe the problems. For a non-s-expression domain specific language on top of Lisp see for example PWGL. It uses a graphical language. Also Macsyma/Maxima, and many many many others.