[Poll] What programming language would you like CodinGame to support next?

It’s an official answer.

Hello @andre2007

I’m sorry to disappoint you but, as I wrote earlier, there is just no simple way of doing what you propose. Our current system isn’t compatible with Docker and won’t be without huge development efforts. Currently, there is just no way for us to dedicate time on this.

However, I still intend on pushing things internally for the support of a new language (could be D) before the end of the year.

I appreciate the enthusiasm and I’ll try to work on a blog article explaining how CodinGame works.

1 Like

Hello @TwoSteps,
Thanks for working on this topic. Yes, maybe D is added this year, but also it could be D is not added this year or the next years at all
I think I found a completely other solution, which will cost CG only a half hour to implement and makes D available:
From @eulerscheZahl I got the info that there is a C++ hack which enables loading arbitrary executables as long as they are small (https://github.com/Agade09/CG-Send-Binary). I tried it and failed as the D executable is too big. A D executable consists of 3 parts: DRuntime, the standard library Phobos and the actual user code.

Instead of compiling the DRuntime and Phobos into the executable, it is possible to just link (shared objects) agsinst them. This will reduce a 800kb application to 15kb.

What I ask you: is it possible to add the 2 shared objects DRuntime and Phobos to the environment you use for C++? Technically it is nothing more than just copying these 2 files to /usr/lib.

Could you ask your technical engineers about this solution? Even this is the most cumbersome way of using CG for D users, it is a way to use a sane, fantastic programming language. Every line you write with D is fun, if we now even could add CG to that, it will be unbelievable great!

No entreprise ever will just add a “simple hack” to cover a new feature for just few users. The feature is done in a complete state for everyone or not at all.

1 Like

@Magus The request is not about the hack. The hack is already there and is working fine as long as you have a rather small executable (100_000 lines limit).
I asked for another thing: Including 2 shared objects from the D language (https://github.com/ldc-developers/ldc/releases/download/v1.16.0/ldc2-1.16.0-linux-x86_64.tar.xz). CG could either copy 2 shared objects into the /usr/lib folder or if they want they can just install from the Gnu Compiler Collection gdc-9 to have the libraries.

2 andre2007:
u didn’t tell which 2 shared objects from TAR file should be copied

2 all:
andre2007 means that coping some dll/so to /usr/lib will allow run D(or any?)-compiled app in CG with some hack that converts EXE to C-source as base85 and run it.
D-compiled app with static linking is too big so when compile it for using shared Runtime it become smaller enough for running in CG but for such cases system should contains shared SO-s with D-runtime.

@zelyony i wanted to wait until until CG responds whether they accept the approach in general or not, before going into details.

In lib folder there are these 2 shared objects:
libdruntime-ldc-shared.so.2.0.86
libphobos2-ldc-shared.so.2.0.86

Both of them have also file links (extension .so and extension so.86) which points to them. I am not a linux expert and can’t say which file extension is actually the correct one CG linux environment. (I tested it on my raspberry pi)

If you want to test it, this command will compile the executable with dynamic linking:

ldc2 app.d -link-defaultlib-shared

import std.stdio: writeln;

void main(string[] args)
{
    writeln(`Hello World`);
}

adding 1 language to the infrastructure in 1 year is something weird.

yes, u have many other tasks, and for such task u should learn new language, and u have boss that think that is good right now and don’t need something change.

well, my point that adding possibility to connect CG to client machine over TCP-socket for sending string data and receiver string answer will solve problem for any programming language.
I talk now only for PRACTICE tasks - CG never shows sources to anyone public (no point share code to others) and CG don’t need sources from 1mln users for each problem at all (no? why?).
it will allow solve problems with any langs that user prefer and CG hasn’t yet and will allow receive CG points that is good for user profile and user feedback education (gamification learning langs process).

I can code some TCP-app for client in C#/Qt/Go/Kotlin/NodeJs(idk such many langs but I can learn it for task), that listen some port on client machine and redirect streams to some user selected application or script. In any case I need such app for myself and I can share app at github. Just needed some job from CG side - TCP-connector that send tests and receive answers and check it for success/failure including some timeouts like “connection is impossible for 10sec - failure”

UPD:
extension idea: TCP-tool (client side) can contains TextBox area for source and compilation command lines for compiling it - successing compile then listen socket, failure compile no listen socket. with possibility transfer source (then some protocol should be invented or some gRPC)
idea++: dunno maybe it can be Atom/VSCode plugin with intellisence and coloring

1 Like

One important point you forget, your approach would save CG a huge amount of money. My assumption is, the compilation server farm is the biggest cost factor for them. Laying out the compilation to the user would immediately reduce the costs.

@TwoSteps
Also please see this issue to make the used language and source visible to CG

@andre2007
Once again, I appreciate the enthusiasm but we’re not going to support a language with that kind of work-around.

3 Likes

Another idea that still based on some RPC:

  1. u still need add “client connector” to current infrastructure - sockets, gRPC, SSH, what u prefer. it will be used internally by CG only.
  2. u can add new Dockers with any compiler. cuz its cheap and allows to run hundreds instances. in any case CG have server trees in some view (own cloud, AWS cloud or something).
  3. CG takes code in user language from web-page, uses Instance with this language to compile it to some exec_utable, connect tests to execs and running executable pipes (execs can be transferred to test instances for to free compiler instance for next job) and…
    Tadaaa! CG has user code, can compile it, can test it and can give points for it.

Just need to add “connection/rpc”(bridge) between Tests, Compilers and Execs trees.
Its simpler than add one new compiler per year to Compiler-Monster that u have and that u afraid to change. No need to feed the Monster with compilers by one to make it even more scary and hulking.
After all u can add any language just takes docker image from the Internet (and probably small work to add executing script in some cases when compiler output is not EXE).

U can request from users best compiler and running options , they knows favorite compiler. Also u can request template in any language for generating initialization code for CG-problems (probably such code are generated automatically by some kind of Generator through templates).


Short version:
Add to your Compiler-monster possibility to talk with any Docker-ed instance through RPC/SSH.
Then u can to compile with any compiler in Dockers.

When can we can expect an official announcement regarding this poll?

5 months have passed.
do you have any news and progress?

Actually, yes. I’m sorry for the lack of news, I’ve pushing this internally but I didn’t want to announce anything before it had a really good chance to happen.

We’re currently working on adding both TypeScript and D to the platform. Hopefully it should happen before the beginning of the next contest.

ping @andre2007 :slight_smile:

6 Likes

Oh, we will have the D. A lot of puns and jokes incoming on the world chat.

4 Likes

@TwoSteps these are really big and great news. Thanks a lot of sharing this information. In case there are any questions during the implementation we are happy to help you on forum.dlang.org and on dlang.slack.com.

2 Likes

But adding new language (community) is the way how to get more people envolved. Obviously its worked. And only time will tell if it was worth it

So was it obvious, or is time needed? You can’t have it both ways.

1 Like

D has been released on the platform. Please let me know if you encounter any issue.
Typescript will follow before the end of the week.

Unfortunately, the update of all current languages won’t happen before Unleash The Geek. Should happen before the end of October.

I’m counting on you @andre2007 to get D lovers in the leaderboard of Unleash The Geek :wink:

3 Likes