What are the initial requirement that i need to know to develop a programming language like coffee script that basically has its own syntax but after compilation changes into another language. I did Google on that but couldn't find the right answer.
Asked
Active
Viewed 1,121 times
7
-
4I'll try not to sound like an arroguant asshole but the fact you're asking probably means you shoudln't start such an adventure now. This warning being made, I hope other people than me will be able to provide links to introductory material. – Denys Séguret Apr 24 '12 at 14:34
-
Maybe you could start by making sure you understand how the coffeescript compiler works ? – Denys Séguret Apr 24 '12 at 14:40
3 Answers
8
Specify your language with a basic formal grammar in something like EBNF.
statement = if-statement | return-statement | expression | ... if-statement = "if" "(" expression ")" "{" statements "}" return-statement = "return" expression ";" ...
Learn about simple parsing by recursive descent and operator precedence.
Write a parser that creates an abstract syntax tree from a source file.
Write a code generator that converts this AST into your target language; or
Write an interpreter that merely evaluates the AST.

Jon Purdy
- 53,300
- 8
- 96
- 166
3
A good first step is to read Programming Languages: Application and Interpretation. It'll teach you how to design and implement languages with interpreters.

Asumu Takikawa
- 8,447
- 1
- 28
- 43
0
The initial requirements are:
- Determine the target computer language
- Develop the syntax of your new language
- Map the syntax of your new language to the target language.
You'll still have plenty of work ahead, but basically, you're translating your new language into a target language.

Gilbert Le Blanc
- 50,182
- 6
- 67
- 111