Live data from Hacker News

What's New in F# 4.1? [video]

channel9.msdn.com

31–40 of 65 posts

Re: What's New in F# 4.1? [video]

#31

We need HKT. F#. Cmon... I love F# but seriosly...

Not only we do not need HKT, we also do not need Profunctor Optics.

F# and its spirit animal OCaml are really great precisely because of this attitude.

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.

Re: What's New in F# 4.1? [video]

#32
post #24

Earlier quoted context omitted.

Is published? I have tried to use FParsec before for the same kind of language and failed.

Its currently in a private bitbucket repo. I can give you the parser though, MIT licensed. 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...

Ok, thanks.

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?

Re: What's New in F# 4.1? [video]

#33
post #32

Earlier quoted context omitted.

Its currently in a private bitbucket repo. I can give you the parser though, MIT licensed. 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...

Ok, thanks. 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?

Big benefit to me was being able to do it all with parser combinators, and without having to drop into another language like lex and yacc.

Re: What's New in F# 4.1? [video]

#34

We need HKT. F#. Cmon... I love F# but seriosly...

We're working on Type Classes. It seems like HKTs (or anything like them) are going to be hard without diverging in a huge way from the rest of the .NET ecosystem.

That's fantastic news! I currently use Scala for most of my personal development, but having type classes would make F# attractive enough for me to switch over. I much prefer the cleaner syntax of F#.

Losing HKT would be a shame, but that's a trade-off I would be willing to make.

Re: What's New in F# 4.1? [video]

#35

Earlier quoted context omitted.

If you wanted to create a version of F# that only allows pure functions, your best option is probably to modify the F# compiler (which is open source). However, that sounds like something that might not be all that useful. 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 mig…

My purpose would be to create a multiplayer game programming platform. Basically, it would come with a game loop already running, with communications already working. Then you could modify the game by changing functions that transform game tick N to game tick N+1.

There's another way to do this. Just scan the compiled code for access to anything other than a fairly short whitelist of functions. This is how Terrarium worked.

Re: What's New in F# 4.1? [video]

#36

Earlier quoted context omitted.

That isn't actually an alias. That is constructing a single-case discriminated union. DUs are compiled into classes and have a few things automatic equality. 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...

Yeah I realize there are more efficient aliases, but even so - just defaulting immutable data structures with only primitive types in them to cretae reference types feels like a massive foot gun performance wise. I couldn't imagine doing C# without value types, so for F# where things are usually more immutable, it has to be painful if e.g. a normal point(x,y) record is a class...

You could use a struct, record, or tuple for a point. I've done all of these before.

Re: What's New in F# 4.1? [video]

#37

Earlier quoted context omitted.

Not only we do not need HKT, we also do not need Profunctor Optics.

F# and its spirit animal OCaml are really great precisely because of this attitude. 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.

Higher kinded types reduce complexity in the same way generics reduce code complexity. If you think one makes things simpler but not the other, I would assume you're not familiar with it?

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.

Re: What's New in F# 4.1? [video]

#39

Earlier quoted context omitted.

Yeah I realize there are more efficient aliases, but even so - just defaulting immutable data structures with only primitive types in them to cretae reference types feels like a massive foot gun performance wise. I couldn't imagine doing C# without value types, so for F# where things are usually more immutable, it has to be painful if e.g. a normal point(x,y) record is a class...

You could use a struct, record, or tuple for a point. I've done all of these before.

Yes, and now they can be done right (as CLR structs)! It's just odd that this took until now.

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...

Re: What's New in F# 4.1? [video]

#40

We need HKT. F#. Cmon... I love F# but seriosly...

Awkward person who was in the video here

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!

Post reply on HN