Programming Languages at a Glance Programming Languages at a Glance Published 2003 Copyright © 2003 by Andreas Hohmann Table of Contents 1

Total Page:16

File Type:pdf, Size:1020Kb

Programming Languages at a Glance Programming Languages at a Glance Published 2003 Copyright © 2003 by Andreas Hohmann Table of Contents 1 Programming Languages at a Glance Programming Languages at a Glance Published 2003 Copyright © 2003 by Andreas Hohmann Table of Contents 1. Introduction............................................................................................................................................1 1.1. Acknowledgements .....................................................................................................................2 2. Fortran....................................................................................................................................................3 2.1. Software and Installation.............................................................................................................3 2.2. Quick Tour ..................................................................................................................................3 2.2.1. Hello World ....................................................................................................................3 2.2.2. Expressions and Variables ..............................................................................................4 2.2.3. Arrays .............................................................................................................................6 2.2.4. Functions ........................................................................................................................6 Bibliography.......................................................................................................................................6 3. Common Lisp.........................................................................................................................................8 3.1. Software and Installation.............................................................................................................8 3.2. Quick Tour ..................................................................................................................................8 3.2.1. Lists and Expressions .....................................................................................................8 3.2.2. Functions ......................................................................................................................13 3.2.3. More Collections ..........................................................................................................16 3.2.4. Structures......................................................................................................................18 3.2.5. Input and Output...........................................................................................................19 3.3. More Features ...........................................................................................................................21 3.3.1. Object Oriented Programming .....................................................................................21 3.3.2. Macros ..........................................................................................................................23 3.3.3. Exceptions ....................................................................................................................24 3.3.4. Analysis Functions .......................................................................................................25 References........................................................................................................................................25 4. Cobol .....................................................................................................................................................27 4.1. Software and Installation...........................................................................................................27 4.2. Quick Tour ................................................................................................................................27 4.2.1. Hello World ..................................................................................................................27 4.2.2. Variables and Arithmetic ..............................................................................................28 4.2.3. Subroutines and Control Statements ............................................................................31 4.2.4. Data Structures .............................................................................................................35 4.2.5. Files and Records .........................................................................................................37 4.3. More Features ...........................................................................................................................38 4.3.1. Table Search .................................................................................................................38 4.3.2. Macros (Copy Books)...................................................................................................40 4.3.3. Subprograms.................................................................................................................41 4.3.4. Sort and Merge .............................................................................................................42 4.3.5. Screen Definitions ........................................................................................................46 4.4. Libraries and Common Examples.............................................................................................47 Bibliography.....................................................................................................................................47 iii 5. C ............................................................................................................................................................48 5.1. Software and Installation...........................................................................................................48 5.2. Quick Tour ................................................................................................................................48 5.2.1. Hello World ..................................................................................................................48 5.2.2. Control Flow.................................................................................................................50 5.2.3. Basic Types...................................................................................................................51 5.2.4. Structures and Type Definitions ...................................................................................55 5.2.5. Functions ......................................................................................................................56 5.2.6. Macros ..........................................................................................................................60 References........................................................................................................................................62 6. Smalltalk...............................................................................................................................................63 6.1. Software and Installation...........................................................................................................63 6.2. Quick Tour ................................................................................................................................63 6.2.1. Message Passing...........................................................................................................63 6.2.2. Collections....................................................................................................................66 6.2.3. Objects and Classes ......................................................................................................69 6.3. More Features ...........................................................................................................................71 6.3.1. An Object-Oriented Example.......................................................................................71 References........................................................................................................................................74 7. Prolog ....................................................................................................................................................75 7.1. Software and Installation...........................................................................................................75 7.2. Quick Tour ................................................................................................................................75 7.2.1. Goals, Facts, and Rules ................................................................................................75 7.2.2. Structures......................................................................................................................78 7.2.3. Collections....................................................................................................................79 7.2.4. Arithmetic.....................................................................................................................81 7.3. More Features ...........................................................................................................................82 7.3.1. Controlling Backtracking .............................................................................................82
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]
  • Oracle Database Licensing Information, 11G Release 2 (11.2) E10594-26
    Oracle® Database Licensing Information 11g Release 2 (11.2) E10594-26 July 2012 Oracle Database Licensing Information, 11g Release 2 (11.2) E10594-26 Copyright © 2004, 2012, Oracle and/or its affiliates. All rights reserved. Contributor: Manmeet Ahluwalia, Penny Avril, Charlie Berger, Michelle Bird, Carolyn Bruse, Rich Buchheim, Sandra Cheevers, Leo Cloutier, Bud Endress, Prabhaker Gongloor, Kevin Jernigan, Anil Khilani, Mughees Minhas, Trish McGonigle, Dennis MacNeil, Paul Narth, Anu Natarajan, Paul Needham, Martin Pena, Jill Robinson, Mark Townsend This software and related documentation are provided under a license agreement containing restrictions on use and disclosure and are protected by intellectual property laws. Except as expressly permitted in your license agreement or allowed by law, you may not use, copy, reproduce, translate, broadcast, modify, license, transmit, distribute, exhibit, perform, publish, or display any part, in any form, or by any means. Reverse engineering, disassembly, or decompilation of this software, unless required by law for interoperability, is prohibited. The information contained herein is subject to change without notice and is not warranted to be error-free. If you find any errors, please report them to us in writing. If this is software or related documentation that is delivered to the U.S. Government or anyone licensing it on behalf of the U.S. Government, the following notice is applicable: U.S. GOVERNMENT END USERS: Oracle programs, including any operating system, integrated software, any programs installed on the hardware, and/or documentation, delivered to U.S. Government end users are "commercial computer software" pursuant to the applicable Federal Acquisition Regulation and agency-specific supplemental regulations.
    [Show full text]
  • C++ Programming: Program Design Including Data Structures, Fifth Edition
    C++ Programming: From Problem Analysis to Program Design, Fifth Edition Chapter 5: Control Structures II (Repetition) Objectives In this chapter, you will: • Learn about repetition (looping) control structures • Explore how to construct and use count- controlled, sentinel-controlled, flag- controlled, and EOF-controlled repetition structures • Examine break and continue statements • Discover how to form and use nested control structures C++ Programming: From Problem Analysis to Program Design, Fifth Edition 2 Objectives (cont'd.) • Learn how to avoid bugs by avoiding patches • Learn how to debug loops C++ Programming: From Problem Analysis to Program Design, Fifth Edition 3 Why Is Repetition Needed? • Repetition allows you to efficiently use variables • Can input, add, and average multiple numbers using a limited number of variables • For example, to add five numbers: – Declare a variable for each number, input the numbers and add the variables together – Create a loop that reads a number into a variable and adds it to a variable that contains the sum of the numbers C++ Programming: From Problem Analysis to Program Design, Fifth Edition 4 while Looping (Repetition) Structure • The general form of the while statement is: while is a reserved word • Statement can be simple or compound • Expression acts as a decision maker and is usually a logical expression • Statement is called the body of the loop • The parentheses are part of the syntax C++ Programming: From Problem Analysis to Program Design, Fifth Edition 5 while Looping (Repetition)
    [Show full text]
  • 1 More on Type Checking Type Checking Done at Compile Time Is
    More on Type Checking Type Checking done at compile time is said to be static type checking. Type Checking done at run time is said to be dynamic type checking. Dynamic type checking is usually performed immediately before the execution of a particular operation. Dynamic type checking is usually implemented by storing a type tag in each data object that indicates the data type of the object. Dynamic type checking languages include SNOBOL4, LISP, APL, PERL, Visual BASIC, Ruby, and Python. Dynamic type checking is more often used in interpreted languages, whereas static type checking is used in compiled languages. Static type checking languages include C, Java, ML, FORTRAN, PL/I and Haskell. Static and Dynamic Type Checking The choice between static and dynamic typing requires some trade-offs. Many programmers strongly favor one over the other; some to the point of considering languages following the disfavored system to be unusable or crippled. Static typing finds type errors reliably and at compile time. This should increase the reliability of delivered program. However, programmers disagree over how common type errors are, and thus what proportion of those bugs which are written would be caught by static typing. Static typing advocates believe programs are more reliable when they have been type-checked, while dynamic typing advocates point to distributed code that has proven reliable and to small bug databases. The value of static typing, then, presumably increases as the strength of the type system is inc reased. Advocates of languages such as ML and Haskell have suggested that almost all bugs can be considered type errors, if the types used in a program are sufficiently well declared by the programmer or inferred by the compiler.
    [Show full text]
  • Bringing GNU Emacs to Native Code
    Bringing GNU Emacs to Native Code Andrea Corallo Luca Nassi Nicola Manca [email protected] [email protected] [email protected] CNR-SPIN Genoa, Italy ABSTRACT such a long-standing project. Although this makes it didactic, some Emacs Lisp (Elisp) is the Lisp dialect used by the Emacs text editor limitations prevent the current implementation of Emacs Lisp to family. GNU Emacs can currently execute Elisp code either inter- be appealing for broader use. In this context, performance issues preted or byte-interpreted after it has been compiled to byte-code. represent the main bottleneck, which can be broken down in three In this work we discuss the implementation of an optimizing com- main sub-problems: piler approach for Elisp targeting native code. The native compiler • lack of true multi-threading support, employs the byte-compiler’s internal representation as input and • garbage collection speed, exploits libgccjit to achieve code generation using the GNU Com- • code execution speed. piler Collection (GCC) infrastructure. Generated executables are From now on we will focus on the last of these issues, which con- stored as binary files and can be loaded and unloaded dynamically. stitutes the topic of this work. Most of the functionality of the compiler is written in Elisp itself, The current implementation traditionally approaches the prob- including several optimization passes, paired with a C back-end lem of code execution speed in two ways: to interface with the GNU Emacs core and libgccjit. Though still a work in progress, our implementation is able to bootstrap a func- • Implementing a large number of performance-sensitive prim- tional Emacs and compile all lexically scoped Elisp files, including itive functions (also known as subr) in C.
    [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]
  • Utgåvenoteringar För Fedora 11
    Fedora 11 Utgåvenoteringar Utgåvenoteringar för Fedora 11 Dale Bewley Paul Frields Chitlesh Goorah Kevin Kofler Rüdiger Landmann Ryan Lerch John McDonough Dominik Mierzejewski David Nalley Zachary Oglesby Jens Petersen Rahul Sundaram Miloslav Trmac Karsten Wade Copyright © 2009 Red Hat, Inc. and others. The text of and illustrations in this document are licensed by Red Hat under a Creative Commons Attribution–Share Alike 3.0 Unported license ("CC-BY-SA"). An explanation of CC-BY-SA is available at http://creativecommons.org/licenses/by-sa/3.0/. The original authors of this document, and Red Hat, designate the Fedora Project as the "Attribution Party" for purposes of CC-BY-SA. In accordance with CC-BY-SA, if you distribute this document or an adaptation of it, you must provide the URL for the original version. Red Hat, as the licensor of this document, waives the right to enforce, and agrees not to assert, Section 4d of CC-BY-SA to the fullest extent permitted by applicable law. Red Hat, Red Hat Enterprise Linux, the Shadowman logo, JBoss, MetaMatrix, Fedora, the Infinity Logo, and RHCE are trademarks of Red Hat, Inc., registered in the United States and other countries. 1 Utgåvenoteringar For guidelines on the permitted uses of the Fedora trademarks, refer to https:// fedoraproject.org/wiki/Legal:Trademark_guidelines. Linux® is the registered trademark of Linus Torvalds in the United States and other countries. Java® is a registered trademark of Oracle and/or its affiliates. XFS® is a trademark of Silicon Graphics International Corp. or its subsidiaries in the United States and/or other countries.
    [Show full text]
  • Php Foreach Array Example
    Php Foreach Array Example Positivism Sonnie always besought his dimeters if Esme is fruticose or touch-types incompletely. Sometimes anything.plenipotentiary Zane Gordieemits unobtrusively alchemise her while foreman untrained slower, Harlan but bubbliest presages Rodge obsoletely strides or pippingriotously masterfully. or recapitalizes You can have explored deep are using array_map prevents you forgot, and will keep multiple. How we have an associative array is a different values are times has a numeric array and arrays can be obtained by working along. This url into two variables are such type. PHP 4 introduced foreach construct it works only on arrays. Let's understand this with the help bear the porter example. The running one uses it. PHP foreach Manual. Sample PHP Code PHP For Loops Foreach While ago Do. Arrayvalue is your temporary variable that holds the current total item values block of code is the its of code that operates on already array values Example 1. Usually depending on my favourite site for passing it on how if statement. PHP foreach loops FreeKB. Start from any one statement is that, instead of items in an example of each elements with examples to get an array. PHP foreach within foreach repeat data flow not escaping loops. Of iteration helps you can access or public route on here? PHP foreach Loop GeeksforGeeks. Foreach Semantic portal learn smart. Nested for loops One for brother can be no inside another for purpose and force can generate different scripts using nested loops Here is an intelligence for. Here there is used in a block on array index or break statement or associative array by using a multidimensional array an.
    [Show full text]
  • Third-Party License Acknowledgments
    Symantec Privileged Access Manager Third-Party License Acknowledgments Version 3.4.3 Symantec Privileged Access Manager Third-Party License Acknowledgments Broadcom, the pulse logo, Connecting everything, and Symantec are among the trademarks of Broadcom. Copyright © 2021 Broadcom. All Rights Reserved. The term “Broadcom” refers to Broadcom Inc. and/or its subsidiaries. For more information, please visit www.broadcom.com. Broadcom reserves the right to make changes without further notice to any products or data herein to improve reliability, function, or design. Information furnished by Broadcom is believed to be accurate and reliable. However, Broadcom does not assume any liability arising out of the application or use of this information, nor the application or use of any product or circuit described herein, neither does it convey any license under its patent rights nor the rights of others. 2 Symantec Privileged Access Manager Third-Party License Acknowledgments Contents Activation 1.1.1 ..................................................................................................................................... 7 Adal4j 1.1.2 ............................................................................................................................................ 7 AdoptOpenJDK 1.8.0_282-b08 ............................................................................................................ 7 Aespipe 2.4e aespipe ........................................................................................................................
    [Show full text]
  • Concepts in Programming Languages Supervision 1 – 18/19 V1 Supervisor: Joe Isaacs (Josi2)
    Concepts in Programming Languages Supervision 1 { 18/19 v1 Supervisor: Joe Isaacs (josi2). All work should be submitted in PDF form 24 hours before the supervision to the email [email protected], ideally written in LATEX. If you have any questions on the course please include these at the top of the supervision work and we can talk about them in the supervision. Note: there is a revision guide http://www.cl.cam.ac.uk/teaching/1718/ConceptsPL/RG. pdf for this course. 1. What is the different between a static and dynamic typing. Give with justification which languages and static or dynamic. 2. What is the different between strong and weak typing. 3. What is type safety. How are type safety and type soundness distinct? 4. What type system does LISP have what are the basic types?, where have you seen a similar type system before. 5. What is a abstract machine, why are they useful? Where have you seen or used them before? 6. Name at least six different function calling schemes and which languages use each of them. 7. Give an overview of block-structured languages, include which ideas were first introduced in a programming language and how they influenced each other. Making sure to list the main characteristics of each language. You should talk about three distinct languages, then for each language make sure to make distinctions between different version of each language. Make a timeline using pen and paper or a diagram tool. 8. Using the type inference algorithm given in the notes (a typing checker with constraints) find the most general type for fn x ) fn y ) y x 9.
    [Show full text]
  • GNU MP the GNU Multiple Precision Arithmetic Library Edition 6.2.1 14 November 2020
    GNU MP The GNU Multiple Precision Arithmetic Library Edition 6.2.1 14 November 2020 by Torbj¨ornGranlund and the GMP development team This manual describes how to install and use the GNU multiple precision arithmetic library, version 6.2.1. Copyright 1991, 1993-2016, 2018-2020 Free Software Foundation, Inc. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.3 or any later version published by the Free Software Foundation; with no Invariant Sections, with the Front-Cover Texts being \A GNU Manual", and with the Back-Cover Texts being \You have freedom to copy and modify this GNU Manual, like GNU software". A copy of the license is included in Appendix C [GNU Free Documentation License], page 132. i Table of Contents GNU MP Copying Conditions :::::::::::::::::::::::::::::::::::: 1 1 Introduction to GNU MP ::::::::::::::::::::::::::::::::::::: 2 1.1 How to use this Manual :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 2 2 Installing GMP ::::::::::::::::::::::::::::::::::::::::::::::::: 3 2.1 Build Options:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 3 2.2 ABI and ISA :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 8 2.3 Notes for Package Builds:::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 11 2.4 Notes for Particular Systems :::::::::::::::::::::::::::::::::::::::::::::::::::::: 12 2.5 Known Build Problems ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 14 2.6 Performance
    [Show full text]
  • Aeroscript Programming Language Reference
    AeroScript Programming Language Reference Table of Contents Table of Contents 2 Structure of a Program 5 Comments 6 Preprocessor 7 Text Replacement Macro (#define/#undef) 7 Source File Inclusion (#include) 8 Conditional Inclusion (#if/#ifdef/#ifndef) 8 Data Types and Variables 11 Fundamental Data Types 11 Fundamental Numeric Data Types 11 Fundamental String Data Type 11 Fundamental Axis Data Type 11 Fundamental Handle Data Type 12 Aggregate Data Types 12 Array Data Types 12 Structure Data Types 13 Enumerated Data Types 14 Variables 15 Variable Declaration 15 Variable Names 15 Numeric, Axis, and Handle Variable Declaration Syntax 15 String Variable Declaration Syntax 15 Syntax for Declaring Multiple Variables on the Same Line 16 Array Variable Declaration Syntax 16 Structure Variable Definition and Declaration Syntax 16 Definition Syntax 16 Declaration Syntax 17 Member Access Syntax 17 Enumeration Variable Definition and Declaration Syntax 18 Definition 18 Declaration Syntax 19 Enumerator Access Syntax 19 Variable Initialization Syntax 20 Basic Variable Initialization Syntax 20 Array Variable Initialization Syntax 21 Structure Variable Initialization Syntax 22 Enumeration Variable Initialization Syntax 22 Variable Scope 23 Controller Global Variables 23 User-Defined Variables 23 User-Defined Variable Accessibility 23 User-Defined Local Variable Declaration Location 25 Variable Data Type Conversions 26 Properties 27 Property Declaration 27 Property Names 27 Property Declaration 28 Property Usage 28 Expressions 29 Literals 29 Numeric Literals
    [Show full text]