More languages, we need all the languages
This commit is contained in:
parent
548c1c1162
commit
1ae424f328
|
@ -1,6 +1,7 @@
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
import * as fs from "fs";
|
import * as fs from "fs";
|
||||||
|
import * as mkdirp from "mkdirp";
|
||||||
import * as pty from "node-pty";
|
import * as pty from "node-pty";
|
||||||
import { IPty } from "node-pty";
|
import { IPty } from "node-pty";
|
||||||
import * as path from "path";
|
import * as path from "path";
|
||||||
|
@ -104,6 +105,9 @@ export class Session {
|
||||||
if (suffix) {
|
if (suffix) {
|
||||||
code += suffix;
|
code += suffix;
|
||||||
}
|
}
|
||||||
|
if (main.includes("/")) {
|
||||||
|
await mkdirp(path.dirname(path.resolve(tmpdir, main)));
|
||||||
|
}
|
||||||
await new Promise((resolve, reject) =>
|
await new Promise((resolve, reject) =>
|
||||||
fs.writeFile(path.resolve(tmpdir, main), code, (err) => {
|
fs.writeFile(path.resolve(tmpdir, main), code, (err) => {
|
||||||
if (err) {
|
if (err) {
|
||||||
|
|
|
@ -156,6 +156,15 @@ require("/usr/lib/node_modules/coffeescript/repl").start()
|
||||||
main: "main.exs",
|
main: "main.exs",
|
||||||
run: "iex main.exs",
|
run: "iex main.exs",
|
||||||
template: `IO.puts("Hello, world!")
|
template: `IO.puts("Hello, world!")
|
||||||
|
`,
|
||||||
|
},
|
||||||
|
elvish: {
|
||||||
|
name: "Elvish",
|
||||||
|
monacoLang: "plaintext",
|
||||||
|
repl: "SHELL=/usr/bin/elvish HOME=. elvish",
|
||||||
|
main: ".elvish/rc.elv",
|
||||||
|
run: "SHELL=/usr/bin/elvish HOME=. elvish",
|
||||||
|
template: `echo "Hello, world!"
|
||||||
`,
|
`,
|
||||||
},
|
},
|
||||||
emacs: {
|
emacs: {
|
||||||
|
@ -186,7 +195,7 @@ main() ->
|
||||||
monacoLang: "plaintext",
|
monacoLang: "plaintext",
|
||||||
repl: "SHELL=/usr/bin/fish fish",
|
repl: "SHELL=/usr/bin/fish fish",
|
||||||
main: "main.fish",
|
main: "main.fish",
|
||||||
run: 'fish -C "$(< main.fish)"',
|
run: 'SHELL=/usr/bin/fish fish -C "$(< main.fish)"',
|
||||||
template: `echo "Hello, world!"
|
template: `echo "Hello, world!"
|
||||||
`,
|
`,
|
||||||
},
|
},
|
||||||
|
@ -197,6 +206,17 @@ main() ->
|
||||||
main: "main.fs",
|
main: "main.fs",
|
||||||
run: "gforth main.fs",
|
run: "gforth main.fs",
|
||||||
template: `." Hello, world!" CR
|
template: `." Hello, world!" CR
|
||||||
|
`,
|
||||||
|
},
|
||||||
|
fortran: {
|
||||||
|
name: "FORTRAN",
|
||||||
|
monacoLang: "plaintext",
|
||||||
|
main: "main.f",
|
||||||
|
compile: "flang main.f -o main",
|
||||||
|
run: "./main",
|
||||||
|
template: ` program hello
|
||||||
|
print *, "Hello, world!"
|
||||||
|
end program hello
|
||||||
`,
|
`,
|
||||||
},
|
},
|
||||||
fsharp: {
|
fsharp: {
|
||||||
|
@ -265,6 +285,15 @@ main = putStrLn "Hello, world!"
|
||||||
main: "main.kts",
|
main: "main.kts",
|
||||||
run: "kotlinc -script main.kts; kotlinc",
|
run: "kotlinc -script main.kts; kotlinc",
|
||||||
template: `println("Hello, world!")
|
template: `println("Hello, world!")
|
||||||
|
`,
|
||||||
|
},
|
||||||
|
ksh: {
|
||||||
|
name: "Ksh",
|
||||||
|
monacoLang: "shell",
|
||||||
|
repl: "SHELL=/usr/bin/ksh HOME=. ksh",
|
||||||
|
main: ".kshrc",
|
||||||
|
run: "SHELL=/usr/bin/ksh HOME=. ksh",
|
||||||
|
template: `echo "Hello, world!"
|
||||||
`,
|
`,
|
||||||
},
|
},
|
||||||
lolcode: {
|
lolcode: {
|
||||||
|
@ -305,6 +334,32 @@ eval.apply(this, [require("fs").readFileSync("main.js", {encoding: "utf-8"})])
|
||||||
require("repl").start()
|
require("repl").start()
|
||||||
'`,
|
'`,
|
||||||
template: `console.log("Hello, world!")
|
template: `console.log("Hello, world!")
|
||||||
|
`,
|
||||||
|
},
|
||||||
|
objectivec: {
|
||||||
|
name: "Objective-C",
|
||||||
|
monacoLang: "objective-c",
|
||||||
|
main: "main.m",
|
||||||
|
compile:
|
||||||
|
"gcc $(gnustep-config --objc-flags) main.m $(gnustep-config --base-libs) -o main",
|
||||||
|
run: "./main",
|
||||||
|
template: `#import <Foundation/Foundation.h>
|
||||||
|
|
||||||
|
int main() {
|
||||||
|
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
|
||||||
|
NSLog(@"Hello, world!");
|
||||||
|
[pool drain];
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
`,
|
||||||
|
},
|
||||||
|
perl: {
|
||||||
|
name: "Perl",
|
||||||
|
monacoLang: "perl",
|
||||||
|
repl: "re.pl",
|
||||||
|
main: "main.pl",
|
||||||
|
run: "re.pl --rcfile ./main.pl",
|
||||||
|
template: `print("Hello, world!\\n")
|
||||||
`,
|
`,
|
||||||
},
|
},
|
||||||
php: {
|
php: {
|
||||||
|
@ -316,6 +371,15 @@ require("repl").start()
|
||||||
template: `<?php
|
template: `<?php
|
||||||
|
|
||||||
echo "Hello, world!\\n";
|
echo "Hello, world!\\n";
|
||||||
|
`,
|
||||||
|
},
|
||||||
|
powershell: {
|
||||||
|
name: "PowerShell",
|
||||||
|
monacoLang: "powershell",
|
||||||
|
repl: "SHELL=/usr/bin/pwsh pwsh",
|
||||||
|
main: "main.ps1",
|
||||||
|
run: "SHELL=/usr/bin/pwsh pwsh -NoExit main.ps1",
|
||||||
|
template: `Write-Host "Hello, world!"
|
||||||
`,
|
`,
|
||||||
},
|
},
|
||||||
python: {
|
python: {
|
||||||
|
@ -370,6 +434,15 @@ binding_irb.run(IRB.conf)
|
||||||
template: `fn main() {
|
template: `fn main() {
|
||||||
println!("Hello, world!");
|
println!("Hello, world!");
|
||||||
}
|
}
|
||||||
|
`,
|
||||||
|
},
|
||||||
|
scala: {
|
||||||
|
name: "Scala",
|
||||||
|
monacoLang: "plaintext",
|
||||||
|
repl: "scala",
|
||||||
|
main: "main.scala",
|
||||||
|
run: "scala -i main.scala",
|
||||||
|
template: `println("Hello, world!")
|
||||||
`,
|
`,
|
||||||
},
|
},
|
||||||
scheme: {
|
scheme: {
|
||||||
|
@ -381,6 +454,15 @@ binding_irb.run(IRB.conf)
|
||||||
template: `(begin
|
template: `(begin
|
||||||
(display "Hello, world!")
|
(display "Hello, world!")
|
||||||
(newline))
|
(newline))
|
||||||
|
`,
|
||||||
|
},
|
||||||
|
sh: {
|
||||||
|
name: "Sh",
|
||||||
|
monacoLang: "shell",
|
||||||
|
repl: "SHELL=/usr/bin/sh HOME=. posh -l",
|
||||||
|
main: ".profile",
|
||||||
|
run: "SHELL=/usr/bin/sh HOME=. posh -l",
|
||||||
|
template: `echo "Hello, world!"
|
||||||
`,
|
`,
|
||||||
},
|
},
|
||||||
sqlite: {
|
sqlite: {
|
||||||
|
@ -399,6 +481,24 @@ binding_irb.run(IRB.conf)
|
||||||
compile: "swiftc main.swift",
|
compile: "swiftc main.swift",
|
||||||
run: "./main",
|
run: "./main",
|
||||||
template: `print("Hello, world!")
|
template: `print("Hello, world!")
|
||||||
|
`,
|
||||||
|
},
|
||||||
|
tcl: {
|
||||||
|
name: "Tcl",
|
||||||
|
monacoLang: "tcl",
|
||||||
|
repl: "tclsh",
|
||||||
|
main: ".tclshrc",
|
||||||
|
run: "HOME=. tclsh",
|
||||||
|
template: `puts {Hello, world!}
|
||||||
|
`,
|
||||||
|
},
|
||||||
|
tcsh: {
|
||||||
|
name: "Tcsh",
|
||||||
|
monacoLang: "shell",
|
||||||
|
repl: "SHELL=/usr/bin/tcsh HOME=. tcsh",
|
||||||
|
main: ".tcshrc",
|
||||||
|
run: "SHELL=/usr/bin/tcsh HOME=. tcsh",
|
||||||
|
template: `echo "Hello, world!"
|
||||||
`,
|
`,
|
||||||
},
|
},
|
||||||
typescript: {
|
typescript: {
|
||||||
|
@ -432,7 +532,7 @@ binding_irb.run(IRB.conf)
|
||||||
monacoLang: "shell",
|
monacoLang: "shell",
|
||||||
repl: "SHELL=/usr/bin/zsh zsh",
|
repl: "SHELL=/usr/bin/zsh zsh",
|
||||||
main: ".zshrc",
|
main: ".zshrc",
|
||||||
run: "ZDOTDIR=. zsh",
|
run: "SHELL=/usr/bin/zsh ZDOTDIR=. zsh",
|
||||||
template: `echo "Hello, world!"
|
template: `echo "Hello, world!"
|
||||||
`,
|
`,
|
||||||
},
|
},
|
||||||
|
|
|
@ -14,6 +14,7 @@
|
||||||
"express-ws": "^4.0.0",
|
"express-ws": "^4.0.0",
|
||||||
"file-loader": "^6.0.0",
|
"file-loader": "^6.0.0",
|
||||||
"heroku-ssl-redirect": "^0.0.4",
|
"heroku-ssl-redirect": "^0.0.4",
|
||||||
|
"mkdirp": "^1.0.4",
|
||||||
"monaco-editor": "^0.20.0",
|
"monaco-editor": "^0.20.0",
|
||||||
"node-pty": "^0.9.0",
|
"node-pty": "^0.9.0",
|
||||||
"style-loader": "^1.2.1",
|
"style-loader": "^1.2.1",
|
||||||
|
|
|
@ -86,6 +86,9 @@ dart
|
||||||
# Elixir
|
# Elixir
|
||||||
elixir
|
elixir
|
||||||
|
|
||||||
|
# Elvish
|
||||||
|
elvish
|
||||||
|
|
||||||
# Emacs Lisp
|
# Emacs Lisp
|
||||||
emacs-nox
|
emacs-nox
|
||||||
|
|
||||||
|
@ -98,6 +101,9 @@ fsharp
|
||||||
# Fish
|
# Fish
|
||||||
fish
|
fish
|
||||||
|
|
||||||
|
# FORTRAN
|
||||||
|
flang-7
|
||||||
|
|
||||||
# Forth
|
# Forth
|
||||||
gforth
|
gforth
|
||||||
|
|
||||||
|
@ -114,6 +120,9 @@ default-jdk
|
||||||
# Julia
|
# Julia
|
||||||
julia
|
julia
|
||||||
|
|
||||||
|
# Ksh
|
||||||
|
ksh
|
||||||
|
|
||||||
# LOLCODE
|
# LOLCODE
|
||||||
cmake
|
cmake
|
||||||
|
|
||||||
|
@ -127,6 +136,14 @@ nim
|
||||||
nodejs
|
nodejs
|
||||||
yarn
|
yarn
|
||||||
|
|
||||||
|
# Objective-C
|
||||||
|
gcc
|
||||||
|
gnustep-devel
|
||||||
|
|
||||||
|
# Perl
|
||||||
|
perl
|
||||||
|
perlconsole
|
||||||
|
|
||||||
# PHP
|
# PHP
|
||||||
php
|
php
|
||||||
|
|
||||||
|
@ -144,15 +161,27 @@ ruby
|
||||||
# Rust
|
# Rust
|
||||||
rustc
|
rustc
|
||||||
|
|
||||||
|
# Scala
|
||||||
|
scala
|
||||||
|
|
||||||
# Scheme
|
# Scheme
|
||||||
mit-scheme
|
mit-scheme
|
||||||
|
|
||||||
|
# Sh
|
||||||
|
posh
|
||||||
|
|
||||||
# SQLite
|
# SQLite
|
||||||
sqlite
|
sqlite
|
||||||
|
|
||||||
# Swift
|
# Swift
|
||||||
libpython2.7
|
libpython2.7
|
||||||
|
|
||||||
|
# Tcl
|
||||||
|
tcl
|
||||||
|
|
||||||
|
# Tcsh
|
||||||
|
tcsh
|
||||||
|
|
||||||
# Unlambda
|
# Unlambda
|
||||||
unlambda
|
unlambda
|
||||||
|
|
||||||
|
@ -178,6 +207,9 @@ npm install -g ts-node typescript
|
||||||
# ReasonML
|
# ReasonML
|
||||||
npm install -g bs-platform
|
npm install -g bs-platform
|
||||||
|
|
||||||
|
# Perl
|
||||||
|
cpan Devel::REPL
|
||||||
|
|
||||||
# Needed for project infrastructure
|
# Needed for project infrastructure
|
||||||
cd /tmp
|
cd /tmp
|
||||||
wget -nv https://github.com/watchexec/watchexec/releases/download/1.13.1/watchexec-1.13.1-x86_64-unknown-linux-gnu.deb
|
wget -nv https://github.com/watchexec/watchexec/releases/download/1.13.1/watchexec-1.13.1-x86_64-unknown-linux-gnu.deb
|
||||||
|
@ -192,6 +224,13 @@ cp kotlinc/bin/* /usr/bin/
|
||||||
cp kotlinc/lib/* /usr/lib/
|
cp kotlinc/lib/* /usr/lib/
|
||||||
rm -rf kotlin-*.zip kotlinc
|
rm -rf kotlin-*.zip kotlinc
|
||||||
|
|
||||||
|
# PowerShell
|
||||||
|
cd /tmp
|
||||||
|
wget -nv https://github.com/PowerShell/PowerShell/releases/download/v7.0.1/powershell-7.0.1-linux-x64.tar.gz
|
||||||
|
mkdir /opt/powershell
|
||||||
|
tar -xf powershell-*.tar.gz -C /opt/powershell
|
||||||
|
ln -s /opt/powershell/pwsh /usr/bin/pwsh
|
||||||
|
|
||||||
# Swift
|
# Swift
|
||||||
cd /tmp
|
cd /tmp
|
||||||
wget -nv https://swift.org/builds/swift-5.2.4-release/ubuntu2004/swift-5.2.4-RELEASE/swift-5.2.4-RELEASE-ubuntu20.04.tar.gz
|
wget -nv https://swift.org/builds/swift-5.2.4-release/ubuntu2004/swift-5.2.4-RELEASE/swift-5.2.4-RELEASE-ubuntu20.04.tar.gz
|
||||||
|
@ -231,6 +270,8 @@ while True:
|
||||||
except EOFError:
|
except EOFError:
|
||||||
print("^D")
|
print("^D")
|
||||||
break
|
break
|
||||||
|
if not code:
|
||||||
|
continue
|
||||||
with tempfile.NamedTemporaryFile(mode="w") as f:
|
with tempfile.NamedTemporaryFile(mode="w") as f:
|
||||||
f.write(code)
|
f.write(code)
|
||||||
f.flush()
|
f.flush()
|
||||||
|
@ -261,6 +302,8 @@ while True:
|
||||||
except EOFError:
|
except EOFError:
|
||||||
print("^D")
|
print("^D")
|
||||||
break
|
break
|
||||||
|
if not code:
|
||||||
|
continue
|
||||||
subprocess.run(["unlambda"], input=code, encoding="utf-8")
|
subprocess.run(["unlambda"], input=code, encoding="utf-8")
|
||||||
EOF
|
EOF
|
||||||
chmod +x /usr/bin/unlambda-repl
|
chmod +x /usr/bin/unlambda-repl
|
||||||
|
|
|
@ -2080,6 +2080,11 @@ mkdirp@^0.5.1, mkdirp@^0.5.3:
|
||||||
dependencies:
|
dependencies:
|
||||||
minimist "^1.2.5"
|
minimist "^1.2.5"
|
||||||
|
|
||||||
|
mkdirp@^1.0.4:
|
||||||
|
version "1.0.4"
|
||||||
|
resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-1.0.4.tgz#3eb5ed62622756d79a5f0e2a221dfebad75c2f7e"
|
||||||
|
integrity sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==
|
||||||
|
|
||||||
monaco-editor@^0.20.0:
|
monaco-editor@^0.20.0:
|
||||||
version "0.20.0"
|
version "0.20.0"
|
||||||
resolved "https://registry.yarnpkg.com/monaco-editor/-/monaco-editor-0.20.0.tgz#5d5009343a550124426cb4d965a4d27a348b4dea"
|
resolved "https://registry.yarnpkg.com/monaco-editor/-/monaco-editor-0.20.0.tgz#5d5009343a550124426cb4d965a4d27a348b4dea"
|
||||||
|
|
Loading…
Reference in New Issue