from backend import BackendBase, registry class GCCBackend(BackendBase): def compile(self, argv=None, env={}): if not argv: argv = ['gcc', 'main.c'] return self.popen(argv, env) def run(self, argv=None, env={}): if not argv: argv = ['./a.out'] return self.popen(argv, env) registry.append({ 'name': 'gcc', 'class': GCCBackend, 'description': 'The GNU C compiler' })
from backend import BackendBase, registry class HaskellBackend(BackendBase): def compile(self, argv=None, env={}): if not argv: argv = ['ghc', 'main.hs'] return self.popen(argv, env) def run(self, argv=None, env={}): if not argv: argv = ['./main'] return self.popen(argv, env) registry.append({ 'name': 'haskell', 'class': HaskellBackend, 'description': 'the purely-functional programming language' })
from backend import BackendBase, registry class ClojureBackend(BackendBase): def compile(self, argv=None, env={}): pass def run(self, argv=None, env={}): if not argv: argv = ['clojure', 'main.clj'] return self.popen(argv, env) registry.append({ 'name': 'clojure', 'class': ClojureBackend, 'description': 'the jvm lisp' })
from backend import BackendBase, registry class Python3Backend(BackendBase): def compile(self, argv=None, env={}): pass def run(self, argv=None, env={}): if not argv: argv = ['python3', 'main.py'] return self.popen(argv, env) registry.append({ 'name': 'python3', 'class': Python3Backend, 'description': 'the general-purpose language' })
from backend import BackendBase, registry class RubyBackend(BackendBase): def compile(self, argv=None, env={}): pass def run(self, argv=None, env={}): if not argv: argv = ['ruby', 'main.rb'] return self.popen(argv, env) registry.append({ 'name': 'ruby', 'class': RubyBackend, 'description': 'the dynamic scripting language' })
from backend import BackendBase, registry class JavaBackend(BackendBase): def compile(self, argv=None, env={}): if not argv: argv = ['javac', 'Main.java'] return self.popen(argv, env) def run(self, argv=None, env={}): if not argv: argv = ['java', 'Main'] return self.popen(argv, env) registry.append({ 'name': 'java', 'class': JavaBackend, 'description': 'the cross-platform language' })
from backend import BackendBase, registry class BashBackend(BackendBase): def compile(self, argv=None, env={}): pass def run(self, argv=None, env={}): if not argv: argv = ['/bin/bash', 'main.sh'] return self.popen(argv, env) registry.append({ 'name': 'bash', 'class': BashBackend, 'description': 'the bash shell' })
from backend import BackendBase, registry class TCLBackend(BackendBase): def compile(self, argv=None, env={}): pass def run(self, argv=None, env={}): if not argv: argv = ['tclsh', 'main.tcl'] return self.popen(argv, env) registry.append({ 'name': 'tcl', 'class': TCLBackend, 'description': 'the tool command language' })
from backend import BackendBase, registry class PerlBackend(BackendBase): def compile(self, argv=None, env={}): pass def run(self, argv=None, env={}): if not argv: argv = ['perl', 'main.pl'] return self.popen(argv, env) registry.append({ 'name': 'perl', 'class': PerlBackend, 'description': 'the general-purpose dynamic programming language' })
from backend import BackendBase, registry class ScalaBackend(BackendBase): def compile(self, argv=None, env={}): pass def run(self, argv=None, env={}): if not argv: argv = ['scala', 'main.sc'] return self.popen(argv, env) registry.append({ 'name': 'scala', 'class': ScalaBackend, 'description': 'the functional jvm language' })
from backend import BackendBase, registry class PHPBackend(BackendBase): def compile(self, argv=None, env={}): pass def run(self, argv=None, env={}): if not argv: argv = ['php', 'main.php'] return self.popen(argv, env) registry.append({ 'name': 'php', 'class': PHPBackend, 'description': 'personal homepage language' })
from backend import BackendBase, registry class JavaScriptBackend(BackendBase): def compile(self, argv=None, env={}): pass def run(self, argv=None, env={}): if not argv: argv = ['node', 'main.js'] return self.popen(argv, env) registry.append({ 'name': 'javascript', 'class': JavaScriptBackend, 'description': 'nodejs' })
from backend import BackendBase, registry class GoBackend(BackendBase): def compile(self, argv=None, env={}): pass def run(self, argv=None, env={}): if not argv: argv = ['go', 'run', 'main.go'] return self.popen(argv, env) registry.append({'name': 'go', 'class': GoBackend, 'description': 'go'})
from backend import BackendBase, registry class CPPBackend(BackendBase): def compile(self, argv=None, env={}): if not argv: argv = ['g++', 'main.cpp'] return self.popen(argv, env) def run(self, argv=None, env={}): if not argv: argv = ['./a.out'] return self.popen(argv, env) registry.append({ 'name': 'cpp', 'class': CPPBackend, 'description': 'The GNU C++ compiler' })
from backend import BackendBase, registry class CommonLispBackend(BackendBase): def compile(self, argv=None, env={}): pass def run(self, argv=None, env={}): if not argv: argv = ['gcl', '-batch', '-load', 'main.lisp'] return self.popen(argv, env) registry.append({ 'name': 'commonlisp', 'class': CommonLispBackend, 'description': 'the modern lisp' })
from backend import BackendBase, registry class GoBackend(BackendBase): def compile(self, argv=None, env={}): pass def run(self, argv=None, env={}): if not argv: argv = ['go', 'run', 'main.go'] return self.popen(argv, env) registry.append({ 'name': 'go', 'class': GoBackend, 'description': 'go' })
from backend import BackendBase, registry class Python2Backend(BackendBase): def compile(self, argv=None, env={}): pass def run(self, argv=None, env={}): if not argv: argv = ['python2', 'main.py'] return self.popen(argv, env) registry.append({ 'name': 'python2', 'class': Python2Backend, 'description': 'the general-purpose language' })