2019-03-12 10:09:46 +01:00
|
|
|
# Comp_iler
|
|
|
|
|
|
|
|
Sandboxed code execution discord bot.
|
|
|
|
|
|
|
|
## Usage
|
|
|
|
|
|
|
|
### Code Blocks
|
|
|
|
|
|
|
|
````
|
|
|
|
>```lang
|
|
|
|
code
|
|
|
|
```
|
|
|
|
````
|
|
|
|
|
|
|
|
With options:
|
|
|
|
|
|
|
|
````
|
|
|
|
>[options]```lang
|
|
|
|
code
|
|
|
|
```
|
|
|
|
````
|
|
|
|
|
|
|
|
### Inline Code
|
|
|
|
|
|
|
|
```
|
|
|
|
>`lang code`
|
|
|
|
```
|
|
|
|
|
|
|
|
With options:
|
|
|
|
|
|
|
|
````
|
|
|
|
>[options]`lang code`
|
|
|
|
````
|
|
|
|
|
|
|
|
### Examples
|
|
|
|
|
|
|
|
````
|
|
|
|
>```hs
|
|
|
|
main :: IO ()
|
|
|
|
main = print 1
|
|
|
|
```
|
|
|
|
````
|
|
|
|
|
|
|
|
````
|
|
|
|
>[harmony]```js
|
|
|
|
class Foo {
|
|
|
|
bar = 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
console.log(new Foo().bar);
|
|
|
|
```
|
|
|
|
````
|
|
|
|
|
|
|
|
```
|
|
|
|
>`py print('hello world')`
|
|
|
|
```
|
|
|
|
|
|
|
|
## Supported Languages
|
|
|
|
|
|
|
|
One of the following languages is set in `lang`.
|
|
|
|
|
|
|
|
- `js` JavaScript (Node 10.14.2)
|
|
|
|
- `py` Python (CPython 3.6.8)
|
|
|
|
- `hs` Haskell (GHC 8.4.3)
|
2019-03-13 05:37:28 +01:00
|
|
|
- `pas` Pascal (FPC 3.0.4)
|
2019-03-13 05:58:43 +01:00
|
|
|
- `go` Go (Go 1.12)
|
2019-03-12 10:09:46 +01:00
|
|
|
|
|
|
|
## Options
|
|
|
|
|
|
|
|
Options are optionally set in `options`, which is a semicolon-delimited list of `flag` or `flag=value`.
|
|
|
|
|
|
|
|
For JavaScript:
|
|
|
|
- `harmony` enables harmony features (`--harmony` on node)
|
|
|
|
|
|
|
|
For Python:
|
|
|
|
- None
|
|
|
|
|
|
|
|
For Haskell:
|
|
|
|
- None
|
|
|
|
|
2019-03-13 05:37:28 +01:00
|
|
|
For Pascal:
|
|
|
|
- None
|
|
|
|
|
2019-03-13 05:58:43 +01:00
|
|
|
For Go:
|
|
|
|
- None
|
|
|
|
|
|
|
|
|
2019-03-12 10:09:46 +01:00
|
|
|
## Packages
|
|
|
|
|
|
|
|
Apart from the standard libraries, some other libraries come pre-installed.
|
|
|
|
|
|
|
|
For JavaScript:
|
|
|
|
- Node libraries
|
|
|
|
- lodash
|
|
|
|
- moment
|
|
|
|
- cheerio
|
|
|
|
|
|
|
|
For Python:
|
|
|
|
- numpy
|
|
|
|
|
|
|
|
For Haskell:
|
|
|
|
- GHC libraries
|
|
|
|
- aeson
|
|
|
|
- async
|
|
|
|
- attoparsec
|
|
|
|
- integer-logarithms
|
|
|
|
- megaparsec
|
|
|
|
- random
|
|
|
|
- scientific
|
|
|
|
- split
|
|
|
|
- vector
|
2019-03-13 05:37:28 +01:00
|
|
|
|
|
|
|
For Pascal:
|
2019-03-13 05:58:43 +01:00
|
|
|
- None
|
|
|
|
|
|
|
|
For Go:
|
|
|
|
- None
|