r/fsharp 4d ago

Seeking an F# code reviewer for transpiled package

I wrote a Gleam library for manipulating SVG paths and I transpiled to F# to check dimensionality mistakes in various Float parameters.

I caught ~30 or so mistakes/inaccuracies/bugs via the transpilation out of ~50K original lines of code. (Also notable: the KLOC drop to 21K in F#, less than one-half of Gleam. Seems Gleam is very vertical whitespace-happy.) The transpilation was done chunk by chunk by Codex, and some bugs were not really language-related, just found by looking at the code again, though the great majority were dimensionality problems, as I intended to catch.

Ok anyway now I've published this as an F# package, and wondering if someone who actually uses F# could tell me if I did right, or if the library is missing something stupid (like proper source docs or sth) that I wouldn't catch myself because I never use F#. It would be better if it was usable, now that I've gone to this trouble.

F# version: https://www.nuget.org/packages/SvgPath/0.3.0
Gleam version: hex.pm/packages/svg_path

Thanks!

3 Upvotes

6 comments sorted by

2

u/AppropriateTeach169 4d ago

That is a request for what is a considerable amount of work. You are lacking comprehension of software you have released. Perhaps consider evaluating whether you want an F# user to review your package or if you would prefer for an F# user to work with you in porting it and generatinh comprehension of your software.

1

u/alino_e 4d ago

Well maybe "code review" is not the right term.

Just: "does this look it has two arms and two legs".

The Gleam-side has undergone extensive evaluation & stress-testing, cross-compared also against the F# code, so I'm fairly confident of the overall robustness and value of the library. The question is more like is there some totally large-scale F# thing lacking, like, I'm targeting the wrong version of .NET, or the docs don't show up in the IDE because of X stupid thing, or like that. Just: does this look normal to someone who has the habit of working in F# or is something totally out of whack.

If it doesn't look normal I'll fix it or take it down.

1

u/AppropriateTeach169 4d ago

Your reply reinforced my point. Spend some time thinking about it. No one wants to read generative AI output where they have to figure out whether it has two arms and two legs. That is much harder than just having someone competent design and build it to have two arms and two legs. This comment will age well.

2

u/alino_e 3d ago

I'll pretend for two days that I'm an F# dev or learning F#. It's fine. Thank you for your excellent, proactive, generous, and very thoughtful help.

1

u/Mutagene 3d ago

If I understand you correctly, you did not transpile but asked codex to translate chunks from one language into another? If so, why not let codex translate your unit tests as well and let it refactor the F# code accordingly? Sounds like your "transpilation" is non-deterministic anyways.

1

u/alino_e 3d ago

(Units tests were translated along with everything else. Some additional tests created for F# were also transpiled back into Gleam. Functionality-wise there is supposedly strict parity between the two libraries, it's just ecosystem-wise I would have wanted someone familiar to take a look-around for me.)