repl.it superiority!!
This commit is contained in:
parent
371831593c
commit
548c1c1162
|
@ -21,6 +21,51 @@ export const langs: { [key: string]: LangConfig } = {
|
||||||
main: "main.bash",
|
main: "main.bash",
|
||||||
run: "bash --rcfile main.bash",
|
run: "bash --rcfile main.bash",
|
||||||
template: `echo "Hello, world!"
|
template: `echo "Hello, world!"
|
||||||
|
`,
|
||||||
|
},
|
||||||
|
basic: {
|
||||||
|
name: "BASIC",
|
||||||
|
monacoLang: "plaintext",
|
||||||
|
repl: "bwbasic",
|
||||||
|
main: "main.bas",
|
||||||
|
run: "bwbasic main.bas",
|
||||||
|
template: `PRINT "Hello, world!"
|
||||||
|
`,
|
||||||
|
},
|
||||||
|
brainf: {
|
||||||
|
name: "Brainf***",
|
||||||
|
monacoLang: "plaintext",
|
||||||
|
repl: "brainf-repl",
|
||||||
|
main: "main.bf",
|
||||||
|
run: "brainf-repl main.bf",
|
||||||
|
template: `++++++++
|
||||||
|
[
|
||||||
|
>++++
|
||||||
|
[
|
||||||
|
>++
|
||||||
|
>+++
|
||||||
|
>+++
|
||||||
|
>+
|
||||||
|
<<<<-
|
||||||
|
]
|
||||||
|
>+
|
||||||
|
>+
|
||||||
|
>-
|
||||||
|
>>+
|
||||||
|
[<]
|
||||||
|
|
||||||
|
<-
|
||||||
|
]
|
||||||
|
|
||||||
|
>>.
|
||||||
|
>---.
|
||||||
|
+++++++..+++.
|
||||||
|
>>.
|
||||||
|
<-.
|
||||||
|
<.
|
||||||
|
+++.------.--------.
|
||||||
|
>>+.
|
||||||
|
>++.
|
||||||
`,
|
`,
|
||||||
},
|
},
|
||||||
c: {
|
c: {
|
||||||
|
@ -143,6 +188,15 @@ main() ->
|
||||||
main: "main.fish",
|
main: "main.fish",
|
||||||
run: 'fish -C "$(< main.fish)"',
|
run: 'fish -C "$(< main.fish)"',
|
||||||
template: `echo "Hello, world!"
|
template: `echo "Hello, world!"
|
||||||
|
`,
|
||||||
|
},
|
||||||
|
forth: {
|
||||||
|
name: "Forth",
|
||||||
|
monacoLang: "plaintext",
|
||||||
|
repl: "gforth",
|
||||||
|
main: "main.fs",
|
||||||
|
run: "gforth main.fs",
|
||||||
|
template: `." Hello, world!" CR
|
||||||
`,
|
`,
|
||||||
},
|
},
|
||||||
fsharp: {
|
fsharp: {
|
||||||
|
@ -211,6 +265,16 @@ 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!")
|
||||||
|
`,
|
||||||
|
},
|
||||||
|
lolcode: {
|
||||||
|
name: "LOLCODE",
|
||||||
|
monacoLang: "plaintext",
|
||||||
|
main: "main.lol",
|
||||||
|
run: "lci main.lol",
|
||||||
|
template: `HAI 1.2
|
||||||
|
VISIBLE "Hello, world!"
|
||||||
|
KTHXBYE
|
||||||
`,
|
`,
|
||||||
},
|
},
|
||||||
lua: {
|
lua: {
|
||||||
|
@ -346,6 +410,14 @@ binding_irb.run(IRB.conf)
|
||||||
template: `console.log("Hello, world!");
|
template: `console.log("Hello, world!");
|
||||||
`,
|
`,
|
||||||
},
|
},
|
||||||
|
unlambda: {
|
||||||
|
name: "Unlambda",
|
||||||
|
monacoLang: "plaintext",
|
||||||
|
repl: "unlambda-repl",
|
||||||
|
main: "main.unl",
|
||||||
|
run: "unlambda-repl main.unl",
|
||||||
|
template: "`.\n`.!`.d`.l`.r`.o`.w`. `.,`.o`.l`.l`.e`.Hi\n",
|
||||||
|
},
|
||||||
vim: {
|
vim: {
|
||||||
name: "Vimscript",
|
name: "Vimscript",
|
||||||
monacoLang: "plaintext",
|
monacoLang: "plaintext",
|
||||||
|
|
|
@ -42,7 +42,6 @@ bash
|
||||||
git
|
git
|
||||||
make
|
make
|
||||||
nodejs
|
nodejs
|
||||||
npm
|
|
||||||
yarn
|
yarn
|
||||||
|
|
||||||
# Handy utilities
|
# Handy utilities
|
||||||
|
@ -60,9 +59,15 @@ tmux
|
||||||
vim
|
vim
|
||||||
wget
|
wget
|
||||||
|
|
||||||
|
# BASIC
|
||||||
|
bwbasic
|
||||||
|
|
||||||
# Bash
|
# Bash
|
||||||
bash
|
bash
|
||||||
|
|
||||||
|
# BrainF
|
||||||
|
beef
|
||||||
|
|
||||||
# C/C++
|
# C/C++
|
||||||
clang
|
clang
|
||||||
|
|
||||||
|
@ -93,6 +98,9 @@ fsharp
|
||||||
# Fish
|
# Fish
|
||||||
fish
|
fish
|
||||||
|
|
||||||
|
# Forth
|
||||||
|
gforth
|
||||||
|
|
||||||
# Go
|
# Go
|
||||||
golang
|
golang
|
||||||
|
|
||||||
|
@ -106,6 +114,9 @@ default-jdk
|
||||||
# Julia
|
# Julia
|
||||||
julia
|
julia
|
||||||
|
|
||||||
|
# LOLCODE
|
||||||
|
cmake
|
||||||
|
|
||||||
# Lua
|
# Lua
|
||||||
lua5.3
|
lua5.3
|
||||||
|
|
||||||
|
@ -142,6 +153,9 @@ sqlite
|
||||||
# Swift
|
# Swift
|
||||||
libpython2.7
|
libpython2.7
|
||||||
|
|
||||||
|
# Unlambda
|
||||||
|
unlambda
|
||||||
|
|
||||||
# Vimscript
|
# Vimscript
|
||||||
vim
|
vim
|
||||||
|
|
||||||
|
@ -186,6 +200,71 @@ tar -xf swift-*.tar.gz -C /opt/swift --strip-components=2
|
||||||
ln -s /opt/swift/bin/swiftc /usr/bin/swiftc
|
ln -s /opt/swift/bin/swiftc /usr/bin/swiftc
|
||||||
rm swift-*.tar.gz
|
rm swift-*.tar.gz
|
||||||
|
|
||||||
|
# LOLCODE
|
||||||
|
cd /tmp
|
||||||
|
git clone https://github.com/justinmeza/lci.git
|
||||||
|
pushd lci >/dev/null
|
||||||
|
python3 install.py --prefix=/usr
|
||||||
|
popd >/dev/null
|
||||||
|
rm -rf lci
|
||||||
|
|
||||||
|
# BrainF
|
||||||
|
tee /usr/bin/brainf-repl >/dev/null <<"EOF"
|
||||||
|
#!/usr/bin/env python3
|
||||||
|
import argparse
|
||||||
|
import readline
|
||||||
|
import subprocess
|
||||||
|
import tempfile
|
||||||
|
|
||||||
|
parser = argparse.ArgumentParser()
|
||||||
|
parser.add_argument("file", nargs="?")
|
||||||
|
args = parser.parse_args()
|
||||||
|
|
||||||
|
if args.file:
|
||||||
|
subprocess.run(["beef", args.file])
|
||||||
|
while True:
|
||||||
|
try:
|
||||||
|
code = input("bf> ")
|
||||||
|
except KeyboardInterrupt:
|
||||||
|
print("^C")
|
||||||
|
continue
|
||||||
|
except EOFError:
|
||||||
|
print("^D")
|
||||||
|
break
|
||||||
|
with tempfile.NamedTemporaryFile(mode="w") as f:
|
||||||
|
f.write(code)
|
||||||
|
f.flush()
|
||||||
|
subprocess.run(["beef", f.name])
|
||||||
|
EOF
|
||||||
|
chmod +x /usr/bin/brainf-repl
|
||||||
|
|
||||||
|
# Unlambda
|
||||||
|
tee /usr/bin/unlambda-repl >/dev/null <<"EOF"
|
||||||
|
#!/usr/bin/env python3
|
||||||
|
import argparse
|
||||||
|
import readline
|
||||||
|
import subprocess
|
||||||
|
|
||||||
|
parser = argparse.ArgumentParser()
|
||||||
|
parser.add_argument("file", nargs="?")
|
||||||
|
args = parser.parse_args()
|
||||||
|
|
||||||
|
if args.file:
|
||||||
|
with open(args.file) as f:
|
||||||
|
subprocess.run(["unlambda"], input=f.read(), encoding="utf-8")
|
||||||
|
while True:
|
||||||
|
try:
|
||||||
|
code = input("λ> ")
|
||||||
|
except KeyboardInterrupt:
|
||||||
|
print("^C")
|
||||||
|
continue
|
||||||
|
except EOFError:
|
||||||
|
print("^D")
|
||||||
|
break
|
||||||
|
subprocess.run(["unlambda"], input=code, encoding="utf-8")
|
||||||
|
EOF
|
||||||
|
chmod +x /usr/bin/unlambda-repl
|
||||||
|
|
||||||
if (( "$uid" != 0 )); then
|
if (( "$uid" != 0 )); then
|
||||||
useradd --uid="$uid" --create-home --groups sudo docker
|
useradd --uid="$uid" --create-home --groups sudo docker
|
||||||
passwd -d docker
|
passwd -d docker
|
||||||
|
|
Loading…
Reference in New Issue