Skip to content

Commit cc63927

Browse files
Merge branch 'master' into heroku
2 parents 5f4a8e7 + b5ceec8 commit cc63927

File tree

3 files changed

+245
-4
lines changed

3 files changed

+245
-4
lines changed

Dockerfile

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
FROM ubuntu:22.04
22

3+
RUN sed -i 's/main$/main contrib non-free/' /etc/apt/sources.list
34
RUN DEBIAN_FRONTEND=noninteractive apt-get update --fix-missing
45
RUN DEBIAN_FRONTEND=noninteractive apt-get upgrade -y
56

@@ -166,7 +167,63 @@ RUN DEBIAN_FRONTEND=noninteractive apt-get install -y racket
166167
### Tcl
167168
RUN DEBIAN_FRONTEND=noninteractive apt-get install -y tcl
168169

170+
### IO
171+
# Install dependencies
172+
RUN DEBIAN_FRONTEND=noninteractive apt-get install -y libffi-dev \
173+
cmake \
174+
libpcre3-dev \
175+
libxml2-dev \
176+
libssl-dev \
177+
zlib1g-dev \
178+
git && \
179+
rm -rf /var/lib/apt/lists/*
180+
181+
# Clone the Io language repository with submodules
182+
RUN git clone --recurse-submodules https://github.com/IoLanguage/io.git && \
183+
cd io && \
184+
mkdir build && \
185+
cd build && \
186+
cmake .. && \
187+
make && \
188+
make install && \
189+
cd ../.. && \
190+
rm -rf io
191+
192+
### Kotlin
193+
# Install SDKMAN
194+
RUN curl -s "https://get.sdkman.io" | bash
195+
196+
# Install Kotlin and set up environment
197+
RUN bash -c "source $HOME/.sdkman/bin/sdkman-init.sh && sdk install kotlin && sdk install java"
198+
199+
# Set environment variables for SDKMAN in Docker
200+
ENV SDKMAN_DIR="/root/.sdkman"
201+
ENV PATH="$SDKMAN_DIR/bin:$SDKMAN_DIR/candidates/kotlin/current/bin:$PATH"
202+
203+
# Verify installation
204+
RUN kotlin -version
205+
206+
### PostScript
207+
RUN DEBIAN_FRONTEND=noninteractive apt-get install -y ghostscript
208+
209+
210+
### Lua
211+
RUN DEBIAN_FRONTEND=noninteractive apt-get install -y lua5.4
212+
213+
### D
214+
RUN DEBIAN_FRONTEND=noninteractive apt-get install -y gdc
215+
216+
### Verilog
217+
RUN DEBIAN_FRONTEND=noninteractive apt-get install -y iverilog
218+
219+
### VHDL
220+
RUN DEBIAN_FRONTEND=noninteractive apt-get install -y ghdl
221+
222+
### Octave
223+
RUN DEBIAN_FRONTEND=noninteractive apt-get install -y octave
169224

225+
### COQ
226+
RUN DEBIAN_FRONTEND=noninteractive apt-get install -y coq
170227

171228
#############################################################################################
172229
COPY . /coderunner

README.md

Lines changed: 187 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ window.CodeRunner = {
129129
}
130130
131131
//window.CodeRunner.init("wss://coderunner.informatik.tu-freiberg.de/")
132-
//window.CodeRunner.init("ws://127.0.0.1:8000/")
132+
//window.CodeRunner.init("ws://127.0.0.1:4000/")
133133
window.CodeRunner.init("wss://ancient-hollows-41316.herokuapp.com/")
134134
@end
135135
@@ -142,6 +142,8 @@ window.CodeRunner.init("wss://ancient-hollows-41316.herokuapp.com/")
142142
@LIA.clojure_withShell: @LIA.eval(`["main.clj"]`, `none`, `clojure -M -i main.clj -r`)
143143
@LIA.cpp: @LIA.eval(`["main.cpp"]`, `g++ main.cpp -o a.out`, `./a.out`)
144144
@LIA.cobol: @LIA.eval(`["main.cob"]`, `cobc -x --free main.cob`, `./main`)
145+
@LIA.coq: @LIA.eval(`["file.v"]`, `coqc file.v`, `coqtop -lv file.v`)
146+
@LIA.d: @LIA.eval(`["main.d"]`, `gdc main.d`, `./a.out`)
145147
@LIA.elixir: @LIA.eval(`["main.exs"]`, `none`, `elixir main.exs`)
146148
@LIA.elixir_withShell: @LIA.eval(`["main.exs"]`, `none`, `iex main.exs`)
147149
@LIA.forth: @LIA.eval(`["main.fs"]`, `none`, `gforth main.fs -e BYE`)
@@ -151,15 +153,20 @@ window.CodeRunner.init("wss://ancient-hollows-41316.herokuapp.com/")
151153
@LIA.groovy: @LIA.eval(`["main.groovy"]`, `none`, `groovy main.groovy`)
152154
@LIA.haskell: @LIA.eval(`["main.hs"]`, `ghc main.hs -o main`, `./main`)
153155
@LIA.haskell_withShell: @LIA.eval(`["main.hs"]`, `none`, `ghci main.hs`)
156+
@LIA.io: @LIA.eval(`["main.io"]`, `none`, `io main.io`)
157+
@LIA.io_withShell: @LIA.eval(`["main.io"]`, `none`, `io -i main.io`)
154158
@LIA.java: @LIA.eval(`["@0.java"]`, `javac @0.java`, `java @0`)
155159
@LIA.julia: @LIA.eval(`["main.jl"]`, `none`, `julia main.jl`)
156160
@LIA.julia_withShell: @LIA.eval(`["main.jl"]`, `none`, `julia -i main.jl`)
161+
@LIA.kotlin: @LIA.eval(`["main.kt"]`, `kotlinc main.kt -include-runtime -d main.jar`, `java -jar main.jar`)
162+
@LIA.lua: @LIA.eval(`["main.lua"]`, `none`, `lua main.lua`)
157163
@LIA.mono: @LIA.eval(`["main.cs"]`, `mcs main.cs`, `mono main.exe`)
158164
@LIA.nasm: @LIA.eval(`["main.asm"]`, `nasm -felf64 main.asm && ld main.o`, `./a.out`)
159165
@LIA.nim: @LIA.eval(`["main.nim"]`, `nim c main.nim`, `./main`)
160166
@LIA.ocaml: @LIA.eval(`["main.ml"]`, `none`, `ocaml main.ml`)
161167
@LIA.perl: @LIA.eval(`["main.pl"]`, `perl -c main.pl`, `perl main.pl`)
162168
@LIA.perl_withShell: @LIA.eval(`["main.pl"]`, `perl -c main.pl`, `perl -d main.pl`)
169+
@LIA.postscript: @LIA.eval(`["input.ps"]`, `none`, `gs -sDEVICE=png16m -r300 -o output.png input.ps`)
163170
@LIA.prolog: @LIA.eval(`["main.pl"]`, `none`, `swipl -s main.pl -g @0 -t halt`)
164171
@LIA.prolog_withShell: @LIA.eval(`["main.pl"]`, `none`, `swipl -s main.pl`)
165172
@LIA.python: @LIA.python3
@@ -180,6 +187,8 @@ window.CodeRunner.init("wss://ancient-hollows-41316.herokuapp.com/")
180187
@LIA.tcl: @LIA.eval(`["main.tcl"]`, `none`, `tclsh main.tcl`)
181188
@LIA.v: @LIA.eval(`["main.v"]`, `v main.v`, `./main`)
182189
@LIA.v_withShell: @LIA.eval(`["main.v"]`, `none`, `sh -c "cat main.v - | v repl"`)
190+
@LIA.verilog: @LIA.eval(`["main.v"]`, `iverilog -o main.vvp main.v`, `vvp main.vvp`)
191+
@LIA.vhdl: @LIA.eval(`["@0.vhdl"]`, `ghdl -a @0.vhdl && ghdl -e @0`, `ghdl -r @0`)
183192
@LIA.zig: @LIA.eval(`["main.zig"]`, `zig build-exe ./main.zig -O ReleaseSmall`, `./main`)
184193
185194
@LIA.dotnet
@@ -211,6 +220,18 @@ window.CodeRunner.init("wss://ancient-hollows-41316.herokuapp.com/")
211220
@LIA.eval(`["Program.fs", "project.fsproj"]`, `dotnet build -nologo`, `dotnet run`)
212221
@end
213222
223+
@LIA.qsharp
224+
```xml -project.csproj
225+
<Project Sdk="Microsoft.Quantum.Sdk/0.28.302812">
226+
<PropertyGroup>
227+
<OutputType>Exe</OutputType>
228+
<TargetFramework>net6.0</TargetFramework>
229+
</PropertyGroup>
230+
</Project>
231+
```
232+
@LIA.eval(`["Program.qs", "project.csproj"]`, `dotnet build -nologo`, `dotnet run`)
233+
@end
234+
214235
@LIA.eval: @LIA.eval_(false,`@0`,@1,@2,@3)
215236
216237
@LIA.evalWithDebug: @LIA.eval_(true,`@0`,@1,@2,@3)
@@ -325,7 +346,7 @@ CodeRunner.handle(uid, function (msg) {
325346
if (msg.videos) {
326347
for(let i = 0; i < msg.videos.length; i++) {
327348
console.html("<hr/>", msg.videos[i].file)
328-
console.html("<video title='" + msg.videos[i].file + "' src='" + msg.videos[i].data + "'></video>")
349+
console.html("<video controls style='width:100%' title='" + msg.videos[i].file + "' src='" + msg.videos[i].data + "'></video>")
329350
}
330351
}
331352
@@ -512,7 +533,7 @@ _start: mov rax, 1 ; system call for write
512533
section .data
513534
message: db "Hello, World", 10 ; note the newline at the end
514535
```
515-
@LIA.eval(`["main.asm"]`, `nasm -felf64 main.asm && ld main.o`, `./a.out`)
536+
@LIA.nasm
516537

517538
### C : `@LIA.c`
518539

@@ -696,6 +717,42 @@ For more information, you can visit the [COBOL programming language Wikipedia pa
696717
```
697718
@LIA.cobol
698719

720+
### Coq : `@LIA.coq`
721+
722+
Coq is an interactive theorem prover and functional programming language developed by the French Institute for Research in Computer Science and Automation (INRIA). It is designed for formal verification of mathematical proofs and software programs, allowing developers to write and verify complex mathematical statements and algorithms. Coq is based on the Calculus of Inductive Constructions (CIC), a powerful type theory that supports dependent types, higher-order logic, and formal reasoning. The backend here uses the Coq compiler to execute Coq code, ensuring correctness and reliability of the proofs and programs.
723+
724+
For more information, you can visit the [Coq programming language Wikipedia page](https://en.wikipedia.org/wiki/Coq).
725+
726+
---
727+
728+
```coq
729+
Require Import ZArith.
730+
Open Scope Z_scope.
731+
Goal forall a b c:Z,
732+
(a + b + c) ^ 2 =
733+
a * a + b ^ 2 + c * c + 2 * a * b + 2 * a * c + 2 * b * c.
734+
intros; ring.
735+
Qed.
736+
```
737+
@LIA.coq
738+
739+
### D : `@LIA.d`
740+
741+
D is a systems programming language with C-like syntax and static typing. It combines the power and performance of C and C++ with the safety and expressiveness of modern programming languages like Rust and Swift. D is designed for writing efficient, maintainable, and scalable software, making it ideal for system programming, game development, and high-performance applications. The backend here uses the DMD (Digital Mars D) compiler to compile D code, ensuring fast and reliable execution.
742+
743+
For more information, you can visit the [D programming language Wikipedia page](https://en.wikipedia.org/wiki/D_%28programming_language%29).
744+
745+
---
746+
747+
```d
748+
import std.stdio;
749+
750+
void main()
751+
{
752+
writeln("Hello, World!");
753+
}
754+
```
755+
@LIA.d
699756

700757
### Elixir : `@LIA.elixir`
701758

@@ -847,6 +904,27 @@ main = putStrLn "hello world"
847904
```
848905
@LIA.haskell_withShell
849906

907+
908+
### IO : `@LIA.io`
909+
910+
Io is a prototype-based, object-oriented programming language that was developed by Steve Dekorte in the early 2000s. It is known for its simplicity, minimalism, and powerful message-passing model, making it ideal for building dynamic and interactive applications. Io is inspired by Smalltalk, Self, and Lisp, and it provides a flexible and extensible environment for creating domain-specific languages and frameworks. The backend here uses the Io interpreter to execute Io code, ensuring fast and efficient execution.
911+
912+
For more information, you can visit the [Io programming language Wikipedia page](https://en.wikipedia.org/wiki/Io_%28programming_language%29).
913+
914+
---
915+
916+
``` io
917+
"Hello, world!" println
918+
```
919+
@LIA.io
920+
921+
As an alternative, you can also run it within an interactive REPL shell.
922+
923+
``` io
924+
"Hello, world!" println
925+
```
926+
@LIA.io_withShell
927+
850928
### Java : `@LIA.java`
851929

852930
Java is a widely-used, class-based, object-oriented programming language that was developed by Sun Microsystems (now owned by Oracle) and released in 1995. It is designed to be platform-independent, meaning that compiled Java code can run on any platform that supports the Java Virtual Machine (JVM). Java is known for its portability, scalability, and strong memory management features, making it ideal for building large-scale enterprise applications, Android apps, and web services. The language's syntax is similar to C++, but it simplifies many complex features, making it easier to learn and use. The backend here uses `jdk-21_linux-x64_bin`, the latest version of the Java Development Kit (JDK), to compile and execute Java code, ensuring cutting-edge performance and compatibility with modern Java features.
@@ -991,6 +1069,33 @@ println("result 2: ", quad2)
9911069
```
9921070
@LIA.julia_withShell
9931071

1072+
### Kotlin : `@LIA.kotlin`
1073+
1074+
Kotlin is a modern, statically typed programming language developed by JetBrains in 2011. It is designed to be fully interoperable with Java and runs on the Java Virtual Machine (JVM). Kotlin combines object-oriented and functional programming features, making it a versatile language for building Android apps, web services, and enterprise applications. It is known for its conciseness, safety features, and expressive syntax, which reduce boilerplate code and improve developer productivity. The backend here uses the Kotlin compiler to compile Kotlin code, ensuring compatibility with the JVM and access to the Java ecosystem.
1075+
1076+
For more information, you can visit the [Kotlin programming language Wikipedia page](https://en.wikipedia.org/wiki/Kotlin_%28programming_language%29).
1077+
1078+
---
1079+
1080+
```kotlin
1081+
fun main() {
1082+
println("Hello, World!")
1083+
}
1084+
```
1085+
@LIA.kotlin
1086+
1087+
### Lua : `@LIA.lua`
1088+
1089+
Lua is a lightweight, high-level programming language designed for embedded systems, scripting, and game development. It was developed in the early 1990s by Roberto Ierusalimschy, Luiz Henrique de Figueiredo, and Waldemar Celes at the Pontifical Catholic University of Rio de Janeiro. Lua is known for its simplicity, efficiency, and extensibility, making it ideal for integrating with other languages and platforms. It provides a powerful set of features, including first-class functions, coroutines, and metatables, which enable developers to build flexible and scalable applications. The backend here uses the Lua interpreter to execute Lua code, ensuring fast and reliable execution.
1090+
1091+
For more information, you can visit the [Lua programming language Wikipedia page](https://en.wikipedia.org/wiki/Lua_%28programming_language%29).
1092+
1093+
---
1094+
1095+
```lua
1096+
print("Hello, world!")
1097+
```
1098+
@LIA.lua
9941099

9951100
### Nim : `@LIA.nim`
9961101

@@ -1019,6 +1124,19 @@ print_string "Hello, world!\n";;
10191124
```
10201125
@LIA.ocaml
10211126

1127+
### Octave : `@LIA.octave`
1128+
1129+
Octave is a high-level, interpreted programming language primarily used for numerical computations and data analysis. It is compatible with MATLAB and provides a similar syntax and functionality, making it a popular choice for scientific computing, machine learning, and signal processing. Octave supports matrix operations, plotting, and algorithm development, allowing users to prototype and test complex mathematical models efficiently. The backend here uses the Octave interpreter to execute Octave code, ensuring compatibility with MATLAB scripts and toolboxes.
1130+
1131+
For more information, you can visit the [Octave programming language Wikipedia page](https://en.wikipedia.org/wiki/GNU_Octave).
1132+
1133+
---
1134+
1135+
```octave
1136+
disp("Hello, world!")
1137+
```
1138+
@LIA.eval(`["main.m"]`, `none`, `octave --no-window-system main.m`)
1139+
10221140
### Pascal : `@LIA.pascal`
10231141

10241142
Pascal is a high-level, procedural programming language developed by Niklaus Wirth in the late 1960s. It was designed to encourage good programming practices and provide a structured approach to software development. Pascal is known for its readability, simplicity, and strong typing, making it ideal for teaching programming concepts and developing reliable software. It introduced many features that are now common in modern programming languages, such as block structures, data structures, and modular programming. The backend here uses the Free Pascal compiler to compile Pascal code, ensuring compatibility and efficient execution.
@@ -1064,6 +1182,28 @@ my $x = 42;
10641182
```
10651183
@LIA.perl_withShell
10661184

1185+
### PostScript : `@LIA.postscript`
1186+
1187+
PostScript is a page description language developed by Adobe Systems in the early 1980s. It is used primarily in the printing and graphics industries to describe the layout and appearance of documents, images, and other visual content. PostScript is known for its flexibility, scalability, and device independence, making it ideal for generating high-quality output on a wide range of printers and displays. It uses a stack-based programming model, where operations are performed by pushing and popping values on a data stack. The backend here uses the Ghostscript interpreter to execute PostScript code, ensuring compatibility and efficient rendering.
1188+
1189+
For more information, you can visit the [PostScript programming language Wikipedia page](https://en.wikipedia.org/wiki/PostScript).
1190+
1191+
---
1192+
1193+
```postscript
1194+
%!PS
1195+
<< /PageSize [420 100] >> setpagedevice % Set page size to A5
1196+
/Courier % name the desired font
1197+
20 selectfont % choose the size in points and establish
1198+
% the font as the current one
1199+
72 50 moveto % position the current point at
1200+
% coordinates 72, 500 (the origin is at the
1201+
% lower-left corner of the page)
1202+
(Hello world!) show % paint the text in parentheses
1203+
showpage % print all on the page
1204+
```
1205+
@LIA.postscript
1206+
10671207
### Prolog : `@LIA.prolog`
10681208

10691209
Prolog is a logic programming language that was developed in the early 1970s by Alain Colmerauer and Robert Kowalski. It is based on formal logic and provides a declarative approach to problem-solving, where programs are defined as sets of logical rules and facts. Prolog is particularly well-suited for tasks involving symbolic reasoning, artificial intelligence, and natural language processing. It is known for its pattern matching and backtracking capabilities, which allow for efficient search and inference. The backend here uses the SWI-Prolog interpreter to execute Prolog code, ensuring compatibility and efficient execution.
@@ -1349,6 +1489,50 @@ println("Hello World")
13491489
```
13501490
@LIA.v_withShell
13511491

1492+
### Verilog : `@LIA.verilog`
1493+
1494+
Verilog is a hardware description language (HDL) used for designing digital circuits and systems. It was first introduced in the 1980s and has since become a standard language for modeling and simulating digital circuits. Verilog is known for its simplicity, expressiveness, and support for both behavioral and structural modeling of hardware components. It is widely used in the semiconductor industry for designing integrated circuits, field-programmable gate arrays (FPGAs), and other digital systems. The backend here uses the Icarus Verilog simulator to execute Verilog code, ensuring compatibility and efficient simulation of digital circuits.
1495+
1496+
For more information, you can visit the [Verilog programming language Wikipedia page](https://en.wikipedia.org/wiki/Verilog).
1497+
1498+
---
1499+
1500+
```verilog
1501+
module hello_world;
1502+
initial begin
1503+
$display("Hello, world!");
1504+
$finish;
1505+
end
1506+
endmodule
1507+
```
1508+
@LIA.verilog
1509+
1510+
### VHDL : `@LIA.vhdl`
1511+
1512+
VHDL (VHSIC Hardware Description Language) is a hardware description language used for designing digital circuits and systems. It was developed in the 1980s as part of the U.S. Department of Defense's VHSIC (Very High-Speed Integrated Circuit) program. VHDL is known for its versatility, expressiveness, and support for both behavioral and structural modeling of hardware components. It is widely used in the semiconductor industry for designing integrated circuits, field-programmable gate arrays (FPGAs), and other digital systems. The backend here uses the GHDL simulator to execute VHDL code, ensuring compatibility and efficient simulation of digital circuits.
1513+
1514+
For more information, you can visit the [VHDL programming language Wikipedia page](https://en.wikipedia.org/wiki/VHDL).
1515+
1516+
---
1517+
1518+
```vhdl
1519+
library ieee;
1520+
use ieee.std_logic_1164.all;
1521+
1522+
entity hello_world is
1523+
end hello_world;
1524+
1525+
architecture rtl of hello_world is
1526+
begin
1527+
process
1528+
begin
1529+
report "Hello, world!";
1530+
wait;
1531+
end process;
1532+
end rtl;
1533+
```
1534+
@LIA.vhdl(hello_world)
1535+
13521536
### Zig : `@LIA.zig`
13531537

13541538
Zig is a general-purpose, statically typed programming language designed for robustness, optimality, and clarity. It was first released in 2016 by Andrew Kelley. Zig aims to offer a modern alternative to C with improved safety and performance features, including manual memory management, a comprehensive standard library, and support for cross-compilation. The language provides fine-grained control over system resources and emphasizes compile-time checks and correctness. Zig's syntax is designed to be simple and expressive, making it suitable for systems programming, embedded development, and performance-critical applications. The backend here uses the Zig compiler to compile Zig code, ensuring efficient execution and cross-platform compatibility.

docker-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@ services:
44
build: .
55
image: liascript/coderunner:latest
66
ports:
7-
- '8001:8000'
7+
- '4000:8000'
88
environment:
99
- CODERUNNER_HOST=0.0.0.0

0 commit comments

Comments
 (0)