Skip to content

Commit f7c0d8a

Browse files
committed
Add "Wren" lang
1 parent e09aed8 commit f7c0d8a

8 files changed

Lines changed: 54 additions & 2 deletions

File tree

‎config/langs.toml‎

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -848,6 +848,23 @@ endfo
848848
w
849849
'''
850850

851+
[Wren]
852+
size = '4.09 MiB'
853+
version = '0.4.0'
854+
website = 'https://wren.io'
855+
example = '''
856+
import "os" for Process
857+
858+
// Printing
859+
System.print("Hello, World!")
860+
861+
// Looping
862+
for (i in 0..9) System.print(i)
863+
864+
// Accessing arguments
865+
for (a in Process.arguments) System.print(a)
866+
'''
867+
851868
[Zig]
852869
size = '262 MiB'
853870
version = '0.9.1'

‎css/golfer/holes.css‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ input.sql:not(:checked) ~ .sql,
8787
input.swift:not(:checked) ~ .swift,
8888
input.v:not(:checked) ~ .v,
8989
input.viml:not(:checked) ~ .viml,
90+
input.wren:not(:checked) ~ .wren,
9091
input.zig:not(:checked) ~ .zig { display: none }
9192

9293
input:checked + label {
@@ -112,7 +113,7 @@ main svg:nth-of-type(2) {
112113

113114
@media (min-width: 95rem) {
114115
/* Increase this number when adding a language. */
115-
main { grid-template-columns: 6fr repeat(41, 1fr) }
116+
main { grid-template-columns: 6fr repeat(42, 1fr) }
116117

117118
main a { height: 1.9rem }
118119

‎db/a-schema.sql‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ CREATE TYPE lang AS ENUM (
5050
'golfscript', 'haskell', 'hexagony', 'j', 'java', 'javascript', 'julia',
5151
'k', 'lisp', 'lua', 'nim', 'pascal', 'perl', 'php', 'powershell',
5252
'prolog', 'python', 'raku', 'ruby', 'rust', 'sed', 'sql', 'swift', 'v',
53-
'viml', 'zig'
53+
'viml', 'wren', 'zig'
5454
);
5555

5656
CREATE TYPE medal AS ENUM ('diamond', 'gold', 'silver', 'bronze');

‎docker/dev.Dockerfile‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ COPY --from=codegolf/lang-fish ["/", "/langs/fish/rootfs/" ] # 4.99 M
4141
COPY --from=codegolf/lang-j ["/", "/langs/j/rootfs/" ] # 4.84 MiB
4242
COPY --from=codegolf/lang-brainfuck ["/", "/langs/brainfuck/rootfs/" ] # 4.57 MiB
4343
COPY --from=codegolf/lang-cobol ["/", "/langs/cobol/rootfs/" ] # 4.09 MiB
44+
COPY --from=codegolf/lang-wren ["/", "/langs/wren/rootfs/" ] # 4.09 MiB
4445
COPY --from=codegolf/lang-c ["/", "/langs/c/rootfs/" ] # 1.61 MiB
4546
COPY --from=codegolf/lang-bash ["/", "/langs/bash/rootfs/" ] # 1.19 MiB
4647
COPY --from=codegolf/lang-sql ["/", "/langs/sql/rootfs/" ] # 1.11 MiB

‎docker/live.Dockerfile‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ COPY --from=codegolf/lang-fish ["/", "/langs/fish/rootfs/" ] # 4.99 M
5454
COPY --from=codegolf/lang-j ["/", "/langs/j/rootfs/" ] # 4.84 MiB
5555
COPY --from=codegolf/lang-brainfuck ["/", "/langs/brainfuck/rootfs/" ] # 4.57 MiB
5656
COPY --from=codegolf/lang-cobol ["/", "/langs/cobol/rootfs/" ] # 4.09 MiB
57+
COPY --from=codegolf/lang-wren ["/", "/langs/wren/rootfs/" ] # 4.09 MiB
5758
COPY --from=codegolf/lang-c ["/", "/langs/c/rootfs/" ] # 1.61 MiB
5859
COPY --from=codegolf/lang-bash ["/", "/langs/bash/rootfs/" ] # 1.19 MiB
5960
COPY --from=codegolf/lang-sql ["/", "/langs/sql/rootfs/" ] # 1.11 MiB

‎langs/wren/Dockerfile‎

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
FROM debian:bullseye-slim as builder
2+
3+
RUN apt-get update && apt-get install -y curl libarchive-tools
4+
5+
RUN curl -L https://github.com/wren-lang/wren-cli/releases/download/0.4.0/wren-cli-linux-0.4.0.zip | bsdtar -xf -
6+
7+
RUN chmod +x /wren-cli-linux-0.4.0/wren_cli
8+
9+
FROM codegolf/lang-base
10+
11+
COPY --from=0 /bin/cat /bin/sh /bin/
12+
COPY --from=0 /lib/x86_64-linux-gnu/libc.so.6 \
13+
/lib/x86_64-linux-gnu/libdl.so.2 \
14+
/lib/x86_64-linux-gnu/libm.so.6 \
15+
/lib/x86_64-linux-gnu/libpthread.so.0 /lib/x86_64-linux-gnu/
16+
COPY --from=0 /lib64/ld-linux-x86-64.so.2 /lib64/
17+
COPY --from=0 /wren-cli-linux-0.4.0/wren_cli /usr/bin/
18+
19+
COPY wren /usr/bin/
20+
21+
ENTRYPOINT ["wren"]
22+
23+
CMD ["--version"]

‎langs/wren/wren‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#!/bin/sh -e
2+
3+
[ "$1" = "--version" ] && exec wren_cli "$@"
4+
5+
cat - > /tmp/code.wren
6+
7+
shift
8+
exec wren_cli /tmp/code.wren "$@"

‎svg/wren.svg‎

Lines changed: 1 addition & 0 deletions
Loading

0 commit comments

Comments
 (0)