CS3101 Programming Languages (Lisp) Lecture 1

Total Page:16

File Type:pdf, Size:1020Kb

CS3101 Programming Languages (Lisp) Lecture 1 Intro Lists Types Evaluation Misc Variables Control Flow Defining Functions REPL Emacs CS3101 Programming Languages (Lisp) Lecture 1 Bob Coyne ([email protected]) Columbia University March 10, 2017 1/ 70 Intro Lists Types Evaluation Misc Variables Control Flow Defining Functions REPL Emacs Course Information • When: 7 Weeks (10:10am-Noon on Fridays) • Where: 417 Mathematics • Who (instructor): Bob Coyne ([email protected]) • Who (TA): Ben Kuykendall ([email protected]) • Why: Lisp is fun (and powerful)! 2/ 70 Intro Lists Types Evaluation Misc Variables Control Flow Defining Functions REPL Emacs Introduction to Lisp { Overview • Class participation: 10% • 5 homeworks (each due before the next class): 50% These will be small programming exercises to reinforce what's covered in class • Project proposal: 10% • Final project: 30% can be individuals or teams (up to 3 people) 3/ 70 Intro Lists Types Evaluation Misc Variables Control Flow Defining Functions REPL Emacs Approximate Syllabus March 10 Background: history, installing, resources. Basics: sym- bols, evaluation, data types, lists, conditionals, functions, lambda forms, Emacs, REPL, ... March 24 More basics: Backquote, vectors, sequences, file system, loop, format, packages, streams, debugger, compiling, ... March 31 Macros etc: Macros, closures, reader macros, Error sys- tem, performance tuning April 7 Objects etc: Type system, CLOS, Structs, FFI, OS hooks... April 14 External libraries: Quicklisp, ASDF, cl-json, cl-html, cl- ppcre, drakma, ... April 21 AI: Prolog in Lisp, knowledge representation, constraints, unification April 28 Lisp variants/offshoots (Elisp, Clojure, Scheme, Mathe- matica, Parenscript) 4/ 70 Intro Lists Types Evaluation Misc Variables Control Flow Defining Functions REPL Emacs Online Books and Language References • Practical Common Lisp (Peter Seibel) { [excellent modern intro to Lisp] http://www.gigamonkeys.com/book/ • Lisp Hyperspec { [very useful, nicely indexed language reference] http://www.lispworks.com/documentation/HyperSpec/Front/index.htm • Lisp Recipes (Edi Weitz) - [lots of practical info...access within Columbia network] http://link.springer.com/book/10.1007%2F978-1-4842-1176-2 • On Lisp (Paul Graham) { [semi-advanced, but excellent] http://www.paulgraham.com/onlisp.html • Common Lisp { A Gentle Introduction to Symbolic Computation (Touretzky) https://www.cs.cmu.edu/~dst/LispBook/book.pdf • Common Lisp the Language (Guy Steele) { [The de-facto language specification] https://www.cs.cmu.edu/Groups/AI/html/cltl/cltl2.html • Let over Lambda (Doug Hoyte) { [advanced on closures, etc] http://letoverlambda.com/ 5/ 70 Intro Lists Types Evaluation Misc Variables Control Flow Defining Functions REPL Emacs Useful websites and online resources • CLiki http://cliki.net • Planet Lisp (a Lisp \meta" blog) http://planet.lisp.org • Quicklisp https://www.quicklisp.org/beta/UNOFFICIAL/docs/ • Common Lisp Cookbook http://cl-cookbook.sourceforge.net/index.html • Lisp tutorials http://lisp.plasticki.com/show?36 • Peter Norvig on Python for Lisp programmers http://norvig.com/python-lisp.html 6/ 70 Intro Lists Types Evaluation Misc Variables Control Flow Defining Functions REPL Emacs Lisp Implementations In class, I'll be using SBCL and Lispworks • SBCL: http://www.sbcl.org/platform-table.html • Lispworks: http://www.lispworks.com/downloads/ • Allegro CL: http://franz.com/downloads/clp/survey • Others: ABCL, CMUCL, CLISP, OpenMCL, ECL, SCL https://common-lisp.net/~dlw/LispSurvey.html 7/ 70 Intro Lists Types Evaluation Misc Variables Control Flow Defining Functions REPL Emacs John McCarthy John McCarthy was one of the founders of the discipline of ar- tificial intelligence. He coined the term "artificial intelligence" (AI), developed the Lisp programming language family, sig- nificantly influenced the design of the ALGOL programming language, popularized timesharing, and was very influential in the early development of AI. McCarthy received many acco- lades and honors, such as the Turing Award for his contribu- tions to the topic of AI, the United States National Medal of Science, and the Kyoto Prize. (from wikipedia) 8/ 70 Intro Lists Types Evaluation Misc Variables Control Flow Defining Functions REPL Emacs Lisp history and dialects • Lisp (LISt Processing) is the second oldest language (1958) still in common use. Fortran was created one year earlier. Thanks to its simple syntax (lists) and macros (to transform those lists), Lisp has been called a \programmable programming language." • Highly influential: Introduced if-then-else construct; garbage collection; read-eval-print loop; dynamic typing; incremental compilation; homoiconicity and meta-programming, closures (via Scheme)... • Multi-paradigm: functional, procedural, reflective, meta 9/ 70 Intro Lists Types Evaluation Misc Variables Control Flow Defining Functions REPL Emacs Lisp Machines { MIT AI Lab (circa 1975) 10/ 70 Intro Lists Types Evaluation Misc Variables Control Flow Defining Functions REPL Emacs Commercial Lisp Machines circa 1980-1990 TI Explorer LMI Lambda Symbolics 11/ 70 Intro Lists Types Evaluation Misc Variables Control Flow Defining Functions REPL Emacs Symbolics Keyboard 12/ 70 Intro Lists Types Evaluation Misc Variables Control Flow Defining Functions REPL Emacs Intro and history Lists, s-expressions, and cons cells Data types Evaluation Misc operations Variables and value binding Flow of control Defining functions Evaluation and the Read Emacs 13/ 70 Intro Lists Types Evaluation Misc Variables Control Flow Defining Functions REPL Emacs Lists as programs and data { key idea of Lisp Arithmetic expressions: (+ (* 3 4) (* 4 5)) Conditional expressions: (when (> x 4) (print "bigger than 4")) Flat and nested lists ("columbia" "yale" "dartmouth" "penn" "cornell") (0 (1 2 3) (3 4 5) (6 (7 8))) Association lists and property lists (("new jersey" :capital "trenton") ("alabama" :capital "montgomery") ("new york" :capital "albany") ...) Variable assignment: (setq x '((1 "one") (2 "two") (3 "three"))) Function definition: (defun cube (x) (* x x x)) 14/ 70 Intro Lists Types Evaluation Misc Variables Control Flow Defining Functions REPL Emacs Minimal syntax No special syntax for operators and statements { just functional application to arguments in lists (FUNCTION arg0 arg1 arg3 ....) For example: (+ 2 3 4 5) ) 14 Including nested: (+ 2 (* 3 4)5) ) 19 15/ 70 Intro Lists Types Evaluation Misc Variables Control Flow Defining Functions REPL Emacs S-Expressions Lisp programs and data consist of s-expressions (Symbolic expressions) An s-expression can be an atom or list (including nested lists) • An atom can be a symbol, string, array, structure, number... • A list is sequence of cons cells linking s-expressions together Examples • (aaa 12 foo 44.0) is a flat list • (nil "hello" (99.0 1/2) foo) is a nested list • nil, "hello", 99.0, 1/2, and foo are all atoms. Lisp symbols are generally made upper case when they are read (print (list 1 2 3)) automatically becomes (PRINT (LIST 1 2 3)) 16/ 70 Intro Lists Types Evaluation Misc Variables Control Flow Defining Functions REPL Emacs Cons Cells { used to represent lists (a b c) • A cons cell is a pair of pointers { First part is the car and second part is the cdr • The car and cdr point to any s-expression • For a proper list, the CDR of last CONS cell points to nil • Can represent: flat lists, nested lists (trees), even circular lists and other structures. • Dots omitted when cdr is a list: '(a . (b . (c . nil))) ) (a b c) 17/ 70 Intro Lists Types Evaluation Misc Variables Control Flow Defining Functions REPL Emacs Cons Cells { used to represent lists (aardvark . nil) or (aardvark) (a b c) (a b c . d) Diagrams from https://www.cs.cmu.edu/~dst/LispBook/book.pdf 18/ 70 Intro Lists Types Evaluation Misc Variables Control Flow Defining Functions REPL Emacs Cons Cells for NESTED or SHARED lists ((BLUE SKY) (GREEN GRASS) (BROWN EARTH)) Two lists (TAKE A NAP) and (WHAT A NAP) sharing same (A NAP) 19/ 70 Intro Lists Types Evaluation Misc Variables Control Flow Defining Functions REPL Emacs Circular Lists are possible (setq cl '(a b c)) ) (a b c) (setf (cdddr cl) cl) ) (a b c a b c a b c a b c a b c a b c a b c a b c a b c a ...) Print length controlled by *PRINT-LENGTH* (setq cl '(a . a)) ) (a . a) (setf (car cl) cl) ) ((((((# . a) . a) . a) . a) . a) . a) Print depth controlled by *PRINT-LEVEL* 20/ 70 Intro Lists Types Evaluation Misc Variables Control Flow Defining Functions REPL Emacs Alists { association lists Alists provide a flexible lightweight way to store and retrieve data associations ((a . 1) (b . 2) (c . 3)) (defparameter *elephant-alist* '((:height . 10) (:color . gray) (:mammal? . t) (:locations . (africa asia)))) (cdr (assoc :color *elephant-alist*)) => gray 21/ 70 Intro Lists Types Evaluation Misc Variables Control Flow Defining Functions REPL Emacs Plists { property lists Plists provide another flexible lightweight way to store and retrieve data associations (a 1 b 2 c 3) (defparameter *elephant-plist* '(:height 10 :color gray :mammal? t :locations (africa asia))) (getf *elephant-plist* :locations) => (AFRICA ASIA) 22/ 70 Intro Lists Types Evaluation Misc Variables Control Flow Defining Functions REPL Emacs Intro and history Lists, s-expressions, and cons cells Data types Evaluation Misc operations Variables and value binding Flow of control Defining functions Evaluation and the Read-Eval-Print-Loop (REPL) Emacs 23/ 70 Intro Lists Types Evaluation Misc Variables Control Flow Defining Functions REPL Emacs Basic data types { each with their own test predicate Symbols: T, NIL, foo-1, system-error, *database*, foo.bar, sb-unix:unix-fstat (symbolp 'foo-1) ! T Numbers: 7, 33.33, #C(0.0 1.0), 343242342342342342 (numberp 33.0) ! T Strings: "artificial intelligence", "Lisp", "Barack Obama" (stringp 'foo) ! NIL Characters: #na, #nspace (characterp #nNEWLINE) ! T Lists: ((1 2 3) 4 5 (6 7 (8 9))) NIL is the empty list (), as well as being a symbol representing FALSE (listp '(a d)) ! T More: vectors, structs, hash tables, arrays, CLOS objects, ... (vectorp 343) ! nil ... etc 24/ 70 Intro Lists Types Evaluation Misc Variables Control Flow Defining Functions REPL Emacs Symbols Symbols have an associated name, value, function, property list.
Recommended publications
  • GNU/Linux AI & Alife HOWTO
    GNU/Linux AI & Alife HOWTO GNU/Linux AI & Alife HOWTO Table of Contents GNU/Linux AI & Alife HOWTO......................................................................................................................1 by John Eikenberry..................................................................................................................................1 1. Introduction..........................................................................................................................................1 2. Symbolic Systems (GOFAI)................................................................................................................1 3. Connectionism.....................................................................................................................................1 4. Evolutionary Computing......................................................................................................................1 5. Alife & Complex Systems...................................................................................................................1 6. Agents & Robotics...............................................................................................................................1 7. Statistical & Machine Learning...........................................................................................................2 8. Missing & Dead...................................................................................................................................2 1. Introduction.........................................................................................................................................2
    [Show full text]
  • Higher-Order Functions 15-150: Principles of Functional Programming – Lecture 13
    Higher-order Functions 15-150: Principles of Functional Programming { Lecture 13 Giselle Reis By now you might feel like you have a pretty good idea of what is going on in functional program- ming, but in reality we have used only a fragment of the language. In this lecture we see what more we can do and what gives the name functional to this paradigm. Let's take a step back and look at ML's typing system: we have basic types (such as int, string, etc.), tuples of types (t*t' ) and functions of a type to a type (t ->t' ). In a grammar style (where α is a basic type): τ ::= α j τ ∗ τ j τ ! τ What types allowed by this grammar have we not used so far? Well, we could, for instance, have a function below a tuple. Or even a function within a function, couldn't we? The following are completely valid types: int*(int -> int) int ->(int -> int) (int -> int) -> int The first one is a pair in which the first element is an integer and the second one is a function from integers to integers. The second one is a function from integers to functions (which have type int -> int). The third type is a function from functions to integers. The two last types are examples of higher-order functions1, i.e., a function which: • receives a function as a parameter; or • returns a function. Functions can be used like any other value. They are first-class citizens. Maybe this seems strange at first, but I am sure you have used higher-order functions before without noticing it.
    [Show full text]
  • An Implementation of Python for Racket
    An Implementation of Python for Racket Pedro Palma Ramos António Menezes Leitão INESC-ID, Instituto Superior Técnico, INESC-ID, Instituto Superior Técnico, Universidade de Lisboa Universidade de Lisboa Rua Alves Redol 9 Rua Alves Redol 9 Lisboa, Portugal Lisboa, Portugal [email protected] [email protected] ABSTRACT Keywords Racket is a descendent of Scheme that is widely used as a Python; Racket; Language implementations; Compilers first language for teaching computer science. To this end, Racket provides DrRacket, a simple but pedagogic IDE. On the other hand, Python is becoming increasingly popular 1. INTRODUCTION in a variety of areas, most notably among novice program- The Racket programming language is a descendent of Scheme, mers. This paper presents an implementation of Python a language that is well-known for its use in introductory for Racket which allows programmers to use DrRacket with programming courses. Racket comes with DrRacket, a ped- Python code, as well as adding Python support for other Dr- agogic IDE [2], used in many schools around the world, as Racket based tools. Our implementation also allows Racket it provides a simple and straightforward interface aimed at programs to take advantage of Python libraries, thus signif- inexperienced programmers. Racket provides different lan- icantly enlarging the number of usable libraries in Racket. guage levels, each one supporting more advanced features, that are used in different phases of the courses, allowing Our proposed solution involves compiling Python code into students to benefit from a smoother learning curve. Fur- semantically equivalent Racket source code. For the run- thermore, Racket and DrRacket support the development of time implementation, we present two different strategies: additional programming languages [13].
    [Show full text]
  • The Machine That Builds Itself: How the Strengths of Lisp Family
    Khomtchouk et al. OPINION NOTE The Machine that Builds Itself: How the Strengths of Lisp Family Languages Facilitate Building Complex and Flexible Bioinformatic Models Bohdan B. Khomtchouk1*, Edmund Weitz2 and Claes Wahlestedt1 *Correspondence: [email protected] Abstract 1Center for Therapeutic Innovation and Department of We address the need for expanding the presence of the Lisp family of Psychiatry and Behavioral programming languages in bioinformatics and computational biology research. Sciences, University of Miami Languages of this family, like Common Lisp, Scheme, or Clojure, facilitate the Miller School of Medicine, 1120 NW 14th ST, Miami, FL, USA creation of powerful and flexible software models that are required for complex 33136 and rapidly evolving domains like biology. We will point out several important key Full list of author information is features that distinguish languages of the Lisp family from other programming available at the end of the article languages and we will explain how these features can aid researchers in becoming more productive and creating better code. We will also show how these features make these languages ideal tools for artificial intelligence and machine learning applications. We will specifically stress the advantages of domain-specific languages (DSL): languages which are specialized to a particular area and thus not only facilitate easier research problem formulation, but also aid in the establishment of standards and best programming practices as applied to the specific research field at hand. DSLs are particularly easy to build in Common Lisp, the most comprehensive Lisp dialect, which is commonly referred to as the “programmable programming language.” We are convinced that Lisp grants programmers unprecedented power to build increasingly sophisticated artificial intelligence systems that may ultimately transform machine learning and AI research in bioinformatics and computational biology.
    [Show full text]
  • Typescript Language Specification
    TypeScript Language Specification Version 1.8 January, 2016 Microsoft is making this Specification available under the Open Web Foundation Final Specification Agreement Version 1.0 ("OWF 1.0") as of October 1, 2012. The OWF 1.0 is available at http://www.openwebfoundation.org/legal/the-owf-1-0-agreements/owfa-1-0. TypeScript is a trademark of Microsoft Corporation. Table of Contents 1 Introduction ................................................................................................................................................................................... 1 1.1 Ambient Declarations ..................................................................................................................................................... 3 1.2 Function Types .................................................................................................................................................................. 3 1.3 Object Types ...................................................................................................................................................................... 4 1.4 Structural Subtyping ....................................................................................................................................................... 6 1.5 Contextual Typing ............................................................................................................................................................ 7 1.6 Classes .................................................................................................................................................................................
    [Show full text]
  • Scala Tutorial
    Scala Tutorial SCALA TUTORIAL Simply Easy Learning by tutorialspoint.com tutorialspoint.com i ABOUT THE TUTORIAL Scala Tutorial Scala is a modern multi-paradigm programming language designed to express common programming patterns in a concise, elegant, and type-safe way. Scala has been created by Martin Odersky and he released the first version in 2003. Scala smoothly integrates features of object-oriented and functional languages. This tutorial gives a great understanding on Scala. Audience This tutorial has been prepared for the beginners to help them understand programming Language Scala in simple and easy steps. After completing this tutorial, you will find yourself at a moderate level of expertise in using Scala from where you can take yourself to next levels. Prerequisites Scala Programming is based on Java, so if you are aware of Java syntax, then it's pretty easy to learn Scala. Further if you do not have expertise in Java but you know any other programming language like C, C++ or Python, then it will also help in grasping Scala concepts very quickly. Copyright & Disclaimer Notice All the content and graphics on this tutorial are the property of tutorialspoint.com. Any content from tutorialspoint.com or this tutorial may not be redistributed or reproduced in any way, shape, or form without the written permission of tutorialspoint.com. Failure to do so is a violation of copyright laws. This tutorial may contain inaccuracies or errors and tutorialspoint provides no guarantee regarding the accuracy of the site or its contents including this tutorial. If you discover that the tutorialspoint.com site or this tutorial content contains some errors, please contact us at [email protected] TUTORIALS POINT Simply Easy Learning Table of Content Scala Tutorial ..........................................................................
    [Show full text]
  • Common Lispworks User Guide
    LispWorks® for the Windows® Operating System Common LispWorks User Guide Version 5.1 Copyright and Trademarks Common LispWorks User Guide (Windows version) Version 5.1 February 2008 Copyright © 2008 by LispWorks Ltd. All Rights Reserved. No part of this publication may be reproduced, stored in a retrieval system, or transmitted, in any form or by any means, electronic, mechanical, photocopying, recording, or otherwise, without the prior written permission of LispWorks Ltd. The information in this publication is provided for information only, is subject to change without notice, and should not be construed as a commitment by LispWorks Ltd. LispWorks Ltd assumes no responsibility or liability for any errors or inaccuracies that may appear in this publication. The software described in this book is furnished under license and may only be used or copied in accordance with the terms of that license. LispWorks and KnowledgeWorks are registered trademarks of LispWorks Ltd. Adobe and PostScript are registered trademarks of Adobe Systems Incorporated. Other brand or product names are the registered trade- marks or trademarks of their respective holders. The code for walker.lisp and compute-combination-points is excerpted with permission from PCL, Copyright © 1985, 1986, 1987, 1988 Xerox Corporation. The XP Pretty Printer bears the following copyright notice, which applies to the parts of LispWorks derived therefrom: Copyright © 1989 by the Massachusetts Institute of Technology, Cambridge, Massachusetts. Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, pro- vided that this copyright and permission notice appear in all copies and supporting documentation, and that the name of M.I.T.
    [Show full text]
  • IDE User Guide Version 7.1 Copyright and Trademarks Lispworks IDE User Guide (Unix Version) Version 7.1 September 2017 Copyright © 2017 by Lispworks Ltd
    LispWorks® IDE User Guide Version 7.1 Copyright and Trademarks LispWorks IDE User Guide (Unix version) Version 7.1 September 2017 Copyright © 2017 by LispWorks Ltd. All Rights Reserved. No part of this publication may be reproduced, stored in a retrieval system, or transmitted, in any form or by any means, electronic, mechanical, photocopying, recording, or otherwise, without the prior written permission of LispWorks Ltd. The information in this publication is provided for information only, is subject to change without notice, and should not be construed as a commitment by LispWorks Ltd. LispWorks Ltd assumes no responsibility or liability for any errors or inaccuracies that may appear in this publication. The software described in this book is furnished under license and may only be used or copied in accordance with the terms of that license. LispWorks and KnowledgeWorks are registered trademarks of LispWorks Ltd. Adobe and PostScript are registered trademarks of Adobe Systems Incorporated. Other brand or product names are the registered trade- marks or trademarks of their respective holders. The code for walker.lisp and compute-combination-points is excerpted with permission from PCL, Copyright © 1985, 1986, 1987, 1988 Xerox Corporation. The XP Pretty Printer bears the following copyright notice, which applies to the parts of LispWorks derived therefrom: Copyright © 1989 by the Massachusetts Institute of Technology, Cambridge, Massachusetts. Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, pro- vided that this copyright and permission notice appear in all copies and supporting documentation, and that the name of M.I.T.
    [Show full text]
  • How Lisp Systems Look Different in Proceedings of European Conference on Software Maintenance and Reengineering (CSMR 2008)
    How Lisp Systems Look Different In Proceedings of European Conference on Software Maintenance and Reengineering (CSMR 2008) Adrian Dozsa Tudor Gˆırba Radu Marinescu Politehnica University of Timis¸oara University of Berne Politehnica University of Timis¸oara Romania Switzerland Romania [email protected] [email protected] [email protected] Abstract rently used in a variety of domains, like bio-informatics (BioBike), data mining (PEPITe), knowledge-based en- Many reverse engineering approaches have been devel- gineering (Cycorp or Genworks), video games (Naughty oped to analyze software systems written in different lan- Dog), flight scheduling (ITA Software), natural language guages like C/C++ or Java. These approaches typically processing (SRI International), CAD (ICAD or OneSpace), rely on a meta-model, that is either specific for the language financial applications (American Express), web program- at hand or language independent (e.g. UML). However, one ming (Yahoo! Store or reddit.com), telecom (AT&T, British language that was hardly addressed is Lisp. While at first Telecom Labs or France Telecom R&D), electronic design sight it can be accommodated by current language inde- automation (AMD or American Microsystems) or planning pendent meta-models, Lisp has some unique features (e.g. systems (NASA’s Mars Pathfinder spacecraft mission) [16]. macros, CLOS entities) that are crucial for reverse engi- neering Lisp systems. In this paper we propose a suite of Why Lisp is Different. In spite of its almost fifty-year new visualizations that reveal the special traits of the Lisp history, and of the fact that other programming languages language and thus help in understanding complex Lisp sys- borrowed concepts from it, Lisp still presents some unique tems.
    [Show full text]
  • An Evaluation of Go and Clojure
    An evaluation of Go and Clojure A thesis submitted in partial satisfaction of the requirements for the degree Bachelors of Science in Computer Science Fall 2010 Robert Stimpfling Department of Computer Science University of Colorado, Boulder Advisor: Kenneth M. Anderson, PhD Department of Computer Science University of Colorado, Boulder 1. Introduction Concurrent programming languages are not new, but they have been getting a lot of attention more recently due to their potential with multiple processors. Processors have gone from growing exponentially in terms of speed, to growing in terms of quantity. This means processes that are completely serial in execution will soon be seeing a plateau in performance gains since they can only rely on one processor. A popular approach to using these extra processors is to make programs multi-threaded. The threads can execute in parallel and use shared memory to speed up execution times. These multithreaded processes can significantly speed up performance, as long as the number of dependencies remains low. Amdahl‘s law states that these performance gains can only be relative to the amount of processing that can be parallelized [1]. However, the performance gains are significant enough to be looked into. These gains not only come from the processing being divvied up into sections that run in parallel, but from the inherent gains from sharing memory and data structures. Passing new threads a copy of a data structure can be demanding on the processor because it requires the processor to delve into memory and make an exact copy in a new location in memory. Indeed some studies have shown that the problem with optimizing concurrent threads is not in utilizing the processors optimally, but in the need for technical improvements in memory performance [2].
    [Show full text]
  • Wiki Comunità Di Pratica
    STRUMENTI SOFTWARE PER LA COOPERAZIONE DI RETE Comunità Wiki Comunità di pratica Le comunità di pratica e di apprendimento sono gruppi sociali che hanno come obiettivo finale il generare conoscenza organizzata e di qualità cui ogni individuo può avere libero accesso. In queste comunità gli individui mirano a un apprendimento continuo e hanno consapevolezza delle proprie conoscenze. Non esistono differenze di tipo gerarchico: tutti hanno uguale importanza perché il lavoro di ciascuno è beneficio per l’intera comunità. La finalità è il miglioramento collettivo. Chi entra in questo tipo di organizzazione mira a un modello di condivisione; non esistono spazi privati o individuali, in quanto tutti condividono tutto. Chi ha conoscenza e la tiene per sé è come se non l’avesse. Le comunità di pratica tendono all'eccellenza, a prendere ciò che di meglio produce ognuno dei collaboratori. Questo metodo costruttivista punta ad una conoscenza che si costruisce insieme e rappresenta un modo di vivere, lavorare e studiare. É questa una concezione che si differenzia notevolmente dalle società di tipo individualistico. Tra queste troviamo la società occidentale dove tra gli uomini prevale la competizione e manca quella collaborazione che invece funge da motore pulsante nelle comunità di pratica. Le teorie di McLuhan Fra i più importanti teorici delle comunità di pratica c'è Marshall McLuhan. Negli strumenti del comunicare egli afferma: "nel regime della tecnologia elettrica il compito dell’uomo diventa quello di imparare e di sapere; tutte le forme di ricchezza derivano dallo spostamento d’informazione". Secondo il mito greco dell'alfabeto, prima dell'arrivo di re Cadmo (che introdusse in Grecia le lettere fonetiche), la conoscenza e il potere erano monopolio sacerdotale, in quanto la scrittura prealfabetica, con i suoi innumerevoli segni, era difficile da apprendere.
    [Show full text]
  • Clojure, Given the Pun on Closure, Representing Anything Specific
    dynamic, functional programming for the JVM “It (the logo) was designed by my brother, Tom Hickey. “It I wanted to involve c (c#), l (lisp) and j (java). I don't think we ever really discussed the colors Once I came up with Clojure, given the pun on closure, representing anything specific. I always vaguely the available domains and vast emptiness of the thought of them as earth and sky.” - Rich Hickey googlespace, it was an easy decision..” - Rich Hickey Mark Volkmann [email protected] Functional Programming (FP) In the spirit of saying OO is is ... encapsulation, inheritance and polymorphism ... • Pure Functions • produce results that only depend on inputs, not any global state • do not have side effects such as Real applications need some changing global state, file I/O or database updates side effects, but they should be clearly identified and isolated. • First Class Functions • can be held in variables • can be passed to and returned from other functions • Higher Order Functions • functions that do one or both of these: • accept other functions as arguments and execute them zero or more times • return another function 2 ... FP is ... Closures • main use is to pass • special functions that retain access to variables a block of code that were in their scope when the closure was created to a function • Partial Application • ability to create new functions from existing ones that take fewer arguments • Currying • transforming a function of n arguments into a chain of n one argument functions • Continuations ability to save execution state and return to it later think browser • back button 3 ..
    [Show full text]