Skip to content

Commit

Permalink
Crystal added
Browse files Browse the repository at this point in the history
  • Loading branch information
jabbalaci committed Jul 30, 2022
1 parent eb85ec5 commit b4a0b05
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 2 deletions.
21 changes: 21 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,27 @@ Note: clang is a bit better in this case.
[see source](cpp)


### Crystal

* Crystal 1.5.0 (2022-07-21); LLVM: 14.0.6; Default target: x86_64-pc-linux-gnu
* Benchmark date: 2022-07-30 [yyyy-mm-dd]

| Compilation | Runtime (sec) | EXE (bytes) | stripped EXE (bytes) |
|-----|:---:|:---:|:---:|
| `crystal build --release main.cr` | 3.624 ± 0.01 | 626,368 | 215,968 |

Notes:

* The runtime is excellent, comparable to C.
* The source code is almost identical to the Ruby source code.
* The build time in release mode is very slow. It was 12.8 seconds
on my machine.

See https://crystal-lang.org for more info about this language.

[see source](crystal)


### D

* DMD64 D Compiler v2.100.0
Expand Down
11 changes: 11 additions & 0 deletions _automation/crystal.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"section_name": "Crystal",
"compilers": ["crystal"],
"output_file": "main",
"table_headers": [
"Compilation",
"Runtime (sec)",
"EXE (bytes)",
"stripped EXE (bytes)"
]
}
2 changes: 1 addition & 1 deletion _automation/lib/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def get_version_string(name):
if name in ("lua", "luajit", "fpc"):
cmd = f"{name} -v"
return get_simple_cmd_output_lines(cmd)[0]
if name == "elixir":
if name in ("elixir", "crystal"):
cmd = f"{name} -v"
text = "; ".join([line for line in get_simple_cmd_output_lines(cmd) if line])
return text
Expand Down
8 changes: 7 additions & 1 deletion crystal/Makefile
Original file line number Diff line number Diff line change
@@ -1,2 +1,8 @@
build:
v1:
crystal build --release main.cr

strip:
strip -s main

clean:
rm main

0 comments on commit b4a0b05

Please sign in to comment.