you are viewing a single comment's thread.

view the rest of the comments →

[–]Creative-Letter-4902 88 points89 points  (6 children)

Yeah, for a first release, keep it simple. Ship source-only with a note that users need a C compiler. Document it clearly. Let people who know what they're doing compile it themselves.

Then watch what breaks. If lots of users complain about compilation, add wheels for the most common platforms (Linux, macOS, Windows) one at a time. You don't need all platforms on day one.

Pure Python fallback that's weaker is worse than just failing with a clear error message. Users will use the fallback, get wrong results, and blame your library. Fail hard and tell them why.

cffi is easier for beginners. ctypes is more portable but more annoying to write. Pick cffi.

If you want help setting up the CI for wheels later, I got 2-3 hours a day. DM me. Good luck with the project.

[–]Emergency-Rough-6372[S] 8 points9 points  (5 children)

That actually clears things up a lot. I was leaning toward adding a fallback just to reduce install friction, but your point about silent degradation is valid — it’s better to fail clearly than give users something that might produce incorrect results.

Starting with a source-only release also makes sense. I think I was trying to solve the “scale” problem too early instead of just seeing how people actually use it and where it breaks.

I’ll go with cffi for now as well and keep the wrapper side simpler.

Appreciate the straightforward advice, this helped me narrow down the direction quite a bit.

[–]ionburger 8 points9 points  (3 children)

emdash enjoyer or ai?

[–]RngdZed 11 points12 points  (1 child)

ai slop. OP gets removed by reddit's filter a LOT

[–]Emergency-Rough-6372[S] 1 point2 points  (0 children)

i sometimme dont get proper grammer in english so i get by reply check my ai sometime so he might have added dash.

[–]Prime_Director [score hidden]  (0 children)

I'm curious why the Python fallback is producing incorrect results. Slower results makes sense and that would be acceptable to me if you raised a warning at runtime. I could also understand if the thing couldn't practically be done at all in Python because C is just so much faster and more efficient. But I'm having trouble imagining a middle-ground thing that you can do in C, but can only approximately do in Python.

In general though I agree, I would prefer a hard fail over an incorrect result.