YAMLScript Language Track

I had a brief conversation about Exercism with @ingydotnet at The Perl and Raku conference, who expressed interest in creating a YAMLScript track.

I’ll likely be talking to them later during the conference and giving them more info on what needs to be done for this track to exist, and have created this topic to see if I can get the ball rolling for them.

Not to denigrate the idea, I just find this interesting from their website:

By default YAMLScript outputs JSON, but it can also output YAML

That sounds like the reverse of what it should be.

There’s a bit more info on why this is the case in one of their blog posts!

Yes, there it is:

Put another way, ys outputs YAML in its most compatible format.

Looks interesting. Once the ball gets rolling, I’ll be glad to contribute.

@ingydotnet here. What do I need to do to get the ball rolling? :slight_smile:

@ingydotnet Hey - welcome :slight_smile:

So normally we ask people to put together a Hello World example for us to look at (with some tests and a solution). That helps us check that the language “fits” on Exrecism. Every track has the same Hello World exercise, so take your favourite/closest-match and use that as your basis.

For example in Ruby:

Once that’s done and it looks reasonable, @ErikSchierboom will create a track setup for you :slight_smile:

Hi @glennj
YS is used 2 ways:

  1. As a YAML loader where the YAML can have embedded code. This is normally used in a YS language binding module like Search results · PyPI but is also available via the ys CLI where it returns data in a LCD form (JSON).
  2. As a complete, functional programming language. It compiles to Clojure code internally and has a fast runtime binary that doesn’t use the JVM.

For exercism we’d being using the latter. Comparing to Python, ys hello.ys is the same conceptually as python hello.py.

@iHiD thanks. @m-dango pointed me at New Track | Exercism's Docs last week. Reading through that now. I’ll get to work on my Hello World submission.

1 Like

@iHiD is this about what you need?:

If so, where would I submit it?

This looks good. You’d submit it to the exercism/yamlscript repo but we need to wait until @ErikSchierboom is back next week to create that for you.

The other major step is creating a test runner - which is a Dockerfile that runs prove -v hello-world-test.ys in production. You’ll get a repo that’s built from GitHub - exercism/generic-test-runner to do that in, so you might like to start thinking about that. At the most basic level, you’ll “just” need to implement these lines:

There are also more complex versions of test runners, but this is probably good enough to start you off.

Finally, it’s probably worth spending an hour or two exploring the docs as this will save you lots of effort later. Everything should be very well documented as multiple newbies have built tracks from scratch using them, but if you have any questions, please ask and other maintainers will be happy to help Building Tracks | Exercism's Docs :slight_smile:

Edit - just noticed you’ve already seen these :slight_smile:

@iHiD Thanks for the fast reply.
I’ve done a lot of this kind of Docker stuff, so no problem.
Is there anything I need to do to get @ErikSchierboom 's attention for this or will that be taken care of?
When approximately do you expect I’d hear something?

BTW, Does the Docker image need to be alpine based?

No. But size does matter. Exercism pays for bytes stored. I’m pretty sure some runners use Ubuntu bases.

@IsaacG thanks for letting me know that.
I’ll do my best to create as small an image as I can.
I’m trying to build on alpine now but hitting various issues.
Will report back later…

1 Like

(Among other alpine build issues) The jar to native binary compiler I’m using doesn’t work with musl by default. I might be able to get it working at some point, but I’d rather build an image from something else for now.

Does Where can I find Ubuntu Minimal 22.04 Docker image? - Ask Ubuntu look ok?

Minimum Docker image based on bookworm-slim is 73.4MB and one based on ubuntu:22.04 is 77.8MB in size.

1 Like

bash uses ubuntu:24.04 link. You can browse other tracks to get a sense of what’s in use.

Early next week probably :slight_smile:

1 Like

@ingydotnet I’ve created the GitHub - exercism/yamlscript: Exercism exercises in YAMLScript. repo, which will contain the track itself (exercises and such).
The test runner repo has also been created: GitHub - exercism/yamlscript-test-runner
Enjoy/good luck creating the track!

2 Likes

Thank you @ErikSchierboom !!
Really excited to see this happen!