If you already know LISP, why would you also want

2019-02-05 03:18发布

What is the added value for learning F# when you are already familiar with LISP?

11条回答
欢心
2楼-- · 2019-02-05 03:47

A lot of these are relatively recent developments in the programming language world. This is something you'll see in F# that you won't in Lisp, especially Common Lisp, because the F# standard is still under development. As a result, you'll find there is a quite a bit to learn. Of course things like ADTs, pattern matching, monads and currying can be built as a library in Lisp, but it's nicer to learn how to use them in a language where they are conveniently built-in.

The biggest advantage of learning F# for real-world use is its integration with .NET.

查看更多
淡お忘
3楼-- · 2019-02-05 03:48

F# has the benefit that .NET development (in general) is very widely adopted, easily available, and more mass market.

If you want to code F#, you can get Visual Studio, which many developers will already have...as opposed to getting the LISP environment up and running.

Additionally, existing .NET developers are much more likely to look at F# than LISP, if that means anything to you.

(This is coming from a .NET developer who coded, and loved, LISP, while in college).

查看更多
【Aperson】
4楼-- · 2019-02-05 03:50

If you knew F# and Lisp, you'd find this a rather strange question to ask.

As others have pointed out, Lisp is dynamically typed. More importantly, the unique feature of Lisp is that it's homoiconic: Lisp code is a fundamental Lisp data type (a list). The macro system takes advantage of that by letting you write code which executes at compile-time and modifies other code.

F# has nothing like this - it's a statically typed language which borrows a lot of ideas from ML and Haskell, and runs it on .NET

What you are asking is akin to "Why do I need to learn to use a spoon if I know how to use a fork?"

查看更多
劫难
5楼-- · 2019-02-05 03:50

I know this thread is old but since I stumbled on this one I just wanted to comment on my reasons. I am learning F# simply for professional opportunities since .NET carries a lot of weight in a category of companies that dominate my field. The functional paradigm has been growing in use among more quantitatively and data oriented companies and I'd like to be one of the early comers to this trend. Currently there doesn't an exist a strong functional language that fully and safely integrates with the .NET library. I actually attempted to port some .NET from Lisp code and it's really a pain b/c the FFI only supports C primitives and .NET interoperability requires an 'interface' construct and even though I know how to do this in C it's really a huge pain. It would be really, really, good if Lisp went the extra mile in it's next standard and required a c++ class (including virtual functions w/ vtables), and a C# style interface type in it's FFI. Maybe even throw in a Java interface style type too. This would allow complete interoperability with the .NET library and make Lisp a strong contender as a large-scale language. However with that said, coming from a Lisp background made learning F# rather easy. And I like how F# has gone the extra mile to provide types that you would commonly see it quantitative type work. I believe F# was created with mathematical work in mind and that in itself has value over Lisp.

查看更多
老娘就宠你
6楼-- · 2019-02-05 03:51

Comparing Lisp directly to F# isn't really fair, because at the end of the day with enough time you could write the same app in either language.

However, you should learn F# for the same reasons that a C# or Java developer should learn it - because it allows functional programming on the .NET platform. I'm not 100% familiar with Lisp, but I assume it has some of the same problems as OCaml in that there isn't stellar library support. How do you do Database access in Lisp? What about high-performance graphics?

If you want to learn more about 'Why .NET', check out this SO question.

查看更多
别忘想泡老子
7楼-- · 2019-02-05 03:53

Given that LISP is dynamically typed and F# is statically typed, I find such comparisons strange.

查看更多
登录 后发表回答