Hacker News new | ask | show | jobs
by DennisP 5739 days ago
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.
2 comments

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)

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

Looks pretty cool, I might try that out!