Skip to content

Odin language has been added. #497

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,7 @@ have some inaccuracies in number parsing:
| C++/g++ (Boost.PropertyTree) | 2.515<sub>±0.009</sub> | 113.40<sub>±00.06</sub> + 1439.88<sub>±00.00</sub> | 107.37<sub>±01.05</sub> |
| Rust (jq) | 2.597<sub>±0.006</sub> | 113.50<sub>±00.06</sub> + 903.47<sub>±01.19</sub> | 108.44<sub>±00.97</sub> |
| C++/clang++ (Boost.PropertyTree) | 2.625<sub>±0.007</sub> | 195.14<sub>±00.06</sub> + 1232.62<sub>±00.00</sub> | 112.22<sub>±00.99</sub> |
| Odin | 2.824<sub>±0.003</sub> | 111.44<sub>±00.06</sub> + 20.00<sub>±00.00</sub> | 117.93<sub>±00.75</sub> |
| Ruby/jruby | 2.869<sub>±0.026</sub> | 469.56<sub>±03.09</sub> + 890.16<sub>±23.07</sub> | 146.96<sub>±02.03</sub> |
| Vala/gcc | 3.089<sub>±0.009</sub> | 115.31<sub>±00.06</sub> + 980.00<sub>±00.00</sub> | 131.83<sub>±00.56</sub> |
| Vala/clang | 3.094<sub>±0.006</sub> | 115.38<sub>±00.00</sub> + 980.00<sub>±00.00</sub> | 132.11<sub>±00.59</sub> |
Expand Down Expand Up @@ -447,6 +448,7 @@ Base Docker image: Debian GNU/Linux trixie/sid
| Nim | 2.2.0 |
| Node.js | v23.1.0 |
| OCaml | 5.2.0 |
| Odin | dev-2024-11-nightly |
| PHP | 8.2.24 |
| Perl | v5.40.0 |
| Python | 3.12.6 |
Expand Down
11 changes: 11 additions & 0 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,17 @@ RUN curl -Lo v_linux.zip \
&& rm v_linux.zip
ENV PATH="/root/bin/v/:${PATH}"

# https://github.com/odin-lang/Odin/releases
ARG ODIN=2024-11
RUN curl -Lo odin-linux-amd64-dev-$ODIN.zip \
https://github.com/odin-lang/Odin/releases/download/dev-$ODIN/odin-linux-amd64-dev-$ODIN.zip \
&& unzip -q odin-linux-amd64-dev-$ODIN.zip \
&& tar xf dist.tar.gz \
&& rm dist.tar.gz odin-linux-amd64-dev-$ODIN.zip
# NOTE: the naming is inconsistent as resulting release archive name contains actual date
# So we may look into better ways to obtain packages, or use nightly directly
ENV PATH="/root/bin/odin-linux-amd64-nightly+$ODIN-04/:${PATH}"

# https://github.com/vlang/vsl and dependencies
# TODO - Install using specific VSL version as ARG
RUN v install vsl
Expand Down
1 change: 1 addition & 0 deletions docker/versions.rb
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ class Test {
'Clojure' => -> { `clojure -M -e '(clojure-version)'` },
'Zig' => -> { `zig version` },
'Idris 2' => -> { `idris2 --version`.split[-1] },
'Odin' => -> { `odin version`.split[-1] },
}.freeze

def pad(num, str, padstr)
Expand Down
21 changes: 14 additions & 7 deletions json/test.odin
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,21 @@ calc :: proc(s: string) -> Coordinate {
panic(fmt.tprintf("%v", err))
}

coord := Coordinate{}
for c in j.coordinates {
coord.x += c.x
coord.y += c.y
coord.z += c.z
x := 0.0
y := 0.0
z := 0.0
len := 0.0
for coord in j.coordinates {
x += coord.x
y += coord.y
z += coord.z
len += 1
}
return Coordinate{
x = x / len,
y = y / len,
z = z / len,
}

return coord
}

main :: proc() {
Expand Down