I
I
Ilya2021-11-29 09:18:58
Programming
Ilya, 2021-11-29 09:18:58

How to write your own scripting language?

Recommend good articles on writing your programming language.

Answer the question

In order to leave comments, you need to log in

5 answer(s)
S
Sergey Gornostaev, 2021-11-29
@sergey-gornostaev

There will be few articles for this task. Here you need at least SICP , and even better the book of the dragon .

N
Nikolay Savelyev, 2021-11-29
@AgentSmith

I wrote my language by reading the dragon book and then using ANTLR

S
Stalker_RED, 2021-11-29
@Stalker_RED

As an illustrative example, you can look at esprima , a js parser. It's well documented.

D
dollar, 2021-11-29
@dollar

Take Lua .
Perhaps this is the simplest scripting language, and even embeddable, that is, you can simply take its ready-made implementation and embed it in your application. It will take a programmer about 15 minutes to learn the syntax. At the same time, it is a fairly powerful language that has almost everything you might need in terms of syntax. There are not many built-in functions, but the main ones are there, because the emphasis is on ease of learning (for your own users). And if you really need your own scripting language, then using Lua as an example, you can understand what the required minimum should be in the language, you can study the source codes, etc.

D
Dmtm, 2021-11-30
@Dmtm

the skeleton is written in a day, we use the xml or json syntax so as not to write our own parser, we collect command objects, we write an interpreter that can respond to them - that's it, the simplest scripting language is ready,
branching according to the label-goto principle and saving command results in global variables (also most - label-value pairs)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question