d icon indicating copy to clipboard operation
d copied to clipboard

exercise generator

Open ilmanzo opened this issue 6 years ago • 3 comments

Hi, other tracks have a code generator that reads problem specifications and creates exercise test cases reading data from a common source. Do you think it could be useful for D language track ?

ilmanzo avatar Apr 18 '18 09:04 ilmanzo

@ilmanzo, if you're still interested, that would be very helpful. https://exercism.org/docs/building/configlet can sync the metadata and docs for an exercise provided it's in the track config. There's a newer configlet create --practice-exercise <exercise-slug> that adds an exercise to the config, syncs the data, and creates empty files specified in the track config's files array. So the test generator can run that command and then replace the empty files with the generated ones.

BNAndras avatar Mar 08 '24 17:03 BNAndras

well it was 6 years ago, but yes; the original idea was to have something similar to Go track where each exercise is generated by a program that merges data from a template with the actual D code + json test cases. My D knowledge needs a bit of refreshment but if it still makes sense with the current exercism architecture, I can start working on a proof of concept.

ilmanzo avatar Mar 09 '24 08:03 ilmanzo

A quick and dirty draft:

https://gist.github.com/ilmanzo/3163cad4e2246f2553f1a90735e79e6b

ilmanzo avatar Mar 11 '24 16:03 ilmanzo