r/programming • • May 13 '14

Will F# ever be a first class citizen?

http://blog.jaywayco.co.uk/?p=37
0 Upvotes

33 comments sorted by

3

u/DetriusXii May 13 '14

F# needs a linker. Files shouldn't have to be in a specific order in order for programs to compile.

1

u/asimian May 13 '14

It inherits that flaw from Ocaml.

4

u/Categoria May 13 '14

I used to think that way as well until I dramatically reversed my opinion about it. The compiler enforcing your design not to have any circular dependencies is a feature not a bug. It means that there's always a standalone chunk of code you can start reading from in isolation to understand the whole program. Whatever friction I get from not having circular dependencies I've learned to fix by adding more polymorphism or using structural types (which too bad F# doesn't support).

1

u/jconway007 May 13 '14 edited May 13 '14

Do you think circular dependencies are a result of the developer trying to model the real world in the same way we naturally talk and think about it?

Edit: make question more clear

0

u/Categoria May 13 '14

I'm not sure what you mean? Could you please elaborate or give an example. To clarify, I think that circular dependencies are an anti-pattern no matter how convenient they may sometimes look

1

u/jconway007 May 13 '14

Apollogies I have edited my question. Hopefully it makes more sense now

2

u/gonz808 May 13 '14

Yes, I was at a Don Syme talk a few weeks ago and he compared the dependencies for some f# and c# projects. Some of c# had crazy circular dependencies. I think Entity Framework was the "worst" one

http://fsharpforfunandprofit.com/assets/svg/ef.all.dot.svg

from http://fsharpforfunandprofit.com/posts/cycles-and-modularity-in-the-wild/

1

u/cparen May 14 '14

It sounds like you're suggesting that the entire concept of mutual recursion is inappropriate. However, there are a number of problems (parsing, for example) that are expressed much simpler via mutual recursion.

Is your objection against dependency cycles in general, or only at the scale of entire modules?

2

u/Categoria May 14 '14

Is your objection against dependency cycles in general, or only at the scale of entire modules?

Definitely my objection is only at the scale of entire modules because modules also act as compilation units.

3

u/[deleted] May 13 '14

I don't consider it a flaw myself. It definitely forces you to consider your design better. In the cases where I seriously wanted circular dependencies, I ended up resolving it with generics or a slight rethink of the structure of that module.

2

u/asimian May 13 '14

I can see that. Perhaps "limitation" would have been a better word.

1

u/Categoria May 13 '14

Last I remember, the IDE was too dumb to dagify your modules for you. I hope that changed since the last time I've used it.

1

u/[deleted] May 13 '14

dagify?

2

u/Categoria May 13 '14

Err, I mean topologically sort the modules for you. The equivalent in ocaml is ocamldep which is invoked by your build system.

1

u/[deleted] May 13 '14

Did you mean dagify as in DAGify then? Since that's what I assumed.

1

u/Categoria May 13 '14

Yeah I suppose that would clarify it too.

1

u/gonz808 May 13 '14

Why not?

4

u/[deleted] May 13 '14

I used F# to make a small game recently, and it was a very interesting experience. I had to first come to terms with the different paradigm and syntax, but once I did it was enjoyable to write code with.

3

u/fabzter May 13 '14

It will be. That day functional langages are "mainstream" and a business possibility.

2

u/trimbo May 13 '14

So you're saying the answer is "no" then.

3

u/Number127 May 13 '14

When the sun rises in the west and sets in the east. When the seas go dry and mountains blow in the wind like leaves.

1

u/R3PTILIA May 13 '14

which is the same as saying "when grrm releases twow"

-4

u/vagif May 13 '14

CoughSQLCoughExcelCough.

2

u/[deleted] May 13 '14

Those are not functional languages

1

u/[deleted] May 13 '14

I recommend looking up Functional Programming on a wiki. I don't know what you know, but judging from your errors, you seem to think that FP means "coding with functions".

0

u/fabzter May 13 '14

not even functional mate

1

u/[deleted] May 13 '14

[removed] — view removed comment

2

u/vytah May 13 '14

I used VS Express 2013 for Desktop with F# and it works. Granted, not as well as with C# and there's no GUI designer, but it works.

1

u/[deleted] May 13 '14

[removed] — view removed comment

2

u/vytah May 13 '14

I just installed something like this (not sure if that's the exact same installer): http://www.microsoft.com/en-us/download/details.aspx?id=41654 and it just worked; after that, apart from C#, VB and C++ I could also choose F# for new projects.

Caveats:

  • I haven't tried multi-language solutions.

  • Almost no refactoring support.

2

u/Eirenarch May 13 '14

In the past it didn't work (you needed Visual Studio Shell which is free but it was annoying). The latest release does.