Live data from Hacker News

ASP.NET and F# - Creating MVC web applications in F#

cs.hubfs.net

1–10 of 17 posts

Re: ASP.NET and F# - Creating MVC web applications in F#

#3
post #2

If you get to write all your business logic in F# and there are no needless sources of headaches, I guess that could be pretty nice if you already use ASP.NET.

There was a neat article a while back on building a Starcraft bot using F# for the AI and a C++/C# stack for interfacing with the game at a lower level.

http://news.ycombinator.com/item?id=1625939

Re: ASP.NET and F# - Creating MVC web applications in F#

#5
post #2

If you get to write all your business logic in F# and there are no needless sources of headaches, I guess that could be pretty nice if you already use ASP.NET.

Boo + ASP.NET is also really quite nice. Python syntax with static (inferred) typing and syntactical macros, with a nice base framework. While it hasn't replaced Python+Pylons for me when it comes to rapid development, it's really quite enjoyable for high performance stuff.

Re: ASP.NET and F# - Creating MVC web applications in F#

#6
post #4

Somewhere I read an article about how easy it is to create your own view engine for MVC. Given F#'s facility with DSLs, it seems it wouldn't be too infeasible to make an F# view engine too.

Some links to create your own engine in asp.net mvc: http://www.singingeels.com/Articles/Creating_a_Custom_View_E...

http://amazedsaint.blogspot.com/2010/06/creating-custom-view...

Unrelated, but every time I see an F# article I think of a quote from Juval Lowy I heard on the Dot Net Rocks podcast (I think), which went something like "Yeah, with F# you can just slam your fingers onto random keys and it will be valid code"

(edit:formatting)

Re: ASP.NET and F# - Creating MVC web applications in F#

#7
post #4

Somewhere I read an article about how easy it is to create your own view engine for MVC. Given F#'s facility with DSLs, it seems it wouldn't be too infeasible to make an F# view engine too.

Personally, I much prefer simple view engines that have limited computational power - the port of StringTemplate to ASP.Net MVC being my current favorite

http://code.google.com/p/string-template-view-engine-mvc/:

Re: ASP.NET and F# - Creating MVC web applications in F#

#8
post #4

Somewhere I read an article about how easy it is to create your own view engine for MVC. Given F#'s facility with DSLs, it seems it wouldn't be too infeasible to make an F# view engine too.

Some links to create your own engine in asp.net mvc: http://www.singingeels.com/Articles/Creating_a_Custom_View_E... http://amazedsaint.blogspot.com/2010/06/creating-custom-view... Unrelated, but every time I see an F# article I think of a quote from Juval Lowy I heard on the Dot Net Rocks podcast (I think), which went something like "Yeah, with F# you can just slam your fingers onto random keys and it will be valid…

...and it will be valid code

There are a lot of subtleties to the syntax that are not easy for someone new to the language to figure out, especially if you are new to the functional family of languages. The error messages are not always helpful. I can see F# will be a great tool for certain problems, and once you are really proficient I can understand making a statement like this.

Re: ASP.NET and F# - Creating MVC web applications in F#

#9
post #8

Earlier quoted context omitted.

Some links to create your own engine in asp.net mvc: http://www.singingeels.com/Articles/Creating_a_Custom_View_E... http://amazedsaint.blogspot.com/2010/06/creating-custom-view... Unrelated, but every time I see an F# article I think of a quote from Juval Lowy I heard on the Dot Net Rocks podcast (I think), which went something like "Yeah, with F# you can just slam your fingers onto random keys and it will be valid…

...and it will be valid code There are a lot of subtleties to the syntax that are not easy for someone new to the language to figure out, especially if you are new to the functional family of languages. The error messages are not always helpful. I can see F# will be a great tool for certain problems, and once you are really proficient I can understand making a statement like this.

Agreed, just found Juval's quote entertaining.

Re: ASP.NET and F# - Creating MVC web applications in F#

#10
First off, I love F#. I use it extensively for offline data processing, managing our build process (via FAKE), and general purpose Windows scripting. I've also dabbled in DSL creation, and if you follow any of examples it really is pretty easy to do. As Don Syme (F#'s creator) has said, F# is a lot like a statically typed Python (with lots more syntax).

But I wouldn't use it with ASP.NET. Learning F# is pretty heady and it would give your average .NET developer fits to learn it. You'd lose an advantage of using the .NET platform then - it's pretty easy to get average developers to be productive in .NET/C#. Forcing developers to learn F# would grind productivity to a halt.

Also, because of the whitespace requirements, F# is lousy in the webforms view engine. (Perhaps a Mako-like templating engine for F# would make sense).

Stick with C# for your web work and your libraries that your web site are using. Life will be easier.

If you really want to delve into F# on the web, these guys did a framework designed to be used with F#: http://www.bistroframework.org/

They also did a .NET port of the django templating engine: http://ndjango.org/

Post reply on HN