Sign in to follow this  
stonemetal

Software Engineering in a functional Language

Recommended Posts

I have been learning Haskell off and on for a few months now. I feel fairly comfortable with the language at a fairly primitive level. Say doing a project Euler problem or so, but beyond that hasn't quite clicked yet. How do you design a software in a single assignment language? Is passing a giant ball of state really how it is done? Does anyone know of any good resources on designing software longer than a page in a functional(single assignment) language?

Share this post


Link to post
Share on other sites
Probably need to talk to a forum that's more familiar with Functional Programming. I can't answer your question. I gave FP a whirl for awhile, even helped organize the Seattle Functional Programmers, but I found that the FP community does not care about the performance concerns of game development. Also, there are practical issues of tool suppport; nowadays I tend to think that tool and library support issues dominate over theoretical niceties of what a language could do.

Share this post


Link to post
Share on other sites
There used to be a decent number of people who actively practiced functional programming. but they have all vanished. having moved on i supposed to other places as this place failed to meet a need.

as to what is done. Yes usually you pass your state around from function to function. sometimes you call a function that takes your stuff and returns stuff'. you usually work on algebraic types and match on them. now people are moving toward views since algebraic types are not encapsulated or easily extensible. So you got a bunch of loosely coupled functions that you can compose or which call other functions and at the end of it returns the final output.

But you know, I do not think functional programming on its own can structure massive, many people projects. In the large OOP wins. Thats why of all the functional languages those which accept this get the widest industry attention. Scala, F#, Ocaml.

Stuff to read. Right I am doing this off the top of my head due to short time so it will require you to do work to follow.

Craft of functional programming, elements of functional programming, programming languages and types - benjamin pierce, some guys thesis called functional datastructures or something, another pdf titled programming with bananas, lenses and something else i forgot, algebra of programming by bird is exorbitantly priced but enlightening if you can get it, implementation of functional languages is free and finally concepts, techniques and models of computer programming is a free more modern version of SICP.

good luck.

Share this post


Link to post
Share on other sites
Daerax's literature as links:

Types and Programming Languages: great book, easy to read (IMO).

Purely functional data structures

Concepts, Techniques, and Models of Computer Programming (or at Amazon): very important read if you're into programming languages in general, deals with a wide range of paradigms, not just functional.

Banana stuff

CTM (third link) explains how state is necessary for modularisation. Passing along state is possible, but "infects" your code everywhere. The trick is then to hide state as much as possible; the book discusses different approaches.

Share this post


Link to post
Share on other sites
Quote:
Original post by Daerax
But you know, I do not think functional programming on its own can structure massive, many people projects.


I disagree. GHC (Glasgow Haskell Compiler) is enormous, and it's written in Haskell using, obviously, GHC.

The biggest problem with functional languages such as Haskell is tool support. We take for granted how things like Visual Studio, code browsing, intellisense, IDE with integrated debugger, etc simplify the software development process. It's not that these tools *cannot* exist for technical reasons, they just don't currently.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this