Results 1 to 6 of 6

Thread: Functional languages.

  1. #1

    Thread Starter
    Raging swede Atheist's Avatar
    Join Date
    Aug 2005
    Location
    Sweden
    Posts
    8,018

    Functional languages.

    Alright Ive just started my programming education on university and the last lecture was about the different programming languages.

    One thing that puzzled me was about the group called "Functional languages" (Lisp for example), our teacher said it uses mathematical expressions and functions, and nothing more.
    It made me think...doesnt that make such languages pretty useless? I mean what can you do with them? Can you even write to / read from files? Not trying to bash the "Functional Languages", Im just curious...what are the advantages and where are they used?
    Rate posts that helped you. I do not reply to PM's with coding questions.
    How to Get Your Questions Answered
    Current project: tunaOS
    Me on.. BitBucket, Google Code, Github (pretty empty)

  2. #2
    PowerPoster techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,687

    Re: Functional languages.

    essentially, high-speed mathematical computations.... where time and accuracy is most important.

    -tg
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

  3. #3

    Thread Starter
    Raging swede Atheist's Avatar
    Join Date
    Aug 2005
    Location
    Sweden
    Posts
    8,018

    Re: Functional languages.

    Quote Originally Posted by techgnome
    essentially, high-speed mathematical computations.... where time and accuracy is most important.

    -tg
    Ah yes speed..didnt think of that. But our teacher also mentioned that they do not use memory, so values etc cant be saved in memory, I suppose that also is for speed? Results etc has to be printed directly to the output device (screen, printer etc) instead of being saved somewhere..

    EDIT: which also brings me to this..if you cant save values in memory, isnt it hard to perform advanced mathematical calculations without being able to use variables to store numbers?
    Last edited by Atheist; Sep 11th, 2007 at 01:53 PM.
    Rate posts that helped you. I do not reply to PM's with coding questions.
    How to Get Your Questions Answered
    Current project: tunaOS
    Me on.. BitBucket, Google Code, Github (pretty empty)

  4. #4
    PowerPoster techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,687

    Re: Functional languages.

    What it means is that it's in a volatile state. Cut the power, all is lost. Nothing can be saved. That's actually a simplistic view of it.... think of it this way. A function returns a value. That means you can use the result of that function to pass as a parameter to antother function,.... whose result can then also be used as a parameter to yet another function - All inline... meaning no variables to hold the results... Generally these languages also support Lambda expressions, where the function is defined inline as well. This is getting more and more notice as the next round of .NET will have some Lambda expression support.

    -tg
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

  5. #5

    Thread Starter
    Raging swede Atheist's Avatar
    Join Date
    Aug 2005
    Location
    Sweden
    Posts
    8,018

    Re: Functional languages.

    Oh ok. Thanks for that explanation
    I'd like to try out some coding in Lisp..
    Rate posts that helped you. I do not reply to PM's with coding questions.
    How to Get Your Questions Answered
    Current project: tunaOS
    Me on.. BitBucket, Google Code, Github (pretty empty)

  6. #6
    I'm about to be a PowerPoster!
    Join Date
    Jan 2005
    Location
    Everywhere
    Posts
    13,647

    Re: Functional languages.

    Not using memory is rubbish. Everything uses memory. The difference is that procedural/OO languages use state whereas functional languages emphasise lack of it.

    http://en.wikipedia.org/wiki/Functional programming

    Some features of functional languages such as composition make them much more powerful than procedural languages, but more specialised. Essentially they require a completely different approach to solving problems.

    Purely functional languages have limited use; multi-paradigm languages are more common (Lisp is multi-paradigm rather than purely functional).
    Since state is a 'necessary evil', if you will, in most programming, pure functional languages use tricks like monads whereas multi-paradigm languages can use techniques from imperative programming.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width