Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor ExercismGenerator to run entirely in-image, sans configlet #370

Open
bencoman opened this issue May 28, 2019 · 10 comments
Open

Refactor ExercismGenerator to run entirely in-image, sans configlet #370

bencoman opened this issue May 28, 2019 · 10 comments

Comments

@bencoman
Copy link
Contributor

@macta Just asking here while its on my mind without Discord access to open the discussion with you...

Before I have to dig to familiarize myself with the generation code, where in there are the generated test classes selected?

I'd like to evolve generation a bit to include a few hints in the solution class methods,
e.g. methods containing a pragma

Case in point, my proposed FlattenArray >> flattenArray: for #368

@bencoman
Copy link
Contributor Author

Other use case... When getting back into Exercism after my big break I started as a student working through from HelloWorld. Strangely I found it confronting to be immediately hit with two "error" dialogs - one for creating the missing class and other for creating the missing method. My reaction was curious given that I knew exactly what was going on, that these were helpers were standard workflow - but with my "newcomer hat" on (per De Bono thinking hats) it "felt" like an error.

I feel strongly we need to simplify the first couple of exercises.

  • For HelloWorld that means no dialogs. I remember a comment somewhere from Exercism admins that HellowWorld was meant to ensure fetch/submit work - so we could have the tests green out of the box.
  • For second exercise that means class exists with missing methods, to introduce that helper dialog on its own.
  • A few exercises later could missing classes to separately introduce a new helper dialog.
    i.e. gradually introducing students to our unique workflow rather than overloading them at the start.

@macta
Copy link
Contributor

macta commented May 28, 2019 via email

@bencoman bencoman changed the title Query - where are generated classes selected Review generation May 29, 2019
@bencoman
Copy link
Contributor Author

Sorry, my use case redesigning early exercises distracted you from my main question (in first comment with question mark). I'll park that to follow that up in another issue.

Here I want to focus on the generation infrastructure.

Q1. Which code selects the classes to be generated?

Q2. Regarding the use of configlet...
a. whether it works on Windows to facilitate my sharing that load from you
b. being an external requirement to be setup (which to be honest has discouraged me from being more involved in generation) and a barrier to entry for future maintainers
c. after poking around your code and digesting [1] it doesn't seem hard to replicate the templating of configlet generate - ultimately the /exercises files on github just need to look the same.
d. it was good to use the official tool to begin with to eliminate unknowns, but now with greater familiarity we can consider other options

For my effort, I'd prefer to replace the configlet shell-out with pure in-Image generation rather than deal with (a.) & (b.).

[1] https://github.com/exercism/docs/blob/master/language-tracks/exercises/anatomy/readmes.md#generating-a-readme

@macta
Copy link
Contributor

macta commented May 29, 2019 via email

@bencoman
Copy link
Contributor Author

I think it’s the first one [ExercismGenerator] you are referring to

Yes. Glad to hear you concur with my guess its trivial to replace. I'll have a go at it.

if they change the format or structure of Exercism, we won’t be insulated from that change

I'm foresaw that also, but think its a reasonable trade off. They'd have to announcement it, at least for users to manually update the configlet, and then it can run be from the command line to compare and implement the difference.

@bencoman bencoman changed the title Review generation Refactor ExercismGenerator to run entirely in-image, sans configlet May 29, 2019
@macta
Copy link
Contributor

macta commented May 29, 2019

yes - having brain dumped, its a good thing to do - particularly to simplify and remove some dependencies.

@bencoman
Copy link
Contributor Author

What is the importance of this...?

    self halt: 'Forgot to update Exercise hint for: ', anExercismExercise name ].

@macta
Copy link
Contributor

macta commented May 31, 2019 via email

@bencoman
Copy link
Contributor Author

bencoman commented Jun 3, 2019

@macta, Curious why #generateTestMethodsOn:calling:using:prefix: is calling recursively. My first thought is the multiple level of cases keys might be inconsistent across problem specifications.
[Edit] Ahh, I see the canonical-schema.json is recursive on testGroup. Well Thats Fantastic.

@bencoman
Copy link
Contributor Author

bencoman commented Jun 3, 2019

In #generateTestNamed:in:variable:selector:parameters:expecting: why are line ending #cflf?

That seems Windows platform specific. I wasn't sensitive to this last week but following on from Sven's comment in the mail list, #cr is used internal to Pharo and conversion done per platform when its written to disk.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants