-
Notifications
You must be signed in to change notification settings - Fork 4
LP Finishing Touches
So, you've implemented all the components of a language provider for your esolang. At this point, you should be able to run a program on Esolang Park like a user would be able to after your provider is merged in. In eseence, make sure you can tick off all the items on the following checklist (in your mind, that is - don't try to click on the checkboxes):
- All (or most) of the sample programs for your esolang run correctly on the IDE
- Live syntax checking works like you expect it to
- The visualisation pane shows a good representation of the runtime state
- Performance is good even on the 5ms execution interval (see the renderer guide page for more details)
If all items are done, fantastic! There's just a couple more formalities to be done - this way, please.
As long as you've not brought in a megabyte beast, the bundle size should be okay. Run yarn build:worker
and check the size of your esolang's script in webpack's output. Ideally it should be smaller than 250kb, and almost definitely not more than 350kb. If the size of your script is more than that and you do remember doing a yarn add ...
for your language provider, you may have to reconsider your choice. Post an issue on the repository and we'll look at it together.
This should be straightforward.
- Create a directory called
tests
at the root of your language provider's directory. - Collect some sample programs that cover most (if not all) of the esolang's operations and quirks.
- Put each of these programs in a separate appropriately named
txt
file inside thetests
directory. - Create a file called
index.test.ts
in thetests
directory, and copy over the contents of theindex.test.ts
file from Deadfish. - Adapt the contents to your test cases.
Each test case in the file should correspond to one of your sample program.
- The
readTestProgram
takes the second parameter as the name of thetxt
file (without the extension). - The
executeProgram
function executes the program on your provided engine instance, upto end of execution. - The
result
return value contains the full output of the program and theRS
value of the final execution step. - Use Jest's assertion utlities to check that the fields of the
result
value are as expected.
Run yarn test languages/<your-esolang-id>/*
to run all the test cases of your esolang.
If you didn't notice yet, there's also a stub README file in your language provider's directory. This file serves two main purposes:
- Provide a short intro and useful links to a user new to your esolang
- Provide implementation details and improvements that can be made, for future contributors.
The README file contains more information about what needs to be provided in each section. Also look at the README files of other esolangs for examples of what you can write. You don't need to explain the syntax of the esolang in any manner.
If everything's fine and done, create a PR on the repository!
I hope this guide was helpful - this is my first time writing documentation for anything whatsoever, so if you think there's some (or many) improvements to be made, post an issue on the repository and I'll try my best to improve this guide. I'm sure there's a lot of points I've missed while writing this up. The same goes for the developer experience. It's not optimal or fantastic by any means, but if there are any glaring issues you faced, please post an issue.
Thanks for your work!