Skip to content

Commit 309fed7

Browse files
authored
Odin language has been added. (#497)
1 parent 5fa573c commit 309fed7

File tree

4 files changed

+28
-7
lines changed

4 files changed

+28
-7
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -305,6 +305,7 @@ have some inaccuracies in number parsing:
305305
| 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> |
306306
| 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> |
307307
| 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> |
308+
| 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> |
308309
| 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> |
309310
| 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> |
310311
| 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> |
@@ -447,6 +448,7 @@ Base Docker image: Debian GNU/Linux trixie/sid
447448
| Nim | 2.2.0 |
448449
| Node.js | v23.1.0 |
449450
| OCaml | 5.2.0 |
451+
| Odin | dev-2024-11-nightly |
450452
| PHP | 8.2.24 |
451453
| Perl | v5.40.0 |
452454
| Python | 3.12.6 |

docker/Dockerfile

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -286,6 +286,17 @@ RUN curl -Lo v_linux.zip \
286286
&& rm v_linux.zip
287287
ENV PATH="/root/bin/v/:${PATH}"
288288

289+
# https://github.com/odin-lang/Odin/releases
290+
ARG ODIN=2024-11
291+
RUN curl -Lo odin-linux-amd64-dev-$ODIN.zip \
292+
https://github.com/odin-lang/Odin/releases/download/dev-$ODIN/odin-linux-amd64-dev-$ODIN.zip \
293+
&& unzip -q odin-linux-amd64-dev-$ODIN.zip \
294+
&& tar xf dist.tar.gz \
295+
&& rm dist.tar.gz odin-linux-amd64-dev-$ODIN.zip
296+
# NOTE: the naming is inconsistent as resulting release archive name contains actual date
297+
# So we may look into better ways to obtain packages, or use nightly directly
298+
ENV PATH="/root/bin/odin-linux-amd64-nightly+$ODIN-04/:${PATH}"
299+
289300
# https://github.com/vlang/vsl and dependencies
290301
# TODO - Install using specific VSL version as ARG
291302
RUN v install vsl

docker/versions.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,7 @@ class Test {
118118
'Clojure' => -> { `clojure -M -e '(clojure-version)'` },
119119
'Zig' => -> { `zig version` },
120120
'Idris 2' => -> { `idris2 --version`.split[-1] },
121+
'Odin' => -> { `odin version`.split[-1] },
121122
}.freeze
122123

123124
def pad(num, str, padstr)

json/test.odin

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,21 @@ calc :: proc(s: string) -> Coordinate {
2626
panic(fmt.tprintf("%v", err))
2727
}
2828

29-
coord := Coordinate{}
30-
for c in j.coordinates {
31-
coord.x += c.x
32-
coord.y += c.y
33-
coord.z += c.z
29+
x := 0.0
30+
y := 0.0
31+
z := 0.0
32+
len := 0.0
33+
for coord in j.coordinates {
34+
x += coord.x
35+
y += coord.y
36+
z += coord.z
37+
len += 1
38+
}
39+
return Coordinate{
40+
x = x / len,
41+
y = y / len,
42+
z = z / len,
3443
}
35-
36-
return coord
3744
}
3845

3946
main :: proc() {

0 commit comments

Comments
 (0)