Skip to content

Commit 24b8fad

Browse files
Session 1: add C, C++, Rust, Go, JavaScript, Java, Ruby and Perl
Ten languages verified, 87/87 vectors each. Compiled languages use multi-stage builds and record the compiler version at build time. C, C++, Rust and Java include their own small JSON parsers; the others use their standard libraries. Closes #1, closes #2, closes #3, closes #4, closes #8, closes #9, closes #10, closes #11 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 parent 0463f7a commit 24b8fad

46 files changed

Lines changed: 1979 additions & 14 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎LANGUAGES.md‎

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,18 @@
22

33
## Implementations
44

5-
| Language | Family | Directory | Implementation |
6-
|----------|-----------|----------------------------------------|----------------|
7-
| PHP | scripting | [`languages/php`](languages/php) | native |
8-
| Python | scripting | [`languages/python`](languages/python) | native |
5+
| Language | Family | Directory | Implementation |
6+
|---|---|---|---|
7+
| C | general-purpose | [`languages/c`](languages/c) | native |
8+
| C++ | general-purpose | [`languages/cpp`](languages/cpp) | native |
9+
| Go | general-purpose | [`languages/go`](languages/go) | native |
10+
| Java | jvm | [`languages/java`](languages/java) | native |
11+
| JavaScript | scripting | [`languages/javascript`](languages/javascript) | native |
12+
| Perl | scripting | [`languages/perl`](languages/perl) | native |
13+
| PHP | scripting | [`languages/php`](languages/php) | native |
14+
| Python | scripting | [`languages/python`](languages/python) | native |
15+
| Ruby | scripting | [`languages/ruby`](languages/ruby) | native |
16+
| Rust | general-purpose | [`languages/rust`](languages/rust) | native |
917

1018
Verification status is computed by CI on every run (`./elc test`) and recorded
1119
in `reports/report.json`. Only `verified` implementations count.

‎README.md‎

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ by the community in every language that can run it, all checked by the same
99
test suite.**
1010

1111
[![Verify implementations](https://github.com/openapi/every-language-fiscal-code/actions/workflows/verify.yml/badge.svg)](https://github.com/openapi/every-language-fiscal-code/actions/workflows/verify.yml)
12-
[![Verified languages](https://img.shields.io/badge/verified%20languages-2%20%2F%2064-blue)](LANGUAGES.md)
12+
[![Verified languages](https://img.shields.io/badge/verified%20languages-10%20%2F%2064-blue)](LANGUAGES.md)
1313
[![Test vectors](https://img.shields.io/badge/test%20vectors-87-brightgreen)](test-vectors/)
1414
[![Spec](https://img.shields.io/badge/spec-v0.1.0-orange)](SPECIFICATION.md)
1515
[![License: MIT](https://img.shields.io/badge/license-MIT-lightgrey)](LICENSE)
@@ -39,10 +39,10 @@ Our first goal is **64 languages**, then **99**, **128**, **256** and beyond.
3939
See [Why 64?](#-why-64) and the [roadmap](ROADMAP.md).
4040

4141
```text
42-
64 2⁶ ▋░░░░░░░░░░░░░░░░░░░ 2 / 64 ← we are here
43-
99 🍺 ░░░░░░░░░░░░░░░░░░░░ 2 / 99
44-
128 2⁷ ░░░░░░░░░░░░░░░░░░░░ 2 / 128
45-
256 2⁸ ░░░░░░░░░░░░░░░░░░░░ 2 / 256
42+
64 2⁶ ███▏░░░░░░░░░░░░░░░░ 10 / 64 ← we are here
43+
99 🍺 ██░░░░░░░░░░░░░░░░░░ 10 / 99
44+
128 2⁷ █▌░░░░░░░░░░░░░░░░░░ 10 / 128
45+
256 2⁸ ▊░░░░░░░░░░░░░░░░░░░ 10 / 256
4646
```
4747

4848
## 🔢 Why 64?
@@ -97,10 +97,10 @@ The full rules are in [SPECIFICATION.md](SPECIFICATION.md).
9797

9898
| | Language | | Language | | Language | | Language |
9999
|---|---|---|---|---|---|---|---|
100-
| ✅ | [Python](languages/python) | 🙋 | C | 🙋 | Rust | 🙋 | Prolog |
101-
| ✅ | [PHP](languages/php) | 🙋 | JavaScript | 🙋 | Java | 🙋 | Haskell |
102-
| 🙋 | COBOL | 🙋 | FORTRAN | 🙋 | Go | 🙋 | Ruby |
103-
| 🙋 | Common Lisp | 🙋 | Erlang | 🙋 | Ada | 🙋 | *…your favourite* |
100+
| ✅ | [C](languages/c) | ✅ | [C++](languages/cpp) | ✅ | [Go](languages/go) | ✅ | [Java](languages/java) |
101+
| ✅ | [JavaScript](languages/javascript) | ✅ | [Perl](languages/perl) | ✅ | [PHP](languages/php) | ✅ | [Python](languages/python) |
102+
| ✅ | [Ruby](languages/ruby) | ✅ | [Rust](languages/rust) | 🙋 | Haskell | 🙋 | Prolog |
103+
| 🙋 | COBOL | 🙋 | FORTRAN | 🙋 | Common Lisp | 🙋 | *…your favourite* |
104104

105105
✅ verified · 🙋 **wanted:** [pick an open issue](https://github.com/openapi/every-language-fiscal-code/issues?q=is%3Aissue+is%3Aopen+label%3Anew-language) or [propose another language](https://github.com/openapi/every-language-fiscal-code/issues/new?template=new-language.yml)
106106

‎ROADMAP.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ Community Pull Requests are welcome at any time and simply make us faster.
5454

5555
| Session | Languages | Total |
5656
|---|---|---|
57-
| 1 | ✅ Python, ✅ PHP, C, C++, Rust, Go, JavaScript, Java, Ruby, Perl | 10 |
57+
| 1 ✅ | ✅ Python, ✅ PHP, ✅ C, ✅ C++, ✅ Rust, ✅ Go, ✅ JavaScript, ✅ Java, ✅ Ruby, ✅ Perl | 10 |
5858
| 2 | C#, Kotlin, Scala, Lua, Swift, Dart, Haskell, OCaml, Elixir, Erlang | 20 |
5959
| 3 | F#, Clojure, Common Lisp, Scheme, Racket, Prolog, Julia, R, Tcl, Groovy | 30 |
6060
| 4 | Bash, AWK, COBOL, FORTRAN, Ada, Pascal, D, Nim, Zig, Crystal | 40 |

‎languages/c/Dockerfile‎

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
FROM alpine:3.20 AS build
2+
RUN apk add --no-cache gcc musl-dev
3+
WORKDIR /src
4+
COPY fiscal_code.c .
5+
RUN gcc -std=c99 -O2 -Wall -Wextra -pedantic -Werror -o fiscal_code fiscal_code.c \
6+
&& gcc --version | head -1 > VERSION
7+
8+
FROM alpine:3.20
9+
WORKDIR /app
10+
COPY --from=build /src/fiscal_code /src/VERSION ./
11+
COPY run.sh ./
12+
RUN chmod +x run.sh
13+
CMD ["./run.sh"]

‎languages/c/README.md‎

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# C
2+
3+
Implementation of the Italian Fiscal Code in C99, using only the standard
4+
library. C has no standard JSON support, so the source includes a small
5+
recursive-descent JSON parser.
6+
7+
- Source: [`fiscal_code.c`](fiscal_code.c)
8+
- Toolchain: GCC on `alpine:3.20`, compiled with `-Wall -Wextra -pedantic -Werror`
9+
(see [`Dockerfile`](Dockerfile))
10+
11+
```bash
12+
./elc test c
13+
```

0 commit comments

Comments
 (0)