Chookspeak is a language designed for the sole purpose of not forcing people to write a lot of confusing Javascript to build Chookchat Eggs. It's in very early development, and only has basic features. Chookspeak's syntax is a weird mix of Kotlin curly braced syntax and Javascript event handling. It's designed to not be hard to pick up and learn, especially if you have prior experience with those languages.
### Let's start coding!
To start, make a new file ending in `.chsp`. Start on the first line by defining your egg name.
```
egg notepad
```
This is a requirement of every Chookspeak program. The compiler WILL complain if you forget to do so. Next, define your initial startup, which is executed when your egg is opened. Let's log something to the console with the `log` keyword.
```
egg notepad
init {
log "Hello World!"
}
```
Notice how no brackets are needed, similar to Python 2 syntax. You do need to have a string with double quotes, similar to how Kotlin works. Each instruction takes a line. No semicolons, for now.
Next, define what your egg will look like, with a `html` section in the `init` section.
```
egg notepad
init {
log "Hello World!"
html {
<p>This is an egg.</p>
}
}
```
You can write whatever HTML you want inside there, including CSS styles. Keep in mind your space constraints with Chookchat when styling things. Now, send a message to the server (which will be in relation to your egg)
You can transpile Chookspeak to Javascript and HTML by using the program in the repository. Compile it with `gradle installDist`, then run `./build/install/chookspeak/bin/chookspeak` (add .bat if you're a crazy Windows user). You'll notice it complains about not having a file. Add the path as your argument. eg `./build/install/chookspeak/bin/chookspeak notepad.chsp`. Your program should be compiled to HTML and Javascript in valid egg format, which can be added to your Chookchat instance.
When running the transpiler, don't be worried if debug messages come up. For now, there's no way to error it other than having your egg declaration not at the start of your code.