by xupybd · 4y ago · 0 comments
It can't be worse than playing video games or watching tv shows.
Seriously, this is never lost. The more languages/paradigms we know, the easier it gets to learn new languages. I think it's a good investment.
I feel like in this day and age, you can be successful at anything if you put in enough hours. Key is probably in being active and critical instead of being mindless.
Still, I think our industry is seriously behind in the adoption curve of pure force languages. It is mindblowing really that important software is still mainly written in Java C and the likes…
As an opposite experience, we're currently hiring someone with no experience to do haskell and purescript. The key here is that there are few haskell companies, but also few haskellers: companies have trouble finding haskellers just like haskellers have trouble finding companies. While most of the work in a traditional tech company receives lots of CVs, we typically experience the opposite, where it's hard to find many people to apply.
As to the question of it being "worth it". I learnt more about becoming a better programmer by learning Haskell than probably any other single thing I've done. And while I've never written Haskell professionally and haven't used Haskell in probably a decade, I use many of the concepts and principles I discovered via Haskell almost every day.
In theory no, as F# runs perfectly fine on Linux. In practice all real world uses of F# in paying jobs I've seen has been Windows. The big advantage however is that there are probably at least an order of magnitude more F# jobs than Ocaml jobs.
With decent (neo)vim support!
So F# is cross-platform.
Seriously, F# is used a lot more than you might think in the financial world!
Businesses generally aren't looking for perfect code. They want code that does the job well enough, that others can maintain, and they want it done fast. Haskell doesn't seem great for that, the people who can actually crank it out fast/well enough seem quite few in number. In most cases, as a business, you don't want to have an IQ minimum of 140 for people to be able to maintain and extend your code (exception for safety critical software of course).
F# has the potential to be suitable for more businesses, the skill floor is lower, and when the going gets tough you can just take on the technical debut and f**ing hack it - and someone else will be able to understand the hacks.
>Businesses generally aren't looking for perfect code.
Mostly you don't want that, but there are a few industries where its jackpot. For instance building some state control engine for rockets etc. Also Haskell does not force you to write perfect code, but forces you to write code that is considering all the possible outcomes, so even if you handwave some stuff it will be pretty clear to everyone reading you handwaved some stuff.
Just out of curiosity: are there companies actually writing mission-critical code in a Haskell? My impression is that those normally tend to get written in C++ and the like.
https://www.reddit.com/r/haskell/comments/r80djm/ann_nasas_o...
Also, having the discipline to study to improve your skills, will most definitely be beneficial in other spheres of your life.
I mean how many people here, currently working in language X, would want to hire someone that is better than they are? I mean rationally it makes sense - bette for the company, learning opportunities, etc, but emotionally it would seriously piss me off if someone came swooping in and basically made me obsolete and look stupid. (I'm not saying the author of the article would do so, I'm just speaking in general and thinking up hypothetical scenarios)
But the main reason, at least in my 20+ year career in my industry, is that it simply doesn't have a track record of success. Haskell isn't remotely new. It was mainstream in academia when I was at university and since then I've seen multiple attempts at adopting it in a large scale commercial setting. I've seen a couple of successes, on small, well defined projects that were relatively "academic" in nature (i.e. the challenges were in the comp-sci type aspects rather than the engineering, and the interactions with other systems were minimal). I've seen more failures, projects with lofty goals that went nowhere. F# has been more successful, and I've seen some significant infrastructure built with it, but it's certainly not proven itself superior to the alternatives (in an industry where successful solutions always get mimicked).
Basically, it's 2022. People have tried it and it hasn't worked out.
This is not true in my experience; and I have been professionally writing Haskell for over a decade. It is well understood that Haskell is excellent for reasoning about program correctness, but rather poor for reasoning about program performance/efficiency, especially memory usage. What Haskell programmers might get frustrated about is less suitable tools used for domains for which Haskell would be an excellent fit (smart contracts?). There are many domains for which correctness and productivity are important, but performance/efficiency less so. Haskell is still much more performant than many dynamic languages are.
OCaml is a nice middle ground, lots of functional goodness and type safety with a much more predictable runtime.
Haskell actually is used for smart contracts on Cardano (which is also written in Haskell): https://github.com/input-output-hk
They haven't been very "successful" yet in the sense of mass adoption (even as far as smart contracts go, EVM-based dapps have multiples more users), but I think this is because of design choices in how the blockchain works moreso than using Haskell for implementation, which limit the usability right now.
I'm not anti functional or Scala, but I'm yet to see any reports etc that actually indicate there is a pay off.
I have not seen Bay Area companies where previous Scala experience counts for more than inviting me to an interview. In my current team I know multiple developers who'd like to have more Scala and Java developers who don't know Scala or even Kotlin.
The underlying issue is that it's a complex language with many experimental and interacting features, which can and do cause a lot of distraction. This is not the fault of functional programming. Have a go at OCaml or F#, which are nice practical sweet spots.
It's seen adoption among at least a couple of large companies: Standard Chartered, and Facebook uses it to make a DSL for spam filtering. The key point for at least those adopters is that it has a fast turnaround time for quickly changing code and still having it be correct.
Is this objective data? No, certainly not, but it's probably better than pure speculation.
I personally speculate that it has a lot to do with what type of problem you're solving. If you're solving difficult/intricate problems language matters a great deal, but if you're just doing CRUD the language choice probably matters much less. Or if, as above, you're working in a domain where being correct the first time matters a lot.
https://discourse.haskell.org/t/new-blog-post-haskell-doomed...
I honestly think this is/was an idiotic move; especially since the alternative reading 'avoid "success-at-all-cost"' is not thaaat much better, like (from the second link):
"An example is I/O. For literally years Haskell had no I/O to speak of; more precisely, I/O was unreasonably difficult. For practical utility that was pretty inconvenient. But we stuck to purity…"
I mean, would you want to rest your business on such an attitude? (Which is a great attitude, also gave monads, explained in the link, and advanced the language while keeping it pure). I am not saying a language/environment has to be business friendly, but if you want businesses to use it, it better be.
Anyway, removing the parenthesis makes it clear that the operations are associative. Otherwise the phrase would be wrong, and Haskell developers really dislike that kind of wrong.
This is in my opinion not the case.
Just to give one example: WhatsApp managed to get to half a billion users with about 60 employees by using Erlang for their infrastructure.
Nevertheless, Erlang is far from being a mainstream language (even though it is used in industry).
In my opinion, in what kind of infrastructure is used/mimicked, a lot of hype is involved.
I will say that haskell does solve many of the problems we face in software engineering today including coding ourselves into a corner. The problem is the paradigm is extremely hard and that's what hampers its success.
It worked well enough for us when we tried it.
I guess the issue is that people and companies really have bad expectations on what "works out" means, and how different languages may need different kinds of environment/investment. If you expect to run a haskell shop the same way you run a java shop, you'll run into trouble as soon as your original team leaves. Likewise, if you run your java shop as you would run a haskell shop, expect trouble.
F# was built to be successful rather than pure. The Early History of F# writeup[1] talks about Don Syme wanting to get strongly typed functional programming "delivered in such a way that it could be adopted by large numbers of programmers", and SML.NET which was being developed at the time was not looking like it would do that. He then worked with someone to port Haskell to .NET and got it running, but with input from Simon Peyton-Jones decided on a different direction. Then went towards OCaml and whether it could run on either JVM or .NET and had this exchange:
> "OCaml already shares a platform with C (at least with the native−code compiler), so all the C libraries are already available... Yet it can still be a lot of effort to link with a C library.[...] There's hard work to be done to realise this vision, but in principle a clean interop story sure beats the endless rehashing of other people's code in language X as a library in language Y. Myself and others involved in the Project 7 are working on one approach to achieve this interop, i.e. compiling languages directly to .NET MS−IL, in the style of MLj, often adding extensions to the language in order to improve the interop. We are also working on improving the .NET infrastructure, proposing support for features such as parametric polymorphism in MS−IL..."
That is, Don Syme was not focused on the most pure ideological code first, he wanted something a large number of programmers could use, and adapting the language and tooling for that goal. F# became a thing supported by Microsoft, by Visual Studio, interops with C# libraries, and C# being able to use libraries written in F#, with very low friction as they share the same runtime, garbage collector, basic type library, exception system, etc. Quoting from the PDF again:
> "As an aside, I think it would be an interesting question to say "OK, let's take it for granted that the end purpose of our language is to produce components whose interface is expressed in terms of the Java or .NET type systems, but which retains as many of the features and conceptual simplicity of OCaml and ML as possible." I'm not sure exactly what you'd end up with, but whatever it was it could be the language to take over from C\# and/or Java (if that's what you're interested in...) But without really taking Java/.NET component building seriously right from the start I feel you're always just going to end up with a bit of a hack − an interesting, usable hack perhaps, but not a really good language"
F# is a bit awkward, not perfectly pure, has to cope with .NET nulls and C# being the big force for the direction of.NET and so on. 20 years later, well who knows but in the StackOverflow survey of 2018 F# is 9th "most loved language" and OCaml is 25th.
[1] https://fsharp.org/history/hopl-final/hopl-fsharp.pdf (chapter 6, the decision to create F#, particularly)
[2] https://insights.stackoverflow.com/survey/2018/#technology
I have always tried to hire better than I am (and ever will be); not to say i'm very good, but a lot of people are very bad. I hired, multiple times in my (30+ year) career people who are much better than I am at pure tech stuff like creating great code. I would love for someone to make me obsolete (I don't think looking stupid is a thing), then I can focus on other stuff. In my first company I was the founder and CTO; I replaced myself with a much better CTO who was so much better that I suddenly had literally nothing to do. So I went on to create + run our research (r&d) group which was a lot more fun than being CTO. Far too many people stay in positions they don't like for pure ego; I don't care what they call me as long as I like the work and I get paid enough, in that order.
I guess when you have a job and this happening it would be less good. Although I would see it as a sign to go do something else.
If you can deal with not getting paid enough, in what way is it "not enough"?
That is why choices like that should be left to project managers. As someone who is coding less and managing more these days, I have none of that ego left. If I could hire someone twice as good as me I would do so in a heart beat[1] and then go home and celebrate my great luck.
[1] Assuming they aren't an asshole etc. etc.
Isn’t the adage “A players hire A players, B players hire C players”?
This could be a great year for Haskell's usage in industry, we hope to see its adoption rate jump by as much as 25%. That's right, a whole engineer!
Back on topic: I imagine you're thinking mainly of Scala and Clojure?
I hear many people complain that they can't find Haskell jobs. Could of course be that OCamlers, F#ers, ... don't complain that much ;)
If you learn it because it is interesting to you and you enjoy the process of learning and using the language/tech, then that's all good. How to "monetize" your hobby is a separate question that should not factor in whether you should or should not cultivate it. There are probably many ways to monetize it. Landing a job is just one way.
Not really. And ZIO takes special pride in that not being the case.
That's not to say that the authors didn't know (about) Haskell and its libraries. But these are distinctly Scala takes on the topic. Especially ZIO, heavily relying subtyping and vairance, is very far from Haskell while still being pure FP.
ZIO's "FP" library called "ZIO Prelude" totally revamps the "traditional" Type Class hierarchy, using Scala's intersection types feature. The name ("Prelude") is the only Haskellism there :)
https://www.youtube.com/watch?v=OwmHgL9F_9Q
https://zio.github.io/zio-prelude/docs/overview/overview_dia...
Imperative (and especially dynamic) languages typically make it easy to get something "working", but it can take many iterations or lots of unit tests until it's robust enough to be worthy of handling a production load. That time spent futzing around with it isn't often capturable in an interview. If it is, chances are the interview isn't asking something representative of real-world scenarios, or it's taking a very narrow slice of one where someone's approach is going to change a lot of they're not just working in the narrow slice.
Functional (and especially typed functional) languages do make it harder to get something up and running, but they tend to have a nice side effect that if the compiler is satisfied, it won't need more work. That usually happens because you can capture the domain in a type declaration that the compiler requires you to account for all cases of. And if you're missing something, it's easy to adjust because the act of adding another case to your domain makes your compiler point out exactly where else to update your code.
I would then use the "Send to repl" feature to fire off single pieces of my program expressions to get instant feedback on the code I was writing. Long before the entire program was run in whole, each part had been run many times.
If you're in a classic whiteboard interview sessions you are robbed of this possibility. That's unfair because it's a big part of working with F# (I would guess other functional programs as well). You might feel you "pay" a bit in avoiding mutable state and having everything as an expression, but you gain so much in return, but you gotta use it!
I guess my argument is that a whiteboard situation might favor an imperative style, where you would write, compile, run and not use repl throughout development?
The main reason is printing. All your code is inlined into a single expression. You can't really throw a print statement in there. With haskell it's even crazier as if you do manage to print your code it comes out backwards.
This is not suitable for the typical interview format.
Also, if you are looking for an F# job, ping me and we can chat :)
There's other things in the world than money. Even if that is your philosophy, consider that learning obscure functional languages might make you a better programmer across the board.
It's a good thing.