Jump to content
xisto Community
Sign in to follow this  
wykurz

Function Programming - About Function Languages mostly OCAML

Recommended Posts

two years ago i have discoverred function programming. i'd like to shortly discuss it here and, maby, encourage some of you to try your skills writing functions.

when programming imperatively, programmers often think of solving the problem in language categories. here i'd use an array, here i could use a pointer etc. funtion programming does not give programmer such tools. even more - thers is no such thing as variable.

function programming was invented by mathematicians. it's very simmilar to mathematical modelling of universe. solving a problem - writing an algorithm, is to define some absrtact form from simple (mathematical) objects, like numbers, sets, functions.

to show you some great abilities function programming gives the programmer it's good to think about everything as a function. even integers are functions! (please refer to Church numbers). now you can mix everything with everything and what you get might be also anything. function operating on funtions giving in result a function is common.

in my opinion, what's most cool when programming functions, is that code you create is clear and easy to understand. it makes debugging very simple. although solving a problem with functions might take a bit more time than imperatively. but you don't spend time on debugging. For instance it took me just an hour to write from a scrach AVL trees and test them. In C or C++ it would take at least twice that time.

if i interested you just a bit please refer to:
http://caml.inria.fr/
http://homepages.inf.ed.ac.uk/wadler/guide.html

Edited by microscopic^earthling (see edit history)

Share this post


Link to post
Share on other sites

Functional programming is indeed very nice. Also, it's now becoming a lot more useful with the introduction of F#, my current language of choice, that allows one to do functional programming (basically ocaml) in the .NET framework allowing you to link it up with everything else (including, for example, P#, a prolog interpreter for the .NET framework, allowing you do to predicate logic inference from a functional programming language :-)

Also, if you'd like to experiment to see what functional programming's about in a fun environment, I refer you to http://www.cs.ox.ac.uk/geomlab/

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  

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.