Skip to content

Commit

Permalink
Add Uiua language (code-golf#1173)
Browse files Browse the repository at this point in the history
* uiua work in progress

* fix merge error

* fix uiua example code

* add todo to dockerfile

* Fix container, add svg, set experimental

* Fix svg colour

* Pin uiua version

* Tidy up dockerfile toml and svg
  • Loading branch information
KatieLG authored Jun 1, 2024
1 parent 122e6bd commit 71747af
Show file tree
Hide file tree
Showing 7 changed files with 38 additions and 1 deletion.
16 changes: 16 additions & 0 deletions config/langs.toml
Original file line number Diff line number Diff line change
Expand Up @@ -1101,6 +1101,22 @@ Hello, World!
\repeat
'''

[Uiua]
experiment = 1115
size = '28.5 MiB'
version = '0.10.3'
website = 'https://www.uiua.org'
example = '''
# Printing
&p"Hello, World!"
# Looping
∵&p⇡10
# Accessing arguments
∵&p↘1&args
'''

[V]
size = '60.2 MiB'
version = '0.4.6'
Expand Down
1 change: 1 addition & 0 deletions docker/dev.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ COPY --from=codegolf/lang-prolog ["/", "/langs/prolog/rootfs/" ] # 49.2 M
COPY --from=codegolf/lang-javascript ["/", "/langs/javascript/rootfs/"] # 39.6 MiB
COPY --from=codegolf/lang-lisp ["/", "/langs/lisp/rootfs/" ] # 31.1 MiB
COPY --from=codegolf/lang-pascal ["/", "/langs/pascal/rootfs/" ] # 31.1 MiB
COPY --from=codegolf/lang-uiua ["/", "/langs/uiua/rootfs/" ] # 28.5 MiB
COPY --from=codegolf/lang-golfscript ["/", "/langs/golfscript/rootfs/"] # 27.9 MiB
COPY --from=codegolf/lang-ruby ["/", "/langs/ruby/rootfs/" ] # 27.8 MiB
COPY --from=codegolf/lang-viml ["/", "/langs/viml/rootfs/" ] # 24.3 MiB
Expand Down
1 change: 1 addition & 0 deletions docker/live.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ COPY --from=codegolf/lang-prolog ["/", "/langs/prolog/rootfs/" ] # 49.2 M
COPY --from=codegolf/lang-javascript ["/", "/langs/javascript/rootfs/"] # 39.6 MiB
COPY --from=codegolf/lang-lisp ["/", "/langs/lisp/rootfs/" ] # 31.1 MiB
COPY --from=codegolf/lang-pascal ["/", "/langs/pascal/rootfs/" ] # 31.1 MiB
COPY --from=codegolf/lang-uiua ["/", "/langs/uiua/rootfs/" ] # 28.5 MiB
COPY --from=codegolf/lang-golfscript ["/", "/langs/golfscript/rootfs/"] # 27.9 MiB
COPY --from=codegolf/lang-ruby ["/", "/langs/ruby/rootfs/" ] # 27.8 MiB
COPY --from=codegolf/lang-viml ["/", "/langs/viml/rootfs/" ] # 24.3 MiB
Expand Down
4 changes: 3 additions & 1 deletion hole/play.go
Original file line number Diff line number Diff line change
Expand Up @@ -434,6 +434,8 @@ func play(
run.Stderr = `Quine in TeX must have at least one '\' character.`
return nil
}
case "uiua":
cmd.Args = []string{"/usr/bin/uiua", "eval", code}
default:
cmd.Args = []string{"/usr/bin/" + lang.ID, "-"}
}
Expand All @@ -458,7 +460,7 @@ func play(
// Code
switch lang.ID {
case "awk", "brainfuck", "elixir", "fish", "golfscript", "javascript",
"perl", "sed", "tex":
"perl", "sed", "tex", "uiua":
// For these langs, code is passed as an argument above.
case "k":
cmd.Stdin = strings.NewReader(preprocessKCode(hole.ID, code))
Expand Down
1 change: 1 addition & 0 deletions js/_codemirror.ts
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@ export const extensions = {
'swift': StreamLanguage.define(swift),
'tcl': StreamLanguage.define(tcl),
'tex': StreamLanguage.define(stex),
// TODO uiua
// TODO v
// TODO viml
'wren': wren,
Expand Down
15 changes: 15 additions & 0 deletions langs/uiua/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
FROM rust:1.78-bookworm as builder

RUN cargo install uiua --version 0.10.3

FROM codegolf/lang-base

COPY --from=0 /lib/x86_64-linux-gnu/libc.so.6 \
/lib/x86_64-linux-gnu/libgcc_s.so.1 \
/lib/x86_64-linux-gnu/libm.so.6 /lib/x86_64-linux-gnu/
COPY --from=0 /lib64/ld-linux-x86-64.so.2 /lib64/
COPY --from=0 /usr/local/cargo/bin/uiua /usr/bin/

ENTRYPOINT ["uiua"]

CMD ["--version"]
1 change: 1 addition & 0 deletions views/svg/uiua.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 71747af

Please sign in to comment.