compiler-discord/README.md

71 lines
1.1 KiB
Markdown
Raw Normal View History

2019-03-12 10:09:46 +01:00
# Comp_iler
Sandboxed code execution discord bot.
## Usage
### Code Blocks
````
>```lang
code
```
2019-03-13 06:54:36 +01:00
>options```lang
2019-03-12 10:09:46 +01:00
code
```
````
### Inline Code
```
>`lang code`
2019-03-13 06:54:36 +01:00
>options`lang code`
2019-03-15 02:58:43 +01:00
```
2019-03-12 10:09:46 +01:00
### Examples
````
2019-03-15 02:58:43 +01:00
>```cpp
#include <iostream>
int main()
{
std::cout << "Hello World!" << std::endl;
}
2019-03-12 10:09:46 +01:00
```
2019-03-13 06:54:36 +01:00
>harmony```js
2019-03-12 10:09:46 +01:00
class Foo {
bar = 1;
}
console.log(new Foo().bar);
```
>`py print('hello world')`
2019-03-13 06:54:36 +01:00
>e`hs (+) <$> Just 1 <*> Just 2`
2019-03-15 02:58:43 +01:00
````
2019-03-13 06:54:36 +01:00
2019-03-15 02:58:43 +01:00
## Supported Languages and Options
2019-03-12 10:09:46 +01:00
2019-03-15 02:58:43 +01:00
One of the following language codes is set in `lang`.
Options are optionally set in `options`, which is a semicolon-delimited list of `flag` or `flag=value`.
2019-03-12 10:09:46 +01:00
2019-03-15 02:32:39 +01:00
- `c` C (GCC 8.2.0)
- `cpp` C++ (G++ 8.2.0)
- `cs` C# (Mono 5.18.0)
2019-03-15 02:58:43 +01:00
- `e` evaluates a single expression instead of a module
- `fs` F# (FSharp 4.5)
- `go` Go (Go 1.12)
- `hs` Haskell (GHC 8.6.3)
- `e` evaluates a single expression instead of a module
- `js` JavaScript (Node 11.11.0)
- `harmony` enables harmony features (`--harmony` on node)
- `e` prints the result of evaluating the code
- `pas` Pascal (FPC 3.0.4)
- `py` Python (CPython 3.7.2, CPython 2.7.16)
- `2` runs Python 2 instead of Python 3