Re: Factor

Factor: the language, the theory, and the practice.

Rosetta Code Revisited

Tuesday, July 16, 2024

I recently wrote about removing the Rosetta Code solutions from our main Factor repository. We only had 62 solutions out of 1,276 tasks, and I didn’t really want to maintain a subset of the solutions, nor mirror them ineffectively into the main git repository.

As it turns out – and pretty much immediately afterwards – I got curious enough to try and download all of the Factor solutions so we could maybe do some analysis of all the various solutions that have been contributed to the Rosetta Code project. And, it’s not a small amount of code – it’s 12,461 lines of Factor code!

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
 Language            Files        Lines         Code     Comments       Blanks
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
 Factor               1663        74221        12461        55885         5875
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

Not all of those are fully solved, but almost 1,000 of them seem to be!

This is available in the newly created factor-rosetta-code git repository, if anyone else is as curious as I was. I don’t think we are going to be able to consistently keep this in sync with the Rosetta Code website, but at least it represents a checkpoint today for quite a lot of nice Factor source code.

Some of these were written for older versions of Factor, but most of it is usable as is, or with minor edits.

Check it out!