Skip to content

LP Finishing Touches

Nilay Majorwar edited this page Feb 19, 2022 · 1 revision

Finishing up

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.

Checking the bundle size

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.

Writing test cases

This should be straightforward.

  1. Create a directory called tests at the root of your language provider's directory.
  2. Collect some sample programs that cover most (if not all) of the esolang's operations and quirks.
  3. Put each of these programs in a separate appropriately named txt file inside the tests directory.
  4. Create a file called index.test.ts in the tests directory, and copy over the contents of the index.test.ts file from Deadfish.
  5. 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 the txt 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 the RS 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.

Writing the esolang README

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.

Thank you!

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!