I’ve found Vala to be a rather pleasant language to work with and would love to have it added for use in codingame challenges. It transpiles into C as part of compilation, although valac
itself is capable of invoking C compiler.
Proposed compilation options:
--target-glib=auto --pkg gio-2.0 --pkg gee-0.8
Justification:
-
--target-glib=auto
- we don’t care about resulting binary to be ABI-compatible with anything but build machine, so might as well reduce meaningless warnings from C compiler. -
--pkg gee-0.8
- a large library of collections. While it’s not directly a part of vala or glib, it’s still a de-facto standard one (valadoc even lists it as a core library alongside glib and similar fundamental libraries).
Possible additional flags:
-
--Xcc=-O2
- Vala relies very heavily on C compiler to do optimizations, so I’d suggest enabling what is considered a “reasonable” optimization level by most distros out there. Although, given that it’s not default, and CodinGame’s history with lack of optimization options I’m not overly hopeful here… -
--pkg gio-2.0
- allows to useasync
methods. Their usefulness is somewhat debatable in context of challenges, but they can be handy regardless.
Template codegen can be borrowed from C with minor changes:
- Drop includes
- Use
stdin.scanf()
/stdin.getc()
for input - Use
print()
for output, it works just likeprintf
in raw C
I’m unfamiliar with inner workings of language assistant CodinGame uses, but it’s worth noting that there exists vala-language-server project that works rather well.