CA-Metacobol+ Structured Programming Guide

Total Page:16

File Type:pdf, Size:1020Kb

CA-Metacobol+ Structured Programming Guide CA-MetaCOBOL™ + Structured Programming Guide Release 1.1 R203M+11DRP Intra-module Control Structures -- PROPRIETARY AND CONFIDENTIAL INFORMATION -- This material contains, and is part of a computer software program which is, proprietary and confidential information owned by Computer Associates International, Inc. The program, including this material, may not be duplicated, disclosed or reproduced in whole or in part for any purpose without the express written authorization of Computer Associates. All authorized reproductions must be marked with this legend. RESTRICTED RIGHTS LEGEND Use, duplication, or disclosure by the United States Government ("the Government") is subject to restrictions as set forth in A) subparagraph (c) (2) of the Commercial Computer Software - Restricted Rights clause at FAR 52.227-19, and/or B) subparagraphs (c) (1) (ii) of the Rights in Technical Data and Computer Software clause of DFAR 252.227-7013. This software is distributed to the Government by: Computer Associates International, Inc. One Computer Associates Plaza Islandia, NY 11788-7000 Unpublished copyrighted work - all rights reserved under the copyright laws of the United States. This material may be reproduced by or for the United States Government pursuant to the copyright license under the clause at DFAR 252.227-7013 (October 1988). Release 1.1, January, 1992 Updated March, 1992, May, 1992 Copyright © 1992 Computer Associates International, Inc. All rights reserved. CA LIBRARIAN®, and CA PANVALET® are registered trademarks of Computer Associates, Inc. CA-MetaCOBOLTM + is a trademarks of Computer Associates, Inc. All product names referenced herein are trademarks of their respective companies. Contents _______________________________ 1. About this Manual 7 1.1 Purpose 7 1.2 Organization 7 1.3 Publications 8 1.4 Notation Conventions 9 1.5 Summary of Revisions 9 2. Introduction 11 2.1 What is Structured Programming? 11 2.2 What is the SP Facility? 12 2.3 The SP Facility versus Conventional COBOL and VS COBOL II 15 2.4 Getting Started 16 2.4.1 SP Facility Macro Sets 17 2.4.2 Sample JCL for Executing CA-MetaCOBOL+ 17 3. Module Definition and Invocation 21 3.1 Module Definition 22 3.2 Module Invocation 22 3.3 Use of the COBOL ENTRY Statement 24 4. Intra-module Control Structures 25 4.1 GO TO Alternative 26 4.2 SP Facility Control Structures 26 4.3 Selection 27 4.3.1 The IF Construct 27 4.3.2 The SELECT Constructs 29 4.3.3 The SELECT FIRST ACTION Construct 33 4.3.4 SEARCH Constructs 39 4.4 Repetition 43 4.4.1 The LOOP Construct 45 4.4.2 The LOOP...TIMES Construct 46 4.4.3 The LOOP VARYING/FOR Construct 48 4.4.4 ESCAPE 50 4.5 The Emergency EXIT 51 4.6 Standardized COBOL Conditions 52 4.7 The IS FALSE Condition Modifier 54 4.8 CICS Command Level Coding 55 5. Local Data Definitions and Control Variables 57 5.1 START DATA/END DATA and Local Data Definitions 58 5.2 Control Variables 59 5.2.1 The FLAG Statement 59 5.2.2 The SET-TRUE/SET-FALSE Statement 60 6. Structured Programming Support Macros 61 6.1 Structured Programming Documentor (SPD & SPDCOB) 61 6.1.1 Reports Produced 61 6.1.2 Raw Data Extraction 62 6.1.3 Generating Reports 63 6.2 High-Level Formatter (HLF) 64 6.3 Structured Programming Stub (SPS) Generator 65 7. Reading, Verifying, and Maintaining Structured Programs 67 7.1 A Comparison of Structured and COBOL Source 67 7.2 Correlation of Generated COBOL to Structured Source 70 7.3 Verification at the Structured Source Level 73 8. General Programming Verbs (GPV) 75 8.1 The ARRANGE Verb 75 8.2 The COLLATE Verb 77 8.3 The JCL-PARAMETERS Verb 81 8.4 FAIR Verbs 83 8.4.1 The OPEN-FAIR Verb 83 8.4.2 The START-FAIR Verb 85 8.4.3 The READ-FAIR Verb 86 8.4.4 The CLOSE-FAIR Verb 86 8.4.5 FAIR Verbs Example 87 8.5 Initialization Verbs 88 8.5.1 The CLEAR Verb 88 8.5.2 The RESET Verb 90 8.6 Bit Manipulation Verbs 91 8.6.1 The COMPRESS Verb 91 8.6.2 The EXPAND Verb 91 8.6.3 The SET-BITS Verb 92 8.6.4 The IF-BITS Verb 92 8.6.5 Bit-Manipulation Verbs Example 93 Appendix A - Structured Programming Facility Example 95 A.1 Problem Statement 95 A.2 Program 97 Appendix B - SPP-Generated Data-Names and Procedure-Names 101 B.1 SPP-Generated Data-Names 101 B.2 SPP-Generated, Module-Oriented Procedure-Names 102 B.3 SPP-Generated, Construct-Oriented Procedure-Names 103 Appendix C - Diagnostics 105 C.1 GPV Diagnostics 106 C.2 HLF Diagnostics 113 C.3 SPD Diagnostics 115 C.4 SPP Diagnostics for Structured Programming Processor (SPP) 117 C.5 SSPS Diagnostics 121 C.6 SSPV Diagnostics for Structured Programming Using VS COBOL II (SP2) 122 C.6.1 General 122 C.6.2 Module 123 C.6.3 Start/End Data 123 C.6.4 Flags Set-True/Set-False 124 C.6.5 Control Structures 125 C.6.6 IF/ELSE/ENDIF 126 C.6.7 SELECT/ENDSELECT and SEARCH/ENDSEARCH 127 C.6.8 LOOP/ENDLOOP 129 Index 131 1. About this Manual _______________________________ 1.1 Purpose This manual is both a guide and reference for using the CA-MetaCOBOL+ Structured Programming (SP) Facility. 1.2 Organization Chapter Description 1 Discusses the purpose of the manual, gives a list of CA-MetaCOBOL+ documentation, and explains notation conventions for CA-MetaCOBOL+. 2 Introduces the CA-MetaCOBOL+ Structured Programming (SP) Facility, including the support of the structured programming macro sets. 3 Describes how to define modules and invoke subordinate modules to create single entry, single exit modules. 4 Describes structured programming sequence, selection, and repetition constructs implemented in CA-MetaCOBOL+. 5 Discusses local data definition and unique control variables. 6 Discusses macro sets of the SP Facility. 7 Compares generated COBOL to structured source code. 8 Describes ways to access CA LIBRARIAN, manipulate bits, and sort tables. Appendix A Provides and describes a sample CA-MetaCOBOL+ SP program. Structured Programming Guide 7 About This Manual Appendix B Describes various categories of generated data names and procedure names. Appendix C Contains the diagnostics for the Structured Programming Facility. 1.3 Publications In addition to this manual, the following publications are supplied with CA-MetaCOBOL+. Title Contents Introduction to CA-MetaCOBOL+ Introduces the CA-MetaCOBOL+ Work Bench, Structured Programming Facility, Quality Assuranc Facility, CA-DATACOM/DB Facility, Macro Facility, Panel Definition Facility, and the Online Programming Language. Installation Guide - MVS Explains how to install CA-MetaCOBOL+ in the MVS environment. CA ACTIVATOR Installation Explains how to install CA-MetaCOBOL+ in the Supplement - MVS MVS environment using CA-ACTIVATOR. Installation Guide - VSE Explains how to install CA-MetaCOBOL+ in the VSE environment. Installation Guide - CMS Explains how to install CA-MetaCOBOL+ in the VM environment. User Guide Explains how to customize, get started, and use CA MetaCOBOL+. Includes information on keyword expansion, the CA-MetaCOBOL+ translator, and CA macro sets and programs. Structured Programming Guide Introduces the Structured Programming Facility. Includes information on creating, testing, and maintaining structured programs. Macro Facility Tutorial Introduces the Macro Facility. Includes information on writing basic macros, model programming, macro writing techniques, and debugging. Macro Facility Reference Includes detailed information on the program flow o the CA-MetaCOBOL+ macro translator, macro format, definition of comments, macro nesting, macro prototypes, symbolic words, and model programming. Quality Assurance Guide Introduces the Quality Assurance Facility. Includes all the necessary information to perform quality assurance testing on COBOL source programs. Program Development Guide CA- Includes all the information necessary to develop DATACOM/DB programs that make full use of the functions and features of the CA-DATACOB/DB environment. Program Development Reference Contains all CA-DATACOM/DB Facility constructs CA-DATACOM/DB and statements. Panel Definition Facility Command Contains all Panel Defintion Facility commands. Reference 8 CA-MetaCOBOL+ Publications Panel Definition Facility User GuideIncludes all the information necessary to create, edit, duplicate, rename, delete, index, and print panel definitions and members. Also describes how to generate BMS source. Online Programming Language Contains all Online Programming Language Reference statements. All manuals are updated as required. Instructions accompany each update package. 1.4 Notation Conventions The following conventions are used in the command formats throughout this manual: UPPERCASE is used to display commands or keywords you must code exactly as shown. lowercase italic is used to display information you must supply. For example, DASD space parameters may appear as xxxxxxx xxxxxxx xxxxxxx. Underscores either show a default value in a screen image, or represents the highlighting of a word in a screen image. Brackets [ ] mean that you can select one of the items enclosed by the brackets; none of the enclosed items is required. Braces { } mean that you must select one of the items enclosed by the braces. Vertical Bar | separates options. One vertical bar separates two options, two vertical bars separate three options, and so on. You must select one of the options. Ellipsis . means that you can repeat the word or clause that immediately precedes the ellipsis. 1.5 Summary of Revisions Minor technical and editorial revisions have been made throughout the manual. Structured Programming Guide 9 2. Introduction _______________________________ This chapter introduces structured programming with the Structured Programming (SP) Facility. It also disusses the benefits of using the SP Facility over IBM's VS COBOL II and standard COBOL. 2.1 What is Structured Programming? Structured programming is a discipline that helps programmers develop programs efficiently.
Recommended publications
  • 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]
  • Compiler Construction Assignment 3 – Spring 2018
    Compiler Construction Assignment 3 { Spring 2018 Robert van Engelen µc for the JVM µc (micro-C) is a small C-inspired programming language. In this assignment we will implement a compiler in C++ for µc. The compiler compiles µc programs to java class files for execution with the Java virtual machine. To implement the compiler, we can reuse the same concepts in the code-generation parts that were done in programming assignment 1 and reuse parts of the lexical analyzer you implemented in programming assignment 2. We will implement a new parser based on Yacc/Bison. This new parser utilizes translation schemes defined in Yacc grammars to emit Java bytecode. In the next programming assignment (the last assignment following this assignment) we will further extend the capabilities of our µc compiler by adding static semantics such as data types, apply type checking, and implement scoping rules for functions and blocks. Download Download the Pr3.zip file from http://www.cs.fsu.edu/~engelen/courses/COP5621/Pr3.zip. After unzipping you will get the following files Makefile A makefile bytecode.c The bytecode emitter (same as Pr1) bytecode.h The bytecode definitions (same as Pr1) error.c Error reporter global.h Global definitions init.c Symbol table initialization javaclass.c Java class file operations (same as Pr1) javaclass.h Java class file definitions (same as Pr1) mycc.l *) Lex specification mycc.y *) Yacc specification and main program symbol.c *) Symbol table operations test#.uc A number of µc test programs The files marked ∗) are incomplete. For this assignment you are required to complete these files.
    [Show full text]
  • PDF Python 3
    Python for Everybody Exploring Data Using Python 3 Charles R. Severance 5.7. LOOP PATTERNS 61 In Python terms, the variable friends is a list1 of three strings and the for loop goes through the list and executes the body once for each of the three strings in the list resulting in this output: Happy New Year: Joseph Happy New Year: Glenn Happy New Year: Sally Done! Translating this for loop to English is not as direct as the while, but if you think of friends as a set, it goes like this: “Run the statements in the body of the for loop once for each friend in the set named friends.” Looking at the for loop, for and in are reserved Python keywords, and friend and friends are variables. for friend in friends: print('Happy New Year:', friend) In particular, friend is the iteration variable for the for loop. The variable friend changes for each iteration of the loop and controls when the for loop completes. The iteration variable steps successively through the three strings stored in the friends variable. 5.7 Loop patterns Often we use a for or while loop to go through a list of items or the contents of a file and we are looking for something such as the largest or smallest value of the data we scan through. These loops are generally constructed by: • Initializing one or more variables before the loop starts • Performing some computation on each item in the loop body, possibly chang- ing the variables in the body of the loop • Looking at the resulting variables when the loop completes We will use a list of numbers to demonstrate the concepts and construction of these loop patterns.
    [Show full text]
  • 7. Control Flow First?
    Copyright (C) R.A. van Engelen, FSU Department of Computer Science, 2000-2004 Ordering Program Execution: What is Done 7. Control Flow First? Overview Categories for specifying ordering in programming languages: Expressions 1. Sequencing: the execution of statements and evaluation of Evaluation order expressions is usually in the order in which they appear in a Assignments program text Structured and unstructured flow constructs 2. Selection (or alternation): a run-time condition determines the Goto's choice among two or more statements or expressions Sequencing 3. Iteration: a statement is repeated a number of times or until a Selection run-time condition is met Iteration and iterators 4. Procedural abstraction: subroutines encapsulate collections of Recursion statements and subroutine calls can be treated as single Nondeterminacy statements 5. Recursion: subroutines which call themselves directly or indirectly to solve a problem, where the problem is typically defined in terms of simpler versions of itself 6. Concurrency: two or more program fragments executed in parallel, either on separate processors or interleaved on a single processor Note: Study Chapter 6 of the textbook except Section 7. Nondeterminacy: the execution order among alternative 6.6.2. constructs is deliberately left unspecified, indicating that any alternative will lead to a correct result Expression Syntax Expression Evaluation Ordering: Precedence An expression consists of and Associativity An atomic object, e.g. number or variable The use of infix, prefix, and postfix notation leads to ambiguity An operator applied to a collection of operands (or as to what is an operand of what arguments) which are expressions Fortran example: a+b*c**d**e/f Common syntactic forms for operators: The choice among alternative evaluation orders depends on Function call notation, e.g.
    [Show full text]
  • Structured Programming - Retrospect and Prospect Harlan D
    University of Tennessee, Knoxville Trace: Tennessee Research and Creative Exchange The aH rlan D. Mills Collection Science Alliance 11-1986 Structured Programming - Retrospect and Prospect Harlan D. Mills Follow this and additional works at: http://trace.tennessee.edu/utk_harlan Part of the Software Engineering Commons Recommended Citation Mills, Harlan D., "Structured Programming - Retrospect and Prospect" (1986). The Harlan D. Mills Collection. http://trace.tennessee.edu/utk_harlan/20 This Article is brought to you for free and open access by the Science Alliance at Trace: Tennessee Research and Creative Exchange. It has been accepted for inclusion in The aH rlan D. Mills Collection by an authorized administrator of Trace: Tennessee Research and Creative Exchange. For more information, please contact [email protected]. mJNDAMNTL9JNNEPTS IN SOFTWARE ENGINEERING Structured Programming. Retrospect and Prospect Harlan D. Mills, IBM Corp. Stnuctured program- 2 ' dsger W. Dijkstra's 1969 "Struc- mon wisdom that no sizable program Ste red .tured Programming" articlel could be error-free. After, many sizable ming haxs changed ho w precipitated a decade of intense programs have run a year or more with no programs are written focus on programming techniques that has errors detected. since its introduction fundamentally alteredhumanexpectations and achievements in software devel- Impact of structured programming. two decades ago. opment. These expectations and achievements are However, it still has a Before this decade of intense focus, pro- not universal because of the inertia of lot of potentialfor gramming was regarded as a private, industrial practices. But they are well- lot of fo puzzle-solving activity ofwriting computer enough established to herald fundamental more change.
    [Show full text]
  • Repetition Structures
    24785_CH06_BRONSON.qrk 11/10/04 9:05 M Page 301 Repetition Structures 6.1 Introduction Goals 6.2 Do While Loops 6.3 Interactive Do While Loops 6.4 For/Next Loops 6.5 Nested Loops 6.6 Exit-Controlled Loops 6.7 Focus on Program Design and Implementation: After-the- Fact Data Validation and Creating Keyboard Shortcuts 6.8 Knowing About: Programming Costs 6.9 Common Programming Errors and Problems 6.10 Chapter Review 24785_CH06_BRONSON.qrk 11/10/04 9:05 M Page 302 302 | Chapter 6: Repetition Structures The applications examined so far have illustrated the programming concepts involved in input, output, assignment, and selection capabilities. By this time you should have gained enough experience to be comfortable with these concepts and the mechanics of implementing them using Visual Basic. However, many problems require a repetition capability, in which the same calculation or sequence of instructions is repeated, over and over, using different sets of data. Examples of such repetition include continual checking of user data entries until an acceptable entry, such as a valid password, is made; counting and accumulating running totals; and recurring acceptance of input data and recalculation of output values that only stop upon entry of a designated value. This chapter explores the different methods that programmers use to construct repeating sections of code and how they can be implemented in Visual Basic. A repeated procedural section of code is commonly called a loop, because after the last statement in the code is executed, the program branches, or loops back to the first statement and starts another repetition.
    [Show full text]
  • Edsger W. Dijkstra: a Commemoration
    Edsger W. Dijkstra: a Commemoration Krzysztof R. Apt1 and Tony Hoare2 (editors) 1 CWI, Amsterdam, The Netherlands and MIMUW, University of Warsaw, Poland 2 Department of Computer Science and Technology, University of Cambridge and Microsoft Research Ltd, Cambridge, UK Abstract This article is a multiauthored portrait of Edsger Wybe Dijkstra that consists of testimo- nials written by several friends, colleagues, and students of his. It provides unique insights into his personality, working style and habits, and his influence on other computer scientists, as a researcher, teacher, and mentor. Contents Preface 3 Tony Hoare 4 Donald Knuth 9 Christian Lengauer 11 K. Mani Chandy 13 Eric C.R. Hehner 15 Mark Scheevel 17 Krzysztof R. Apt 18 arXiv:2104.03392v1 [cs.GL] 7 Apr 2021 Niklaus Wirth 20 Lex Bijlsma 23 Manfred Broy 24 David Gries 26 Ted Herman 28 Alain J. Martin 29 J Strother Moore 31 Vladimir Lifschitz 33 Wim H. Hesselink 34 1 Hamilton Richards 36 Ken Calvert 38 David Naumann 40 David Turner 42 J.R. Rao 44 Jayadev Misra 47 Rajeev Joshi 50 Maarten van Emden 52 Two Tuesday Afternoon Clubs 54 2 Preface Edsger Dijkstra was perhaps the best known, and certainly the most discussed, computer scientist of the seventies and eighties. We both knew Dijkstra |though each of us in different ways| and we both were aware that his influence on computer science was not limited to his pioneering software projects and research articles. He interacted with his colleagues by way of numerous discussions, extensive letter correspondence, and hundreds of so-called EWD reports that he used to send to a select group of researchers.
    [Show full text]
  • An Introduction to Programming in Simula
    An Introduction to Programming in Simula Rob Pooley This document, including all parts below hyperlinked directly to it, is copyright Rob Pooley ([email protected]). You are free to use it for your own non-commercial purposes, but may not copy it or reproduce all or part of it without including this paragraph. If you wish to use it for gain in any manner, you should contact Rob Pooley for terms appropriate to that use. Teachers in publicly funded schools, universities and colleges are free to use it in their normal teaching. Anyone, including vendors of commercial products, may include links to it in any documentation they distribute, so long as the link is to this page, not any sub-part. This is an .pdf version of the book originally published by Blackwell Scientific Publications. The copyright of that book also belongs to Rob Pooley. REMARK: This document is reassembled from the HTML version found on the web: https://web.archive.org/web/20040919031218/http://www.macs.hw.ac.uk/~rjp/bookhtml/ Oslo 20. March 2018 Øystein Myhre Andersen Table of Contents Chapter 1 - Begin at the beginning Basics Chapter 2 - And end at the end Syntax and semantics of basic elements Chapter 3 - Type cast actors Basic arithmetic and other simple types Chapter 4 - If only Conditional statements Chapter 5 - Would you mind repeating that? Texts and while loops Chapter 6 - Correct Procedures Building blocks Chapter 7 - File FOR future reference Simple input and output using InFile, OutFile and PrintFile Chapter 8 - Item by Item Item oriented reading and writing and for loops Chapter 9 - Classes as Records Chapter 10 - Make me a list Lists 1 - Arrays and simple linked lists Reference comparison Chapter 11 - Like parent like child Sub-classes and complex Boolean expressions Chapter 12 - A Language with Character Character handling, switches and jumps Chapter 13 - Let Us See what We Can See Inspection and Remote Accessing Chapter 14 - Side by Side Coroutines Chapter 15 - File For Immediate Use Direct and Byte Files Chapter 16 - With All My Worldly Goods..
    [Show full text]
  • 6Up with Notes
    Notes CSCE150A Computer Science & Engineering 150A Problem Solving Using Computers Lecture 05 - Loops Stephen Scott (Adapted from Christopher M. Bourke) Fall 2009 1 / 1 [email protected] Chapter 5 CSCE150A 5.1 Repetition in Programs 5.2 Counting Loops and the While Statement 5.3 Computing a Sum or a Product in a Loop 5.4 The for Statement 5.5 Conditional Loops 5.6 Loop Design 5.7 Nested Loops 5.8 Do While Statement and Flag-Controlled Loops 5.10 How to Debug and Test 5.11 Common Programming Errors 2 / 1 Repetition in Programs CSCE150A Just as the ability to make decisions (if-else selection statements) is an important programming tool, so too is the ability to specify the repetition of a group of operations. When solving a general problem, it is sometimes helpful to write a solution to a specific case. Once this is done, ask yourself: Were there any steps that I repeated? If so, which ones? Do I know how many times I will have to repeat the steps? If not, how did I know how long to keep repeating the steps? 3 / 1 Notes Counting Loops CSCE150A A counter-controlled loop (or counting loop) is a loop whose repetition is managed by a loop control variable whose value represents a count. Also called a while loop. 1 Set counter to an initial value of 0 2 while counter < someF inalV alue do 3 Block of program code 4 Increase counter by 1 5 end Algorithm 1: Counter-Controlled Loop 4 / 1 The C While Loop CSCE150A This while loop computes and displays the gross pay for seven employees.
    [Show full text]
  • A Short Introduction to Ocaml
    Ecole´ Polytechnique INF549 A Short Introduction to OCaml Jean-Christophe Filli^atre September 11, 2018 Jean-Christophe Filli^atre A Short Introduction to OCaml INF549 1 / 102 overview lecture Jean-Christophe Filli^atre labs St´ephaneLengrand Monday 17 and Tuesday 18, 9h{12h web site for this course http://www.enseignement.polytechnique.fr/profs/ informatique/Jean-Christophe.Filliatre/INF549/ questions ) [email protected] Jean-Christophe Filli^atre A Short Introduction to OCaml INF549 2 / 102 OCaml OCaml is a general-purpose, strongly typed programming language successor of Caml Light (itself successor of Caml), part of the ML family (SML, F#, etc.) designed and implemented at Inria Rocquencourt by Xavier Leroy and others Some applications: symbolic computation and languages (IBM, Intel, Dassault Syst`emes),static analysis (Microsoft, ENS), file synchronization (Unison), peer-to-peer (MLDonkey), finance (LexiFi, Jane Street Capital), teaching Jean-Christophe Filli^atre A Short Introduction to OCaml INF549 3 / 102 first steps with OCaml Jean-Christophe Filli^atre A Short Introduction to OCaml INF549 4 / 102 the first program hello.ml print_string "hello world!\n" compiling % ocamlopt -o hello hello.ml executing % ./hello hello world! Jean-Christophe Filli^atre A Short Introduction to OCaml INF549 5 / 102 the first program hello.ml print_string "hello world!\n" compiling % ocamlopt -o hello hello.ml executing % ./hello hello world! Jean-Christophe Filli^atre A Short Introduction to OCaml INF549 5 / 102 the first program hello.ml
    [Show full text]
  • Graceful Language Extensions and Interfaces
    Graceful Language Extensions and Interfaces by Michael Homer A thesis submitted to the Victoria University of Wellington in fulfilment of the requirements for the degree of Doctor of Philosophy Victoria University of Wellington 2014 Abstract Grace is a programming language under development aimed at ed- ucation. Grace is object-oriented, imperative, and block-structured, and intended for use in first- and second-year object-oriented programming courses. We present a number of language features we have designed for Grace and implemented in our self-hosted compiler. We describe the design of a pattern-matching system with object-oriented structure and minimal extension to the language. We give a design for an object-based module system, which we use to build dialects, a means of extending and restricting the language available to the programmer, and of implementing domain-specific languages. We show a visual programming interface that melds visual editing (à la Scratch) with textual editing, and that uses our dialect system, and we give the results of a user experiment we performed to evaluate the usability of our interface. ii ii Acknowledgments The author wishes to acknowledge: • James Noble and David Pearce, his supervisors; • Andrew P. Black and Kim B. Bruce, the other designers of Grace; • Timothy Jones, a coauthor on a paper forming part of this thesis and contributor to Minigrace; • Amy Ruskin, Richard Yannow, and Jameson McCowan, coauthors on other papers; • Daniel Gibbs, Jan Larres, Scott Weston, Bart Jacobs, Charlie Paucard, and Alex Sandilands, other contributors to Minigrace; • Gilad Bracha, Matthias Felleisen, and the other (anonymous) review- ers of papers forming part of this thesis; • the participants in his user study; • David Streader, John Grundy, and Laurence Tratt, examiners of the thesis; • and Alexandra Donnison, Amy Chard, Juanri Barnard, Roma Kla- paukh, and Timothy Jones, for providing feedback on drafts of this thesis.
    [Show full text]
  • Openmp for C Or Fortran
    OpenMP for C or Fortran Summer Seminar ISC5939 .......... John Burkardt Department of Scientific Computing Florida State University http://people.sc.fsu.edu/∼jburkardt/presentations/. openmp 2012 fsu.pdf 31 July/02 August 2012 1 / 144 Shared Memory Programming with OpenMP 1 INTRODUCTION 2 Directives 3 Loops 4 Critical Regions and Reductions 5 Data Conflicts and Data Dependence 6 Environment Variables and Functions 7 Compiling, Linking, Running 8 Parallel Control Structures 9 Data Classification 10 Examples 11 Conclusion 2 / 144 INTRO: OLD LANGUAGES=>OpenMP=>New Hardware OpenMP is a bridge between yesterday's programming languages and tomorrow's multicore chips (4 cores when I first gave this talk, 48 cores now here at FSU!) 3 / 144 INTRO: Hardware Options OpenMP runs a user program on shared memory systems: a single core chip (older PC's, sequential execution) a multicore chip (such as your laptop?) multiple single core chips in a NUMA system multiple multicore chips in a NUMA system (SGI system) multiple multicore chips using other schemes (Intel's Cluster OpenMP) The computer lab DSL400B uses 2 core machines; the DSL152 lab has 8 core machines. OpenMP, which you can think of as running on one tightly-coupled chip, can also be combined with MPI, which runs on multiple, loosely-networked chips... but that's another talk! 4 / 144 INTRO: OpenMP Limitations OpenMP is limited by the shared memory hardware. An OpenMP program can only handle problems that fit on the chip or the coupled chips, over which memory can be shared. If an MPI program running on 5 chips needs more memory, it can easily be run on 100 chips, getting 20 times more memory.
    [Show full text]