News for hackers. Stuff that matters.
Re:Why your F# evangelism isn't working by gemstones on Tuesday May 30, 2023 @09:47PM (#36133560)
Parsing realistic (messy) JSON, usually. I would have expected F# to shine at that due to type providers, so it was doubly surprising to me. The F# candidates I've seen spend most of the interview manipulating the data.
Re:Why your F# evangelism isn't working by EdwardDiego on Tuesday May 30, 2023 @10:24PM (#36133771)
How messy is the JSON exactly? Type providers are awesome when the schema is consistent.

But tbh, from what little I know, I'd be expecting you to expect me to solve the issue from first principles. So using a "and then magic" technique might be something interviewees shy from.

Re:Why your F# evangelism isn't working by waffletower on Wednesday May 31, 2023 @12:22AM (#36134430)
Hahaha, "when the schema is consistent". The strong typing herd keeps thinking it can smash reality into a square hole.
Re:Why your F# evangelism isn't working by EdwardDiego on Wednesday May 31, 2023 @12:51AM (#36134587)
K.
Re:Why your F# evangelism isn't working by FrustratedMonky on Wednesday May 31, 2023 @09:38AM (#36138262)
This sentiment is surprising. Doesn't Python crash a lot at run-time, specifically because some 'dynamic types' clash. They become a real type at some point, at compile time or at run time. Why wait for the crash to figure it out?
Re:Why your F# evangelism isn't working by yawaramin on Tuesday May 30, 2023 @10:08PM (#36133690)
This is likely because people don't have enough real-world experience with functional programming paradigm techniques like 'parse, don't validate' and modelling only the parts needed to handle dynamic input, e.g. as shown here https://lexi-lambda.github.io/blog/2020/01/19/no-dynamic-typ...

It's unfortunate that they decided to pick F# on such problems when they didn't have the (mental) toolkit to tackle them, but I think it speaks more to people being really eager to communicate their enthusiasm for FP. I wouldn't try to ascribe any higher meaning to it.

Re:Why your F# evangelism isn't working by cjbgkagh on Tuesday May 30, 2023 @10:13PM (#36133706)
TypeProviders don't do well with messy JSON and are finicky at the best of time, the last thing I'd rely on during an interview.

Depends on what you mean by messy? Non-conforming JSON? A custom FParsec parser might be able to sensibly extract the data. If it is conforming to JSON then you'd use normal F# code to work with the standard JSON parsers.

Re:Why your F# evangelism isn't working by gemstones on Tuesday May 30, 2023 @10:22PM (#36133767)
It’s syntactically valid JSON.
Re:Why your F# evangelism isn't working by cjbgkagh on Tuesday May 30, 2023 @10:30PM (#36133808)
I don't know then, LinqToJson is a pretty good starting point for F#
Re:Why your F# evangelism isn't working by eyelidlessness on Tuesday May 30, 2023 @10:09PM (#36133695)
This is, from a distance, fascinating anecdata. I would expect F# itself to excel in this area (type oriented development being a huge selling point), and people who’ve chosen it to be attracted to those parts of F# which should excel for it. I’m often surprised when my at-a-distance expectations don’t meet reality, but not so often astonished by it.
Re:Why your F# evangelism isn't working by throwa18991900 on Tuesday May 30, 2023 @10:04PM (#36133667)
I've seen the opposite, and have seen some pretty big fast large professional systems being built in it. Admittedly most of them are closed source, and the community contribution allowed to be made is small. Most of the developers using it normally just market themselves as C# developers when they change job because of some of the above opinions they see online. Have seen speed comparisons compared to other similar tiered languages internally where F# shines with less code as well particuarly around math (C# is just starting to catch up here). Even seen dynamic problems solved in it to your point in a professional setting to speed up very often run calculations to a large customer base.

However technical capability and efficiency of the tool isn't the only concern picking up the comments in this thread so far. The herd effect sadly can make people nervous creating a barrier for people to try it especially if career is in it. What other people think of it, and their preconceived notion can matter.

Re:Why your F# evangelism isn't working by nick__m on Tuesday May 30, 2023 @09:58PM (#36133627)
Those F# candidates would have been be better to use C# to do the adhoc data wrangling and F# for algorithmic part of the program.
Re:Why your F# evangelism isn't working by FrustratedMonky on Wednesday May 31, 2023 @09:40AM (#36138288)
Isn't ad-hoc data wrangling the feature of F#? Why are so many people here against F# for reading/manipulating ad-hoc data, that's what it is good for.
Re:Why your F# evangelism isn't working by xupybd on Tuesday May 30, 2023 @10:46PM (#36133907)
I find I spend a lot of time building records for JSON data. Type providers are nice but I've found them to be a little untrustworthy.

Normally now I ask Chat GPT to create an F# record from the JSON. Then go through and check everything line by line, redo the types to something sane and use that.

But if it were a quick script to do a one off then a type provider will work well.