Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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.



>(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.


The K framework: 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).


Yes, 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.


Lisp 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=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.


"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.


On this same topic, see this amusing comment in the middle of Bash:

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? */
:)


Stallman was member of X3J13?

What did he do there?


Am I mis-remembering something?

[update: no]

Richard Gabriel's and Guy Steele's Evolution of Lisp lists Stallman among the people in a "Common Lisp Group".

See: https://www.dreamsongs.com/Files/Hopl2.pdf (P. 21)

Steele's CLTL (1) gives a list of people who were involved in the actual ANSI XJ13, but Stallman isn't listed.

Stallman, however, is credited in that very same book and section as having worked on an implementation of the "New Error System" (NES) as follows: "A reimplementation of the NES for non-Symbolics Lisp Machine dialects (MIT, LMI, and TI) was done at MIT by Richard M. Stallman. During the process of that reimplementation, some conceptual changes were made which have significantly influenced the Common Lisp Condition System."

There you go: Stallman is noted as having been part of an early "Common Lisp Group", and did some implementation work which influenced the CL condition system.


On the Common Lisp mailing list there are 30 mails from RMS.

His participation ended in 83. Before CLtL1 was published and way before X3J13 was started.

I'd say RMS was never a member of X3J13.


This was not ANSI CL. This was CLtL1 Common Lisp. X3J13 was formed a few years later. I never heard of him being active in X3J13.

Stallman never did much work with or on CL. I never had the impression that Stallman was very active in CL design. The mailing list protocols would clear this up...

Stallman actually does not like CL and has critized CL features many times and prevented them to be used in GNU Emacs.

The NES was done at Symbolics. Stallman likely tried to copy it for LMI, while he was fighting against Symbolics. But that phase did not last long.


People sometimes say ML is aimed at compiler writing.


Because FP is in love with algebra and trees, which are the bread and butter of ASTs.


Lisp. Clojure for instance has a built in logic language called miniKanren


Interesting. 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

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".




Consider applying for YC's Summer 2026 batch! Applications are open till May 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: