Tell me more ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

As the title suggests, I'm wondering if there are programming languages that were built specifically for building new programming languages?

share|improve this question
2  
Are you after a language specifically designed to be used during the entire process of the creation of the language (i.e. everything from syntax description to actual semantic meaning and code generation)? – evilcandybag Mar 8 '12 at 9:55
Can you clarify your question, please? Your question is about a language for building languages. Every single answer is about languages for building compilers which is a completely different thing. Expanding your question will help get better answers. – Jörg W Mittag Mar 8 '12 at 12:56
LISP and Scheme seem geared that way from a theoretical basis. Or to teach languages. – MathAttack Jun 4 '12 at 2:50

5 Answers

The old Unix lex and yacc are just made for that.

Equivalents are flex and GNU bison.

share|improve this answer
4  
lex and yacc are not languages for building languages. They are languages for describing and generating lexers and parsers, which are used as components in a language implementation. – evilcandybag Mar 8 '12 at 9:53
2  
@evilcandybag - So what would be a language for building languages? BNF maybe ? – mouviciel Mar 8 '12 at 10:01
3  
BNF is just another way to describe syntax. It does not describe semantics. To my knowledge there are no such languages out there (at least not in wide use). The most common variants I've seen are either a combination of some lexer/parser-generator and one or more general purpose languages (C/Java/Haskell etc), or just a general purpose language. – evilcandybag Mar 8 '12 at 10:47

Some languages like Standard ML have both the syntax, data structures, and libraries which is said to make compiler writing very friendly.

share|improve this answer
1  
+1. Indeed, "ML" originally stood for "metalanguage"; it got its start as a language for proving theorems about "object languages" (abbreviated OL). – ruakh Mar 8 '12 at 16:56

The earliest example is probably Assembly Language, but you're probably looking for something higher level.

Lisp introduced the notion of Macros, which enables developing it into a DSL.

More recently, there is XL, or eXtensible Language.

share|improve this answer
I don't see how this answers the question because none of those were built specifically for building languages – Winston Ewert Mar 10 '12 at 2:18

RPython as used by the PyPy project. It allows you to write an interpreter in a subset of python, called RPython, and then it creates a JIT compiler from that.

share|improve this answer

Perl6 while not uniquely meant to create new language is designed to enable programmer with the capacity to doit using rich grammar/regex syntax.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.