What's New in F# 4.1? [video]
channel9.msdn.com
channel9.msdn.com
* http://fable.io, which is a modern F# to JavaScript compiler that lets you build Elm-style apps, access React and all that fun
* http://ionide.io which is an F# integration for Atom and VS Code that is doing amazing work towards bringing F# to a fully cross-platform ecosystem
* http://notebooks.azure.com which is (very new) free Microsoft-hosted Jupyter Notebook service that provides support for the usual suspects (R and Python), but also ships with great F# support out-of-the-box
In other words, I think the language is way ahead of the libraries and tooling - there is so much more that can be done (and is being done) using F# as-is!
- install VSCode and then Ionide
- install .net core
- install mono (i believe ionide still uses mono)
- install node and npm and then yeoman
- install the aspnet generator for yo
- "yo aspnet" will give the option to generate a working ASP.NET F# website
Not in my experience. Never since it appear the setup have worked for me, not even once.
I try again last week. I need to copy-paste the .sh script from github because the one it generate was wrong.
P.D: I don' use yeoman. NPM bloat is not my style: I follow the MS tutorial:
https://docs.microsoft.com/en-us/dotnet/articles/fsharp/tuto...
Also, you don't need to use yeoman, "dotnet new --lang F#" produces a blank F# .net core project and then you can add all of the dependencies manually.
I'd love to learn more about what went wrong in setup. Keeping that article up to date and, more importantly, correct is a priority of mine, because I really want people to learn about Ionide and F#.
> build.sh: line 34: syntax error: unexpected end of file
So I delete the last empty line, and get:
> build.sh: line 33: syntax error near unexpected token `fi'
I don't see any wrong with the script (I don't know bash scripting). So I go to the github site and just copy from https://github.com/ionide/ionide-vscode-fake/blob/master/bui...
And it work.
This is the diff:
diff -r 8b6c97c12f6e build.sh
--- a/build.sh Fri Dec 09 20:27:05 2016 -0500
+++ b/build.sh Fri Dec 09 20:27:50 2016 -0500
@@ -3,7 +3,7 @@
then
# use .Net
- .paket/paket.bootstrapper.exe
+ .paket/paket.bootstrapper.exe prerelease
exit_code=$?
if [ $exit_code -ne 0 ]; then
exit $exit_code
@@ -15,7 +15,7 @@
exit $exit_code
fi
- packages/FAKE/tools/FAKE.exe $@ --fsiargs build.fsx
+ packages/FAKE/tools/FAKE.exe $@ --nocache --fsiargs build.fsx
else
# use mono
mono .paket/paket.bootstrapper.exe
@@ -29,5 +29,5 @@
if [ $exit_code -ne 0 ]; then
exit $exit_code
fi
- mono packages/FAKE/tools/FAKE.exe $@ --fsiargs -d:MONO build.fsx
+ mono packages/FAKE/tools/FAKE.exe $@ --nocache --fsiargs -d:MONO build.fsx
fi
\ No newline at end of fileI completely agree!
I wish I had more upvotes to give, since I'd give your comment the most if it were possible. I agree that there are some omissions from the community here, especially Ionide (which I personally use in addition to Visual Studio). I should probably do a video showing a breadth of F# tooling and libraries for F#, because it really is a great landscape where you can pick the tools and libraries based on their merit, rather than being stuck with one particular set of tools.
He says that what devs are telling them is that the language is good, but they want better tools, so he wouldn't be opposed to a solid maintenance release just around improving tooling (but nothing is planned yet).
So the day after watching that, four years after the video, it's a bit weird to find you saying "F# 4 and now F# 4.1 - the language is way ahead of the tooling".
The main holdup is that the build/packaging situation is disastrous.
Most stuff still relies on Mono, which is fine, but trying to get things running on core quickly runs you into articles that assume you know exactly what you're doing and how all the pieces fit together, which is also fine.
What's not fine is that the base task of wanting to download existing packages and run the result doesn't have a simple solution. The base .net core install comes with a project.json solution, which seems completely sane to me, but apparently that's deprecated and not how to do things. Then there's Nuget which is a package repo but apparently not a package manager because it's supposed to be a VS extension but maybe it is in the next version because there's a shell. There's also msbuild and some variant of it for fsharp which is mostly opaque XML but can be managed using a project called forge, which seemed to kind of work for me but also seems very opaque. There's also paket which manages dependencies from nuget, there's also Fake which seems to be a Rake-like build system.
I know I'm not the only one who's run into this. I've seen at least 4 other requests for help in various F# forums and everybody seems to pretty much shrug and say that they use VS.
If one of the F# cognoscenti could write up simple instructions on how to set up a project and run it using VSCode and .Net core, I'd be grateful.
Let me see if I can clarify the landscape a bit here:
.NET Core tooling support is still in absolute Preview. The runtime and libraries are stable, but the .NET Core SDK, MSBuild support for .NET Core, the project system in Visual Studio, etc. are all Preview support.
Much of the F# community is waiting on .NET Core tooling stability to act, which they have every right to do. .NET Core tooling is still in Preview, and still changing rapidly. Using any cross-platform community tooling or libraries on .NET Core is likely going to be rough right now, and that's because the underlying tooling that the community needs to rely on is in Preview.
F# support is still officially in alpha for .NET Core, a moniker we're pretty deliberate about because we don't want to "flip the switch" until everything is stable and compatible with existing code.
Honestly, if the churn is painful for you, the best advice I can give at this point is to wait until the tooling for .NET Core stabilizes and becomes release-quality. Up until that point, there will still be churn.
I do appreciate the efforts of the F# open source community has always made in maintaining an VF# team.
thus far i have command-line "hello world", eto.forms gui and gtk# gui (they mostly differ in what libraries they install). if you're playing with fable, i'd love if you contributed a script.
ParserUtils is where maybeIndented and indented are. They make indentation just work. There currently overzealous with backtracking though, makes errors kinda shit. Working on that at somepoint.
https://gist.github.com/xavierzwirtz/99479a11f1eefd3215467f7...
But this not look more easy than just do it as TopDown Parser. But I don't know your language so it maybe have provided you with some benefits more than just lines of code?
A more useful thing could potentially be to use the "F# Compiler Service" (which is the compiler API, exposed via a nice F# library) and create some tool that checks purity. I think many people might actually be interested in something like this.
If we are talking about building a language in F#, remember that is possible to use any language for that.
In fact is make support for side-efects and mutating that complicate the build of a compiler/interpreter.
"With higher-kinded types [...] type operators can be parameterized by other type operators. Java doesn’t support higher-kinded types, but, if it did, you would be able to write something like this:"
class GraphSearch<T> {
T<Node> frontier;
}
Source: https://www.stephanboyer.com/post/115/higher-rank-and-higher...Losing HKT would be a shame, but that's a trade-off I would be willing to make.
They're really good at saying "No" to things that offer at best incremental improvements at the cost of significant complexity.
"Profunctor Optics" is a great example. Cool paper, but no thanks.
Do you have examples of why it would add significant complexity? I use them constantly and it really simplifies my code a lot!
Also, I don't believe 'profunctor optics' is a paper, I think it's just one (interesting) implementation of optics, which are useful in any language that encourages immutability.
"Cool paper but no thanks" is a saying for when people come to you with an extremely new technique and want you to incorporate it at the language level with very little proofing in the field.
"Profunctor optics" is the a description of how profunctors encode lenses and similar structures. I am aware. I also think that technique can cook in Haskell land for a few more years before non-research projects should uptake it.
As for the 'cool paper' comment, I wasn't aware of this new jargon, thanks for informing heh. I'm not sure how well it will play outside of haskell, I've done a Scala encoding of them and it's a bit more awkward than other representations.
But it's also worth noting that this is not a rejection of the entire concept of lenses, just that right now Haskell's implementations leave a lot to be desired (e.g., abandon all error sanity, ye who enter here).
Haskell is as much a research platform as a programming language, and as such it has the leisure to experiment this way. Everyone else will wait awhile for things to bake. Look what happened when Haskell built its entire stdlib on monad transformers and then we all realized they're awful compared to the alternatives.
This is why I love working on an open project like F#. We get to disagree in public! I would actually like Typeclasses, though I have serious reservations in terms of not breaking back compatibility. I'm certainly not about to get on a table and rant about how "it was truly the lack of better ad-hoc polymorphism via higher-kinded types that kept me from writing good software in F#!", and I see a danger in bifurcating the language .... but I like Typeclasses and think they do solve some more nuanced issues out there.
I should probably be putting my opinions on the Typeclasses thread...
The issue you're looking for (since an ask for HKTs typically means that Typeclasses are the ideal feature) is here: https://github.com/fsharp/fslang-suggestions/issues/243
Please leave opinions, commentary, and vote if this is something you want! F# language design is done completely in the open, including motivation for features. Thanks!
type ProductId = ProductId of int
Meant it allocated an instance on the heap for it before 4.1? Wow.Generally speaking, it's better to use Units of Measure[0] when you want some compile-time semantics around numeric literals, as these don't incur the performance penalty of creating a class.
[0]: https://docs.microsoft.com/en-us/dotnet/articles/fsharp/lang...
I suppose it just shows that those of us that are using .NET to do "C++ work" (always CPU and GC bound, almost never IO bound) are pretty few...