Add developer notes to the language README files

This commit is contained in:
Nilay Majorwar
2022-02-18 20:50:53 +05:30
parent 5b5600f329
commit 41b553737a
6 changed files with 112 additions and 25 deletions

View File

@ -1,13 +1,33 @@
# Shakespeare
## References
Shakespeare is a programming language that reads like a Shakespearean play, usually involving characters
appreciating and (rather roughly) criticizing other characters. It was created by Karl Wiberg and Jon Åslund
as part of a university course assignment in 2001.
- Official documentation and implementation: http://shakespearelang.sourceforge.net
The original resource page is [hosted on Sourceforge](http://shakespearelang.sourceforge.net). It contains the
[language specification PDF](http://shakespearelang.sourceforge.net/report/shakespeare.pdf) and a Shakespeare-to-C
transpiler written with Flex and Bison in C, along with links to some other related resources.
## Implementation details
The specification and the transpiler source code are the only references used while implementing the Shakespeare
language for Esolang Park.
## Notes for the user
- It is not necessary for questions to immediately be followed by conditionals. Conditionals
must immediately follow a question though - a runtime error is thrown otherwise.
- Empty acts and scenes are invalid. An act must contain at least one scene, and a scene must contain
at least one dialogue set or entry-exit clause.
## Implementation details
- The parser is implemented with [Chevrotain](https://chevrotain.io).
- The engine is quite small in size, and is a single file (`runtime.ts`).
- The renderer uses a custom component instead of Blueprint's `Tag` component for much better performance.
## Possible improvements
- Currently, the check that conditionals must be preceded immediately by a question is done at runtime. It is a static
check and should be done while parsing the program instead.
- Syntax highlighting doesn't work for multi-word keywords that break into two lines (`... summer's \n day ...`).