2. Hello world
If you haven't read the introduction section, I highly recommend going back and reading it. Everything at this point assumes you've read it.
Now why don't we write our first Squiggle program? Save it in a file called
Now to compile it, run:
squiggle main.sqg main.js
Feel free to take a look at
main.js generated by Squiggle. It's a little large, but that's mainly because Squiggle bundles the all of its necessary functions into the
main.js rather than writing two separate files.
To run it, use
node just like you normally would:
You should see the program write out
Hello, world! to the console.
Squiggle explains everything you need to know from there. It's a great way to quickly try something on your mind, without having to save your work.
require them, minify them, gzip them, whatever you want.