11 ms·
F# Not just for finance
- melling 10y agoI enjoyed reading this retrospective about someone converting 30,000 lines of Python to OCaml. http://roscidus.com/blog/blog/2014/06/06/python-to-ocaml-retrospective/ http://roscidus.com/blog/blog/2014/06/06/python-to-ocaml-ret... OCaml and F# are quite close.
- vessenes 10y agoI only know Go well enough to comment on his comments, but he did not do a good job testing and reporting on it in his posts, ignoring basic recommendations about safety taught to all beginners. (Ignores err responses from functions and then later complains that things fail later, most particularly). I would be cautious about drawing too many conclusions about languages he didn't end up picking; clearly he knows OCaml and Python well.
- Drup 10y agoYou should read the first two blog posts in detail. He didn't knew OCaml at all at the time, and answers your remark about Go directly in the second post.
- vessenes 10y agoI did read those. I think it comes down to speed on boot, which seems like a legit concern, and a matter of taste. To wit: Should os.Getenv return an empty string or an error if the environment variable is not set? -- The answer to this depends on how unix-y you are, I suspect. We might disagree, but it's not wrong to say that you're going to do what bash does, which is, after all the fundamental place these are kept, and return an empty string. In particular, this is well documented in the API, regardless. If I create an empty list, then marshal some uninspected text into it, and that marshal function fails but I don't check its error status, should my list be poisoned, or should it continue on as empty? -- The idiomatic answer to this is that you should check error status and remediate. He would prefer that the program vomit when marshaling fails. Fine, but it was entirely his choice to code in this style, against go style guides. To then claim the compiler is 'unhelpful' later when he tries to read the list he declared is empty is blame shifting in my opinion. I would guess he does not prefer in-line error checking and remediation as a pattern; that's totally fine, but it's annoying to read snark about it.
- Drup 10y agoIf you read more carefully, you would see he would prefer that the language would not allow him to ignore errors. You say "The idiomatic answer to this is that you should check error status", yes, that's a Go design pattern, but nothing enforces that. In other languages, thanks to Option/Result types, this is enforced, hence his opinion. Such kind of safety and security concerns should not be enforced by conventions.
- bwooceli 10y agoA high price tag for a niche language (purely defined by "popularity") is hardly surprising, simple question of supply and demand.
- insulanian 10y agoThere is an interesting article about rewriting C# project in F#, with impressive results: http://simontylercousins.net/does-the-language-you-use-make-a-difference-revisited/ http://simontylercousins.net/does-the-language-you-use-make-...
- wrsh07 10y agoThis is a really great case study, but I can't help but think some of the improvement comes from it being the second attempt at the project. I'd really like to see some case studies going the other way: F# --> C# [or C++]. At the least, you could do C# --> C# [ie complete rewrite]. Any time you do a rewrite with more knowledge of what worked and what didn't, you'll have a better system. So ultimately, the essay [like most] leaves the question: Is F# better? Or is it just that complete rewrites can provide substantial improvement?
- smoothdeveloper 10y agoFrom all I gathered about people that story was related to, it seems the F# project was done without looking at the C# implementation, on basis of same specifications. If you were tasked to implement a project because first implementation failed, would you even read the first implementation or just base your work on the specification?
- wrsh07 10y agoOh good point -- it does say they were separate teams. Should one read previous implementation? That's a difficult question. If you're worried about losing your perspective from seeing a single solution, then perhaps you're right that you shouldn't. But it's possible that merely implementing it in a different [more functional] language would encourage sufficiently different patterns to allow you to keep perspective. With all of this said, I am a huge fan of both C++ and Haskell. I had just had an internal realization that these stories might not be extracting the positive effect that a rewrite might have on a code base [even though, as you say, that is likely not relevant here].
- rcarmo 10y agoI liked tinkering with F# on VS Code with Ionide (https://marketplace.visualstudio.com/items?itemName=Ionide.Ionide-fsharp https://marketplace.visualstudio.com/items?itemName=Ionide.I...), but would love to hear from folk doing F#/OCaml as to their toolsets.
- ZenoArrow 10y agoAs far as I'm aware, the most popular F# tools for writing code are (from most to least popular): Visual Studio, Ionide (either using Atom or VS Code) and Emacs. I haven't seen that many people coding in F# using anything else, but I'm sure you'd find a few people using the usual suspects (Vim, Sublime Text, etc...).
- nickpeterson 10y agoI'd like to use mainly emacs but I've noticed high delays in auto completions on certain type providers that don't exist in VS. Not sure what the issue is...
- chrono803 10y agoXamarin Studio 6 has gotten a lot of F# support. I've seen a lot of folks using that for coding in F#.
- phonebanshee 10y ago+1 for Xamarin Studio. That's what we're using for F# / iOS / Android.
- zem 10y agoI use vim, but the lack of autoindent support is a bit of a pain. I've been meaning to check out spacemacs and see if it does any better there. also I'm just learning f# and I've started a small project to capture the paket and forge commands needed to get up and running: https://github.com/martindemello/fsharp-quickstart https://github.com/martindemello/fsharp-quickstart
- gmantom 10y agoWhile I think F# is a great programming language. The article missed some good uses of it. Specifically the article missed one of largest F# deployment, in production, in the world at this point. We use F# at Jet.com and it powers every part of our core business from our dynamic pricing algorithm to search and analytics. Over 4 million customers already on jet and over 2200 cores on azure all running F# code.
- cm3 10y agoWhat concurrency models do you employ to saturate all cores, and how's GC behavior?
- gmantom 10y agoF# has fantastic concurrency support. Great support for Asynchronous operations and Multi Threading. Being a functional first language and immutable by default means most of the micro services are stateless and this means we can take advantage of concurrency like crazy and not worry too much about race conditions. I think functional languages in general make concurrency much easier not just F#. GC on the other hand is very aggressive with all of the immutable data structures F# creates. GC in F# is very good, though, I think without good garbage collection you have a tough time in a functional world. Microsoft is especially interested in GC performance for .NET and they have explored memory dumps to improve GC so it performs well even under load and when used with F#.
- cm3 10y agoI should have been more specific in the question. I'm used to Erlang and Haskell (GHC) concurrency primitives and frameworks. To reformulate: what concurrency models can you employ in F# that don't involve manually managing threads/processes?
- klibertp 10y agoFutures, for one (called Tasks I think). There are probably implementations of other models as well, but I never looked for them personally.
- hvs 10y agoI was an early adopter of F# (1.0) and promoted it pretty heavily in my previous job. We used it for some of our prediction code. I've since left and move to the Linux world, but have become more involved with using OCaml. Both are great languages (probably my favorites) and that's after investigating Haskell for a while. F#/OCaml's ability to easily move between functional/procedural/OO worlds makes it super flexible.
- cies 10y agoDid you see: https://facebook.github.io/reason https://facebook.github.io/reason
- gnuvince 10y ago> F#/OCaml's ability to easily move between functional/procedural/OO worlds makes it super flexible. When I wrote the reference compiler for an intro to compiler class in OCaml, some of the teams who used Haskell asked me about my choice; I said that while most of the compiler was written in a nice FP style, it was nice to have imperative constructs in a few places to follow the techniques from a textbook without having to adapt them and making sure that I haven't changed the complexity.
- edgyswingset 10y ago>I've since left and move to the Linux world, but have become more involved with using OCaml. Have you taken a look at F# on .NET Core? It's still in alpha, but aside from some of the FSharp.Core libraries you can write a lot of code with it.
- hackaflocka 10y ago> F# came out as the single most highly paid tech worldwide and is amongst the third top paying techs in the US Wouldn't the latter be implied by the former? Or am I missing something?
- lucozade 10y agoNot necessarily. Bear in mind this based on survey results from Stack Overflow and the sizes for some of the categories are quite small. For example. Dart is the second highest paid language globally but doesn't even figure in the top paying US (maybe because too few US Dart devs responded).
- jboynyc 10y agoThat is confusing/questionable wording, but it can still be logically consistent. Here's an analogy: Football (soccer) is the most popular sport worldwide, but it is not among the top sports in the U.S.
- ProfChronos 10y agoJust tried F# on https://www.codingame.com/games/puzzles https://www.codingame.com/games/puzzles Don't really see the use case for me, but fun to try smthg new => "one new language a day keeps the boredom away"
- bmay 10y agoWhat are your thoughts on CodinGame?
- NovelSpinGames 10y agoThat's an awesome website! I made it through the first three puzzles using F#. It's too bad that there's nothing like IntelliSense there, but you can use Visual Studio or www.tryfsharp.org for typing and CodinGame for testing. It looks neat, but might not be the best for learning a new language. You can see some clever solutions after solving a puzzle at least. How familiar are you with F# and functional programming?
- mariusmg 10y agoProgramming languages are hyped now worse than cars : "From code to colossal: Waagner-Biro recently used F# to construct the dome of the Louvre Abu Dhabi museum" They used X programming language to build the dome of a museum ? Wowwww... It's sad.
- nickpeterson 10y agoConstruct is probably a poor choice of words. Design would be more accurate.
- Keats 10y agoIs anyone using F# on Linux? How's the experience?
- monads 10y agoAfter my experience, it run smoothly on Linux. I followed the guide at http://www.monodevelop.com/ http://www.monodevelop.com/ to install mono, then F#; monodevelop is also a good IDE but personally I use spacemacs with F# layer.
- insulanian 10y agoI'm running it in prod since last year and from the runtime perspective there are no issues. Tooling is what sucks. MonoDevelop F# support is very unreliable. Basic refactoring, like rename, don't work correctly every time and I had to literally do git reset few times, after renaming, as it screw up multiple files. Also, editor often has visual glitches where letters get corrupted and I have to reopen the file to get it back to normal. Not something I expect from such a long time maintained application. However, it looks like Xamarin Studio 6.0 will be much better. Alternative is Visual Studio Code with Ionide plugin, but I didn't use that beyond trying it once. Hopefully someone else can comment. Edit: typos
- 7sharp9 10y agoXamarin Studio and MonoDevelop are the same, what your probably seeing are the artefacts or using an old version of MonoDevelop
- insulanian 10y agoI'm using the latest stable release of MonoDevelop (5.10)
- sremani 10y agoThe latest if you pull from github is 6.1 (I think), using apt-get does not install the latest monodevelop.
- dintech 10y agoI'm quite sure KDB pays more.
- markfsharp 10y agoHere is the Louvre Architect demonstrating the use of F# to help with the design of the structure: https://channel9.msdn.com/Events/FSharp-Events/fsharpConf-2016/The-3D-Geometry-of-Louvre-Abu-Dhabi https://channel9.msdn.com/Events/FSharp-Events/fsharpConf-20...
- mjfl 10y agoany good tutorials for F#?
- insulanian 10y agoThis is the best resource by far: http://fsharpforfunandprofit.com http://fsharpforfunandprofit.com Update: There is also a collection of good books, videos, etc. here: http://fsharpworks.com/materials.html http://fsharpworks.com/materials.html
- jackfoxy 10y agoWhile I agree http://fsharpforfunandprofit.com/ http://fsharpforfunandprofit.com/ is the best all around resource, for just a tutorial I recommend https://en.wikibooks.org/wiki/F_Sharp_Programming https://en.wikibooks.org/wiki/F_Sharp_Programming Also be sure to check out the F# Foundation site http://fsharp.org http://fsharp.org
- bad_user 10y agoI think the article is spammy and has a clickbait title. Unfortunately reading and addressing the actual article on Hacker News is old-fashioned. StackOverflow surveys, while interesting, are probably meaningless because they suffer from selection bias. Even so, I would guess that F# developers are very well paid, like other developers of FP languages, but it's probably not because they work with F#. The causality is likely reversed - good developers that tend to be well paid are also the kind of people naturally interested in expanding their skill set, hence interested in FP languages. Nothing screams spam more than usage of a hot keyword like "functional programming" while leaving hints that you don't understand what you're talking about. I would expect an article that reads like a marketing brochure to at least make a short attempt at explaining what functional programming is. If you copy/paste testimonials from fsharp.org/testimonials, you could also copy/paste from Wikipedia. But then, their own course named "Functional Programming" doesn't seem to have anything to do with actual functional programming: https://fsharp.tv/courses/functional-programming/ https://fsharp.tv/courses/functional-programming/
- insulanian 10y ago> their own course named "Functional Programming" doesn't seem to have anything to do with actual functional programming Why do you think so?
- smoothdeveloper 10y agoI think the title can be alleged mostly to the misconception which is prevalent at Microsoft since F# was introduced as a commercial product (before it used to be a Microsoft Research product). Maybe you are unaware of that? F# is a pretty good general purpose programming language and that is what the title and article tries to promote (albeit it doesn't give enough and diversified examples). F# is also a reasonably easy programming language which puts emphasis first on "functional programming" (which you frame as hot keyword, I doubt the language was made to fill a hot keyword). I don't know about the for pay contents of fsharp.tv, but I gather they might be introductory and try to bring understanding of "functional programming" aspects to an audience which isn't versed in it, it is sure good for them if "functional programming" is a hot keyword and people are looking for training material to pickup that language, but I wouldn't dismiss that as being spammy. Chill out dude :)
- haddr 10y agoWhere is R on those charts on functional languages?
- shitgoose 10y agoI came across F# a couple of months ago. Very nice language! Short, expressive, no noise like declaring vars/types that can be easily inferred at compile time. |> is amazing. Tuples. 'match with'. Took a couple of weeks to get over the hump, but I never looked back since. Work related stuff is still C#, but tooling, prototyping etc I do in F# now. Highly recommend. Also made me to rediscover glorious past of OCaml/ML that went over my head at the time (like most things).
- spazzpp2 10y agoLong time no see, #F.
- pmarreck 10y agoI want to suggest looking at a language like Erlang/Elixir that didn't start out from corporate self-interest (i.e., was open-source from the get-go) but a rising functional tide floats all boats. (And besides, Elixir "borrowed" a few good ideas from F#.) I've had nothing but good experiences during my forays into functional langs. Here's to a more functional, immutable, easily-concurrent, easily-unit-tested future
- jackmott 10y agoIf you wanted something like F# that isn't backed by Microsoft, I would suggest OCaml, which is what F# is.
- strmpnk 10y agoF# comes from Microsoft Research and was notoriously ignored by the corporate side for years (and still is to some extent). So I'm not sure F# has really ever been a project of Microsoft corporate interest, and now there is the F# Foundation which has many non-MSFT people and companies involved. While I like Erlang a lot, I'd say that Ericsson still has quite a bit of corporate control and interest. It's not always a bad thing to have companies involved in the success and advancement of technology.
- insulanian 10y agoI've looked at it and it looks nice indeed. Having BEAM underneath is a big plus. However, dynamic typing turned me off. Whole my life I'm working with statically typed languages and heavilly rellying on compiler / type system to catch my mistakes / guide my design. Hard to give up on that.
- eggy 10y agoAs commented by others, F# was part of Microsoft Research, and not taken up by MS or other corporations when it was started. Erlang started out in Ericsson, a corporation. Elixir and LFE (Lisp Flavored Erlang) started out opensource and are still opensource. The term 'corporate self-interest' seems misplaced here, with the parenthetical remark turning it into the antonym of 'open-source'. The term proprietary, commercial or close-sourced seem more neutral and correct. Erlang started inhouse at Ericsson, like F# did at MS Research, except it was for a company's immediate business needs or 'self-interest' to program their telecomm switches. Elixir grew out of one person's frustration with Ruby's concurrency (Jose Valim), and a desire to have what Erlang offered him along with the BEAM VM and OTP. It has Ruby-like syntax, Jose is a popular Rubyist, and great tooling along with some other functional structures Jose added that he thought were missing in Erlang. [2] Pony is an OO, actor-based, open source language, yet it has a lot of corporate pickup from fintech and others, and it seems to be getting ready to shove Erlang/Elixir/LFE aside on concurrency and speed. It has fully-concurrent garbage collection that doesn't use the "poison pill" message approach to kill all actors. The creator of Pony, Sylvan Clebsch, has one foot in academia, and the other in business. He has worked on fintech, milsims, and games. [3] [1] http://www.ponylang.org/ http://www.ponylang.org/ [2] https://www.sitepoint.com/an-interview-with-elixir-creator-jose-valim/ https://www.sitepoint.com/an-interview-with-elixir-creator-j... [3] http://www.curry-on.org/2015/sessions/pony-making-it-easier-to-write-efficient-concurrent-programs.html http://www.curry-on.org/2015/sessions/pony-making-it-easier-...
- deleted 10y ago[deleted]
- mamcx 10y agoWhere are the best place to find that F# jobs? I will love to work on it (+17 developing but this years I have picked F#)
- smoothdeveloper 10y agoUK seems to have the most adoption of F#.
- gtycomb 10y agoIs porting OCaml code to F# on Unix straight forward? Is there something similar to the Opam package manager in F#? Thanks for your thoughts.
- strmpnk 10y agoF# is similar but if you're using features like polymorphic variants, functors, or first class modules, it might take more effort. In terms of package management, I'd check out paket. It wraps up the otherwise very quirky nuget system that .Net uses and also supports things like source dependencies.
- manish_gill 10y agoThis was a bit of a surprise to me. Is there a disproportionate amount of people in Finance using F# compared to other technologies? Any particular reason for that if the answer is yes?