top | item 42132871

(no title)

throwaway675867 | 1 year ago

We are spoilt with a lot of good tools these days, F# being one. As an ancedote a hybrid F#/Python shop is one use case where I have seen F# thrive. My personal view is that F# is actually better than some other langs for when you want to convert that Python code into something that runs "faster" but still looks somewhat like Python to stakeholders (I personally find F# easier to read than Python for example the generator syntax in Python to me reads backwards). This typically happens at least for me when the business team/data team/quants/actuaries/etc use Python but want you to productionise/scale it. Static typing, and lower level optimisations possible + easier access to multi-threading. I've personally converted from Python to F# models from a math background and seen 100x performance - as a bonus I can talk to the F# code and typically they understand/can read it (even if they couldn't write it directly) vs say C#/Java with a non-whitespace syntax. Allows easier verification.

discuss

order

fuzztester|1 year ago

> (I personally find F# easier to read than Python for example the generator syntax in Python to me reads backwards).

How so? Or do you mean that about list, dict and set comprehensions?

throwaway675867|1 year ago

Yes - just my preference. `[ num for num in numbers ]` in Python would read as `[ for num in numbers do num ]`. With nested loops, and if you want to do filtering (yield only on certain conditions) I felt the F# syntax reads better as the order reads top to bottom.