Skip to content

Commit 5924bb4

Browse files
authored
Add examples for R and D languages
1 parent 989a72a commit 5924bb4

File tree

6 files changed

+26
-1
lines changed

6 files changed

+26
-1
lines changed

Diff for: .github/workflows/run.yaml

+6
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@ jobs:
1919
- name: Set up Bun
2020
uses: oven-sh/setup-bun@v1
2121

22+
- name: Set up D
23+
run: brew install ldc
24+
2225
- name: Set up Dart
2326
run: |
2427
brew tap dart-lang/dart
@@ -84,6 +87,9 @@ jobs:
8487
- name: Set up Python
8588
uses: actions/setup-python@v5
8689

90+
- name: Set up R
91+
run: brew install r
92+
8793
- name: Set up Racket
8894
run: brew install --cask racket
8995

Diff for: makefile

+2
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ print-versions:
2525
@echo '{'
2626
@printf '"hyperfine": "%s",\n' "$$(hyperfine --version)"
2727
@printf '"bash": "%s",\n' "$$(bash --version | head -n1)"
28+
@printf '"d": "%s",\n' "$$(rdmd --version | head -n1)"
2829
@printf '"dart": "%s",\n' "$$(dart --version | tr -d '"')"
2930
@printf '"dash": "%s",\n' \
3031
"$$(brew info --json dash \
@@ -57,6 +58,7 @@ print-versions:
5758
@printf '"perl": "%s",\n' "$$(perl --version | head -n2 | tail -n1)"
5859
@printf '"php": "%s",\n' "$$(php --version | head -n1)"
5960
@printf '"python": "%s",\n' "$$(python3 --version)"
61+
@printf '"r": "%s",\n' "$$(Rscript --version | head -n1)"
6062
@printf '"racket": "%s",\n' "$$(racket --version)"
6163
@printf '"roc": "%s",\n' "$$(roc --version | head -n1)"
6264
@printf '"ruby": "%s",\n' "$$(ruby --version)"

Diff for: readme.md

+5-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Benchmark for interpreted languages.
44

55
![Barchart for relative execution speed](shebang-scripts/today/chart.svg)
66

7-
The values for Rust, V, and Haskell are not really representative
7+
The values for Rust, V, Swift, D and Haskell are not really representative
88
as they are compiled on the first run
99
and Haskell unfortunately does not even cache the compiled binary.
1010

@@ -13,6 +13,7 @@ and Haskell unfortunately does not even cache the compiled binary.
1313

1414
- [Bash]
1515
- [Bun]
16+
- [D]
1617
- [Dart]
1718
- [Dash]
1819
- [Elixir]
@@ -41,6 +42,7 @@ and Haskell unfortunately does not even cache the compiled binary.
4142
- [Bun]
4243
- [Python]
4344
- [Python]
45+
- [R]
4446
- [Racket]
4547
- [Roc.roc]
4648
- [Ruby]
@@ -51,6 +53,7 @@ and Haskell unfortunately does not even cache the compiled binary.
5153

5254
[Bash]: https://www.gnu.org/software/bash/
5355
[Bun]: https://bun.sh/
56+
[D]: https://dlang.org
5457
[Dart]: https://dart.dev/
5558
[Dash]: https://wiki.archlinux.org/title/Dash
5659
[Deno]: https://deno.com/
@@ -72,6 +75,7 @@ and Haskell unfortunately does not even cache the compiled binary.
7275
[Perl]: https://www.perl.org/
7376
[PHP]: https://www.php.net/
7477
[Python]: https://www.python.org/
78+
[R]: https://www.r-project.org
7579
[Racket]: https://racket-lang.org/
7680
[Roc.roc]: https://roc-lang.org/
7781
[Ruby]: https://www.ruby-lang.org/

Diff for: shebang-scripts/today/_all_.txt

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
./bash
22
./bun
3+
./d.d
34
./dart
45
./dash
56
./elixir
@@ -19,6 +20,7 @@
1920
./perl
2021
./php
2122
./python
23+
./r
2224
./racket
2325
./rust-script
2426
# ./roc.roc - TODO: Fix roc on GitHub Actions

Diff for: shebang-scripts/today/d.d

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#!/usr/bin/env rdmd
2+
3+
import std.stdio: writeln;
4+
import std.datetime: Clock, SysTime, Date;
5+
6+
void main() {
7+
writeln(cast(Date)Clock.currTime());
8+
}

Diff for: shebang-scripts/today/r

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/usr/bin/env Rscript
2+
3+
cat(format(Sys.Date(), "%Y-%m-%d"), "\n")

0 commit comments

Comments
 (0)