Preview

Programming Language and Effects

Good Essays
Open Document
Open Document
351 Words
Grammar
Grammar
Plagiarism
Plagiarism
Writing
Writing
Score
Score
Programming Language and Effects
In computer science , a function or expression is said to have a side effect if, in addition to returning a value, it also modifies some state or has an observable interaction withcalling functions or the outside world. For example, a function might modify a global or static variable , modify one of its arguments, raise an exception, write data to a display or file, read data, orcall other side-effecting functions. In the presence of side effects, a program's behavior depends on history; that is, the order ofevaluation matters. Understanding and debugging a function with side effects requires knowledge about the context and its possible histories. [1] [2]
Side effects are the most common way that a program interacts with the outside world (people, filesystems, other computers on networks). But the degree to which side effects are used depends on the programming paradigm. Imperative programming isknown for its frequent utilization of side effects. In functional programming , side effects are rarely used. Functional languages such as Standard ML , Scheme and Scala do not restrict side effects, but it is customary for programmers to avoid them. [3] The functional language Haskell restricts side effects with a static type system ; it uses the concept of monads to do stateful and IO computations. [4] [5]
Assembly language programmers must be aware of hidden side effects — instructions that modify parts of the processor state which are not mentioned in the instruction's mnemonic. A classic example of a hiddenside effect is an arithmetic instruction which explicitly modifies a register (an overt effect) and implicitly modifies condition codes (ahidden side effect). One defect of an instruction set with many hidden side effects is that, if many instructions have side effects on a single piece of state, like condition codes, then the logic required to update that state sequentially may become aperformance bottleneck. The problem is particularly acute on processors designed

You May Also Find These Documents Helpful

  • Satisfactory Essays

    The second category of fault changes individual instructions in the text segment. These faults are intended to approximate the assembly-level manifestation of real C-level programming…

    • 285 Words
    • 2 Pages
    Satisfactory Essays
  • Satisfactory Essays

    Homework Unit 3

    • 354 Words
    • 2 Pages

    1. Statements are execute in order according to the program code. Complex programs can need the help of a decision structure. Statements have to be true to be executed.…

    • 354 Words
    • 2 Pages
    Satisfactory Essays
  • Satisfactory Essays

    Garbage Collector in C#: Runtime has a Garbage Collector Which cleans the objects that are not in use.…

    • 485 Words
    • 2 Pages
    Satisfactory Essays
  • Good Essays

    Comp 220

    • 1463 Words
    • 6 Pages

    Pointers also have the requirement that the pointer type must be of the same data type as the variable, or the data that it points to or holds the address of. The power of pointers also hints at the potential complexity of their use, which is why this lab is focused almost entirely on several different aspects and uses of pointers. The lab also introduces pointer arrays and pointers to pointers.…

    • 1463 Words
    • 6 Pages
    Good Essays
  • Satisfactory Essays

    Read Ch. 4, “Software Basics: The Ghost in the Machine”, in Tomorrow’s Technology and You.…

    • 2331 Words
    • 10 Pages
    Satisfactory Essays
  • Good Essays

    It210 Syllabus

    • 2333 Words
    • 10 Pages

    Course Description This course provides students with a basic understanding of programming practices. Concepts covered include flowcharting, pseudocode methodologies, and an understanding of programming practices. Students will learn how these concepts, when properly applied, improve program design. Policies Faculty and students/learners will be held responsible for understanding and adhering to all policies contained within the following two documents: • • University policies: You must be logged into the student website to view this document. Instructor policies: This document is posted in the Course Materials forum.…

    • 2333 Words
    • 10 Pages
    Good Essays
  • Satisfactory Essays

    educated them and if they do not, you just presented. Using strong language is a tool to…

    • 251 Words
    • 2 Pages
    Satisfactory Essays
  • Satisfactory Essays

    Intro to Computers

    • 340 Words
    • 2 Pages

    Most computer software falls into one of three categories: compilers and other translator programs, software applications, and system software. Describe and give examples of each. [RQ, no. 2]…

    • 340 Words
    • 2 Pages
    Satisfactory Essays
  • Powerful Essays

    Dynamic Code Analysis

    • 1554 Words
    • 7 Pages

    The dynamic code analysis represents the investigation of a program’s behavior using the information obtained while the program is executing. The main goal of the dynamic code analysis is to establish which sections of the programs contain potential errors that are not usually found by compiler or by means of static analysis.…

    • 1554 Words
    • 7 Pages
    Powerful Essays
  • Satisfactory Essays

    I am writing a brief essay on the history of SQL and database developers that have to offer “Express” versions of their database. SQL that is also known as Structured Query Language, is the standard language used to communicate with a relational database. The model was originally developed by IBM using Dr. E.F. Codd’s paper as a model of data for large shared data bank. In 1979, not long after IBM’s prototype, the first SQL product, Oracle, was released by Relational Software, Incorporated.…

    • 374 Words
    • 2 Pages
    Satisfactory Essays
  • Satisfactory Essays

    Von numen

    • 420 Words
    • 3 Pages

    Ans: The programmer should taken proper care so that the program doesn’t modify itself when programming. for example if a program location holds an instruction and later a value is added to that instruction it will later show error. It is very difficult to track down as well. The modification of an instruction may also cause the program to crush.…

    • 420 Words
    • 3 Pages
    Satisfactory Essays
  • Good Essays

    [23] C. Smith, L. G. Williams, ”Software Performance Antipatterns”, 2nd International Workshop on Software Engineering and Research, 2008.…

    • 5601 Words
    • 23 Pages
    Good Essays
  • Powerful Essays

    Entity Relationship Diagram

    • 3067 Words
    • 13 Pages

    –Operator precedence rules? –Operator associativity rules? –Order of operand evaluation? –Operand evaluation side effects? –Operator overloading? –Type mixing in expressions?…

    • 3067 Words
    • 13 Pages
    Powerful Essays
  • Powerful Essays

    Software for early computers was primarily written in assembly language. Higher Level languages were not invented until the benefits of being able to reuse software on different kinds of CPUs started to become significantly greater than the cost of writing a compiler.…

    • 16769 Words
    • 68 Pages
    Powerful Essays
  • Powerful Essays

    8085

    • 2083 Words
    • 10 Pages

    flag is set. A good understanding about these five flags is essential in writing assembly language…

    • 2083 Words
    • 10 Pages
    Powerful Essays

Related Topics