4 ms·
There's at least one language (Refal: there may be more!) based on Markov algorithms. Another language (XL: as far as I know this is the only one of its breed
by Allan_Smithee 10y ago
There's at least one language (Refal: there may be more!) based on Markov algorithms. Another language (XL: as far as I know this is the only one of its breed thus far) works at its core on parse tree substitution. Yet another (CHR) does a weird generalization of term re-writing to provide a toolkit for making constraint languages. (Yes, a language to make languages.)
There's a reason I've become a programming language whore.
- vram22 10y ago>(Yes, a language to make languages.) Are there any other languages that are mainly designed with the goal of making it easier to make other general-purpose languages (as opposed to languages for DSLs or parser generation etc.)? I know that generally many languages are written in C or compile to C, and that Lisp can also be used to make other languages or sub-languages. But asking about languages (mostly) dedicated for that purpose - creation of new general-purpose programming languages.
- fulafel 10y agoPeople sometimes say ML is aimed at compiler writing.
- agumonkey 10y agoBecause FP is in love with algebra and trees, which are the bread and butter of ASTs.
- freeduck 10y agoLisp. Clojure for instance has a built in logic language called miniKanren
- vram22 10y agoInteresting. IIRC I came across a series of libs from that family recently - for different languages, including Python. Need to check it out. Update: Googled, it's right here: https://en.wikipedia.org/wiki/MiniKanren https://en.wikipedia.org/wiki/MiniKanren From that page: "There are implementations of miniKanren in Haskell, Racket, Ruby, Clojure, and Python. The canonical implementation is an embedded language in Scheme. The Clojure core.logic library was inspired by miniKanren." The name kanren comes from a Japanese word for "relation".
- tom_mellior 10y agoThe K framework: http://www.kframework.org/index.php/Main_Page http://www.kframework.org/index.php/Main_Page It's a system for formally expressing the semantics of programming languages and getting an interpreter. That said, the parent's claim about CHR is rather broad, and you may have read too much into it. It's a library for writing new constraint programming libraries for Prolog. Combined with operator overloading, you get embedded DSLs for constraint systems. That's great, and it is "language development" in some sense. But CHR is not a tool for implementing interpreters or compilers for new programming languages (though it may be useful for some subtasks).
- vram22 10y agoYes, I did get that from what he said about CHR - it is constrained (heh) to that area of constraint systems. Interesting about the K framework, thanks. Will take a look. That's the sort of thing I was asking about - if such existed.
- kazinator 10y agoLisp is used for making languages that can usually be all used together in the same project and even mixed together. If I had to write a C or C++ compiler from scratch, I'd do it in Lisp. That project probably wouldn't work in the usual "language inside Lisp" way; it would spit out assembly code or object files which then have nothing to do with Lisp. The GNU people who originally wrote GCC (Stallman, et al) wanted to use Lisp; they write in C instead because it was well supported on Unix-like system. Stallman is a Lisper; he was on the ANSI CL committee and of course is well known for the Emacs work. GCC internals are full of Lisp terminology and "Frankenstein monster" versions of Lisp data structures. As an example, someone posted the following link on Reddit, in the Japanese subreddit: https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=28251d450e034f06fc52244c26ef65f64185dc59 https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=28251d450e034f... It's a GCC commit, whose message discusses the optimization using Lisp notation. The C code doesn't look like Lisp, but the comment explains what it's doing as an S-exp.
- vram22 10y ago"The GNU people who originally wrote GCC (Stallman, et al) wanted to use Lisp; they write in C instead because it was well supported on Unix-like system." Interesting, did not know they wanted to use Lisp for GCC, though I've read some about Stallman's work. Edit: Makes sense, I guess. I've read that functional languages are well-suited to the domain of writing language compilers. Seems logical, because a transformation from, say, a C program to assembly or machine code, can be thought of as a function call: y = f(x) where x is the C program, y the machine code, and f the compiler :) "Stallman is a Lisper; he was on the ANSI CL committee and of course is well known for the Emacs work." True.
- kazinator 10y agoOn this same topic, see this amusing comment in the middle of Bash: http://git.savannah.gnu.org/cgit/bash.git/tree/unwind_prot.c http://git.savannah.gnu.org/cgit/bash.git/tree/unwind_prot.c Firstly, the non-local jumps that handle Ctrl-C in Bash and whatnot are referred to using the "unwind protect". Then see the comment in that file: /* I can't stand it anymore! Please can't we just write the whole Unix system in lisp or something? */ :)