ebooksgratis.com

See also ebooksgratis.com: no banners, no cookies, totally FREE.

CLASSICISTRANIERI HOME PAGE - YOUTUBE CHANNEL
Privacy Policy Cookie Policy Terms and Conditions
Factor (programming language) - Wikipedia, the free encyclopedia

Factor (programming language)

From Wikipedia, the free encyclopedia

Factor
Paradigm stack-based
Appeared in 2003
Developer Slava Pestov
Latest release Continuous Builds[1]
Typing discipline strong, dynamic
Influenced by Joy, Forth, Lisp, Self
Influenced Cat
OS Windows, Mac OS, Linux, others
License BSD license
Website factorcode.org

Factor is a dynamically typed concatenative programming language whose design and implementation is led by Slava Pestov. Factor's main influences are Joy, Forth, Lisp and Self. Current versions of Factor exist as Continuous Builds for supported platforms while version 1.0 is under developement[2]. A 1.0 release is planned in 2008.

Like other concatenative languages, Factor has a postfix syntax, meaning that you write the arguments of a function before its name. As an example, Hello world in Factor is

"Hello world" print

Factor is dynamically typed, and a unique object system accompanies it. In Factor, there is a small group of base types, and users and the standard library can make their own classes using tuples and other mechanisms. There is no inheritance, but there is delegation as in Self. Additionally, there are other ways to make classes other than types or tuples; Factor supports predicate classes and union classes. Factor's built-in compound datatypes include fixed and variable length vectors and hashtables. The language also supports floating point, and arbitrary precision integers. Linked lists, complex numbers and fractions are implemented in the standard library.

Factor was originally only interpreted, but is now fully compiled (the non-optimizing compiler basically unrolls the interpreter loop[1][2]). The optimizing machine code compiler is written entirely in Factor. It does not output standalone executables, but rather generates machine code which is saved in the image. This image can then be deployed with the deploy-tool which produces a minimal tree shaken image along with the VM.

When using the stack system does not suffice, lexical and dynamic scoping are supported alternatives. Factor has a growing library which supports vocabularies, continuations, an HTTP server and accompanying web framework, an OpenGL binding, a GUI library, an XML parser, and several other utilities.

One of Factor's main goals is to be useful for interactive and test-driven development, which is why Factor is, at its core, a safe version of Forth. Factor is dynamically typed, but the compiler assesses the stack depth of words (functions).

Contents

[edit] Lisp Like Features

Factor shares a lot of features with Lisp, including a homoiconic syntax, garbage collection, HOFs, compile-time evaluation, REPL, treeshaker, etc.

Unlike Lisp, function composition proceeds left to right rather than:

(languages (applicative (in (backwards (is (composition (function)))))))

you would write instead

function composition is backwards in applicative languages[3]

This is an inherent feature in concatenative languages.

[edit] Concurrency Support

Factor's concurrency support was insipired by Erlang, Termite, Scheme48 and Java's java.util.concurrent library including basic Lightweight co-operative threads, to advanced libraries supporting Promises/Futures, Mailboxes and Message-passing concurrency.

[edit] Implementations

So far, both Java and C implementations have been constructed. The Java implementation is deprecated and no longer maintained. The native runtime of the C version is continually shrinking as an increasing proportion of Factor is self-hosted. However, there will likely always be a portion of Factor written in C.

Though Factor does not adhere to an external standard the way C does, the language is heavily documented.

[edit] External links

[edit] References


aa - ab - af - ak - als - am - an - ang - ar - arc - as - ast - av - ay - az - ba - bar - bat_smg - bcl - be - be_x_old - bg - bh - bi - bm - bn - bo - bpy - br - bs - bug - bxr - ca - cbk_zam - cdo - ce - ceb - ch - cho - chr - chy - co - cr - crh - cs - csb - cu - cv - cy - da - de - diq - dsb - dv - dz - ee - el - eml - en - eo - es - et - eu - ext - fa - ff - fi - fiu_vro - fj - fo - fr - frp - fur - fy - ga - gan - gd - gl - glk - gn - got - gu - gv - ha - hak - haw - he - hi - hif - ho - hr - hsb - ht - hu - hy - hz - ia - id - ie - ig - ii - ik - ilo - io - is - it - iu - ja - jbo - jv - ka - kaa - kab - kg - ki - kj - kk - kl - km - kn - ko - kr - ks - ksh - ku - kv - kw - ky - la - lad - lb - lbe - lg - li - lij - lmo - ln - lo - lt - lv - map_bms - mdf - mg - mh - mi - mk - ml - mn - mo - mr - mt - mus - my - myv - mzn - na - nah - nap - nds - nds_nl - ne - new - ng - nl - nn - no - nov - nrm - nv - ny - oc - om - or - os - pa - pag - pam - pap - pdc - pi - pih - pl - pms - ps - pt - qu - quality - rm - rmy - rn - ro - roa_rup - roa_tara - ru - rw - sa - sah - sc - scn - sco - sd - se - sg - sh - si - simple - sk - sl - sm - sn - so - sr - srn - ss - st - stq - su - sv - sw - szl - ta - te - tet - tg - th - ti - tk - tl - tlh - tn - to - tpi - tr - ts - tt - tum - tw - ty - udm - ug - uk - ur - uz - ve - vec - vi - vls - vo - wa - war - wo - wuu - xal - xh - yi - yo - za - zea - zh - zh_classical - zh_min_nan - zh_yue - zu -