Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 19 additions & 9 deletions docs/ABOUT.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,24 @@
# About
# About MoonScript

<!-- TODO: write document
MoonScript was created by [Leaf Corcoran][leafo] as a more streamlined and "friendlier" alternative to [Lua][lua], a popular scripting language known for its speed and embeddability.
Often described as "CoffeeScript for Lua," MoonScript's design philosophy centers on readability and ease of use, aiming to reduce the verbosity of Lua while retaining its core strengths.
It achieves this by transpiling its code directly into standard Lua, meaning it can run on any platform that supports a Lua interpreter.

This document contains a short introduction to the language.
The primary function of MoonScript is to provide a more elegant and developer-friendly syntax for writing code that ultimately runs as Lua.
It introduces features not native to Lua, such as classes, list comprehensions, and a more intuitive syntax for table manipulation.
By compiling to Lua, it allows developers to leverage the vast ecosystem of existing Lua libraries and frameworks without modification, offering the best of both worlds: a modern, expressive syntax with the performance and portability of a well-established language.

The introduction should be relatively brief and touch upon what
makes the language interesting (and possibly unique). The goal
is to help students decide if they want to join this track.
Due to its nature as a Lua preprocessor, MoonScript finds its home in many of the same domains as Lua itself.
It is particularly popular in game development, especially within game engines that use Lua for scripting, such as LÖVE 2D and Defold.
Its concise syntax allows for faster development and easier maintenance of game logic.
Beyond gaming, it is also used in web development, with frameworks like Lapis (which was also created by the author of MoonScript) and OpenResty, and for general-purpose scripting and application development.

The contents of this document are displayed on the track page,
provided the student has not joined the track.
To learn more about MoonScript, the official website at [moonscript.org][moon] is the best starting point.
The community, while smaller than that of more mainstream languages, is active on platforms like [GitHub][github] and [Discord][discord].
For those familiar with Lua, the transition is often smooth, as MoonScript's syntax is designed to be intuitive and easy to pick up.

See https://exercism.org/docs/building/tracks/docs for more information. -->
[leafo]: https://leafo.net
[lua]: https://exercism.org/tracks/lua/about
[moon]: https://moonscript.org
[github]: https://github.com/leafo/moonscript
[discord]: https://discord.gg/Y75ZXrD
18 changes: 7 additions & 11 deletions docs/INSTALLATION.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,11 @@
# Installation
# Installing MoonScript

<!-- TODO: write document
First, follow the installation instructions on [the Lua track][lua-install] to install Lua and busted.

This document should describe what the student needs to install
to allow working on the track on their local system using the CLI.
Then, install MoonScript with

You can include the installation instructions in this document, but
usually it is better to link to a resource with the official installation
instructions, to prevent the instructions from becoming outdated.
```console
$ luarocks install --local moonscript
```

The contents of this document are displayed on the track's documentation
page at `https://exercism.org/docs/tracks/<track>/installation`.

See https://exercism.org/docs/building/tracks/docs for more information. -->
[lua-install]: https://exercism.org/docs/tracks/lua/installation
17 changes: 7 additions & 10 deletions docs/LEARNING.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
# Learning
# How to Learn MoonScript

<!-- TODO: write document
Read [An Overview of MoonScript][leafo] by Leafo, MoonScript's creator.
This is a great starting point if you're new to both MoonScript and Lua, explaining fundamental concepts.

This document should link to learning resources.
The primary spot for Learning Resources is [the MoonScript website][learn].
It assumes you are already familiar with Lua.

Feel free to link to any good learning resources you know, whether they
be websites, blogs, books, videos or courses.

The contents of this document are displayed on the track's documentation
page at `https://exercism.org/docs/tracks/<track>/learning`.

See https://exercism.org/docs/building/tracks/docs for more information. -->
[leafo]: https://leafo.net/posts/An_overview_of_MoonScript.html
[learn]: https://moonscript.org/#learning
25 changes: 17 additions & 8 deletions docs/RESOURCES.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,22 @@
# Resources
# MoonScript Resources

<!-- TODO: write document
* [Official MoonScript Language Guide][guide]:
The definitive resource for learning the language, covering its syntax and features in detail.
It's best if you have some basic Lua familiarity.

This document should link to useful resources.
* [Learn MoonScript in Y Minutes][xiny]:
For a quick, high-level introduction to the language's core features.

Feel free to link to any good resources you know, whether they
be websites, videos, mailing lists, etc.
* MoonScript [Online Compiler][onlin]:
Allows you to experiment with MoonScript code directly in your browser without any installation.

The contents of this document are displayed on the track's documentation
page at `https://exercism.org/docs/tracks/<track>/resources`.
* [GitHub Repository][github]:
The source code and community hub for MoonScript.

See https://exercism.org/docs/building/tracks/docs for more information. -->
If MoonScript intrigues you, you might want to follow up with [YueScript][yuescript] which is based on MoonScript and extends it.

[guide]: https://moonscript.org/
[xiny]: https://learnxinyminutes.com/docs/moonscript/
[online]: https://moonscript.org/compiler/
[github]: https://github.com/leafo/moonscript
[yuescript]: https://yuescript.org
6 changes: 5 additions & 1 deletion docs/SNIPPET.txt
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
TODO: add snippet
class Greet
new: (@who) =>
__tostring: => "Hello, #{@who}!"

print Greet thing for thing in *{'Me', 'You', 'World'}
30 changes: 21 additions & 9 deletions docs/TESTS.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,27 @@
# Tests
# Testing on the MoonScript Track

<!-- TODO: write document
Testing on the MoonScript track is exactly like [testing on the Lua track][lua-tests].
From an exercise directory, enter:

This document should describe everything related to running tests in the track.
```console
$ busted
```

If your track uses skipped tests, this document can explain why thet is used and
how to unskip tests.
## Pending tests

This document can also link to the testing framework documentation.
This track follows Exercism's [Test-Driven Development][tdd] methodology.
You are given a complete test suite, but only the first test is "active".

The contents of this document are displayed on the track's documentation
page at `https://exercism.org/docs/tracks/<track>/tests`.
To enable the tests, change a test's command from `pending` to `it`.

See https://exercism.org/docs/building/tracks/docs for more information. -->
For those of you that like to run all the tests all the time, you can use a command-line tool to change them all at once.
Here's an example using perl (which is installed just about everywhere):

```console
$ perl -i -pe 's/^\s+\Kpending\b/it/' two_fer_spec.moon
```

When you are working in the online editor, the test runner will automatically run all the tests.

[lua-tests]: https://exercism.org/docs/tracks/lua/tests
[tdd]: https://exercism.org/docs/using/solving-exercises/tdd