Home >> Computers >> Programming >> Languages >> Clean




Around computer science Clean is a general-purpose purely functional programming language. Functional languages stress application of functions, when opposed to execution of commands, when inside imperative languages.

Features
Referential transparency - a work, given a equivalent inputs, universally gives a equivalent output. Uniqueness typing system - easily & functionally treat by owning unduplicatable resources like input & output forswearing monads List comprehension - compact, powerful listings generation syntax Guards for clear, concise conditionals Easily-to-utilise Filtered IDE. Portability is almost universally the elementary recompile to trend lines an additional platform, ascribable the high level of abstraction. Automatic garbage collection - one less tool to worry about Higher order functions and Currying Delayed evaluation support allows infinite data structures

Examples
Hello world(Store as hullo.icl):

module hello
Run = "Hello, world!"

Factorial: module factorial
fac Cypher = 1 fac north = north * fac (north-One) // buy a factorial of 10 Run = fac 10

Fibonacci sequence: module fibonacci
taradiddle Nought = 0 tarradiddle One = 1 taradiddle north = story (north - Two) + story (north - One)
Run = tarradiddle 7

Infix operator: (^) infixr Octet :: Int Int -> Int (^) x Nought = 1 (^) 10 north = tenorth * x ^ (n-One)

A nature and severity declaration states that a work occurs as correct associatory infix operator sustaining priority Ogdoad: this states that x*x^(north-One) is same to x*(x^(north-One)) when opposed to (x*x)^(north-One); this operator is pre-defined in the Uncontaminating standard environment.

How Clean works
Computation is according to graph rewriting and reduction. Constants like amounts come graphical record & functions come graphical record rewriting system. This, conjunctive by having compilation to native code, clean computer program comparatively convenient, possibly sustaining high abstraction.

Compiling

  • Source files (.icl) & design files (.dcl) come converted into Uninfected's platform independent bytecode (.abc), implemented around C and Clean.
  • Bytecode is converted to object code (.obj) utilizing C.
  • object code is linked by having more files inside the module & the runtime formulas & converted into a rule practicable in Clean and jerk. Earliest Fresh body versions were written wholly within C, so avoiding bootstrapping issues.

    Platforms
    Clean and jerk is available for Windows Macintosh Solaris Linux, but using limited input-output capabilities

    License

    Clean and jerk is licensed under a GNU LGPL, but may be utilized forgoing a LGPL whenever bought for €495.

  • The Game of Life
    Life: A CLEAN Programming Tutorial and Case Study

    Clean Game Library
    A complete development system for 2D games (arcade, side scrollers, platform games).

    Clean
    The Software Technology Research Group develops this pure and lazy functional programming language. Description of the language and software downloads.

    Sparkle
    A semi-automated theorem prover for proving properties of Clean programs.


    Computers: Parallel Computing: Programming: Languages
    Computers: Programming: Languages: Functional
    Computers: Programming: Languages: Garbage Collected
    Computers: Programming: Languages: Haskell





    © 2005 GeneralAnswers.org