What do I need to know to design a language and write a interpreter for it?
Posted
by
alFReD NSH
on Programmers
See other posts from Programmers
or by alFReD NSH
Published on 2012-04-12T07:32:34Z
Indexed on
2012/04/12
11:42 UTC
Read the original article
Hit count: 303
language-design
|compiler
I know this question has been asked and even there are thousands of books and articles about it. But the problem is that there are too many, and I don't know are they good enough, I have to design a language and write a interpreter for it. The base language is javascript (using nodejs) but it's ok if the compiler was written in another language that I can use from node. I had done a research about compiler compilers in JS, there is jison (Bison implementaion in JS), waxeye, peg.js. I decided to give jison a try, due to the popularity and its being used by coffee script, so it should be able to cover my language too. The grammar definition syntax is similar to bison. But when I tried read the bison manual it seemed very hard to understand for me. And I think it's because I don't know a lot of things about what I'm doing. Like I don't what is formal language theory.
I am experienced in Javascript (I'm more talented in JS than most average programmers). And also know basic C and C++ (not much experience but can write a working code for basic things). I haven't had any formal education, so I may not be familiar with some software engineering and computer science principles. Though everyday I try to grasp a lot of articles and improve.
So I'm asking if you know any good book or article that can help me. Please also write why the resource you're suggesting is good.
--update--
The language I'm trying to create, is not really complicated. All it has is expressions (with or without units), comparisons and logical operators. There are no functions, loops, ...
The goal is to create a language that non-programmers can easily learn. And to write customized validations and calculations.
© Programmers or respective owner