Language Issues Misunderstimated? Sublimable? Hopefuller? "I know how hard it is for you to put food on your family.” "I know the human being and fish.

Slides:



Advertisements
Similar presentations
CSE 105 Structured Programming Language (C)
Advertisements

CS 11 C track: lecture 7 Last week: structs, typedef, linked lists This week: hash tables more on the C preprocessor extern const.
Programming Paradigms and languages
Programming Paradigms Introduction. 6/15/2005 Copyright 2005, by the authors of these slides, and Ateneo de Manila University. All rights reserved. L1:
Dynamic Typing COS 441 Princeton University Fall 2004.
Programming Types of Testing.
Various languages….  Could affect performance  Could affect reliability  Could affect language choice.
Java.  Java is an object-oriented programming language.  Java is important to us because Android programming uses Java.  However, Java is much more.
Data Analytics and Dynamic Languages Lee E. Edlefsen, Ph.D. VP of Engineering 1.
Programming Languages WHY MORE? Wasn’t ONE ENOUGH? Introduction to CS260.
CIS 101: Computer Programming and Problem Solving Lecture 8 Usman Roshan Department of Computer Science NJIT.
1/18 CS 693/793 Lecture 09 Special Topics in Domain Specific Languages CS 693/793-1C Spring 2004 Mo, We, Fr 10:10 – 11:00 CH 430.
Memory Allocation. Three kinds of memory Fixed memory Stack memory Heap memory.
Reasons to study concepts of PL
1 Java Grande Introduction  Grande Application: a GA is any application, scientific or industrial, that requires a large number of computing resources(CPUs,
CS 61C L03 C Arrays (1) A Carle, Summer 2005 © UCB inst.eecs.berkeley.edu/~cs61c/su05 CS61C : Machine Structures Lecture #3: C Pointers & Arrays
Portability CPSC 315 – Programming Studio Spring 2008 Material from The Practice of Programming, by Pike and Kernighan.
1 CMSC 132: Object-Oriented Programming II Software Development III Department of Computer Science University of Maryland, College Park.
Guide To UNIX Using Linux Third Edition
CS 104 Introduction to Computer Science and Graphics Problems Software and Programming Language (2) Programming Languages 09/26/2008 Yang Song (Prepared.
1 CHAPTER 4 LANGUAGE/SOFTWARE Hardware Hardware is the machine itself and its various individual equipment. It includes all mechanical, electronic.
1.3 Executing Programs. How is Computer Code Transformed into an Executable? Interpreters Compilers Hybrid systems.
1 CS101 Introduction to Computing Lecture 19 Programming Languages.
Unit Six Assignment 1 Chris Boardley.
CS 331, Principles of Programming Languages Introduction.
CS102 Introduction to Computer Programming
Platforms for Learning in Computer Science July 28, 2005.
CSC 110 A 1 CSC 110 Introduction to Python [Reading: chapter 1]
Language Evaluation Criteria
Introduction to FORTRAN
C++ Programming. Table of Contents History What is C++? Development of C++ Standardized C++ What are the features of C++? What is Object Orientation?
Introduction to MATLAB adapted from Dr. Rolf Lakaemper.
Programming C# in comparison to C++, Java and Smalltalk by Anne Holzapfel.
COMPUTER PROGRAMMING Source: Computing Concepts (the I-series) by Haag, Cummings, and Rhea, McGraw-Hill/Irwin, 2002.
CS101 Introduction to Computing Lecture Programming Languages.
Dynamic Memory Allocation Conventional array and other data declarations An incorrect attempt to size memory dynamically Requirement for dynamic allocation.
Introduction and Features of Java. What is java? Developed by Sun Microsystems (James Gosling) A general-purpose object-oriented language Based on C/C++
1 COMP 3438 – Part II-Lecture 1: Overview of Compiler Design Dr. Zili Shao Department of Computing The Hong Kong Polytechnic Univ.
Just as there are many human languages, there are many computer programming languages that can be used to develop software. Some are named after people,
Basics of Java IMPORTANT: Read Chap 1-6 of How to think like a… Lecture 3.
Copyright © 2007 Addison-Wesley. All rights reserved.1-1 Reasons for Studying Concepts of Programming Languages Increased ability to express ideas Improved.
Component Technology. Challenges Facing the Software Industry Today’s applications are large & complex – time consuming to develop, difficult and costly.
Editing & Compiling: UNIX vs. IDE and an Intro to Architecture.
1 Lecture 2 : Computer System and Programming. Computer? a programmable machine that  Receives input  Stores and manipulates data  Provides output.
C# Language Panithan Chandrapatya Agenda C# History C# Goals C# Fixes C# Contribution C# Features C# Success C# Example.
240-Current Research Easily Extensible Systems, Octave, Input Formats, SOA.
Chapter 5 Information Systems in Business Software
Computer Programming 2 Why do we study Java….. Java is Simple It has none of the following: operator overloading, header files, pre- processor, pointer.
We will talking about story of JAVA language. By Kristsada Songpartom.
Chapter 3 - Language Design Principles
CS 331, Principles of Programming Languages Chapter 1.
FORTRAN History. FORTRAN - Interesting Facts n FORTRAN is the oldest Language actively in use today. n FORTRAN is still used for new software development.
CIS 601 Fall 2003 Introduction to MATLAB Longin Jan Latecki Based on the lectures of Rolf Lakaemper and David Young.
Abdul Rahim Ahmad MITM 613 Intelligent System Chapter 10: Tools.
The Functions and Purposes of Translators Translators, Interpreters and Compilers - High Level Languages.
CIS 595 MATLAB First Impressions. MATLAB This introduction will give Some basic ideas Main advantages and drawbacks compared to other languages.
The Functions and Purposes of Translators Translators, Interpreters and Compilers - High Level Languages.
Programming for Interactivity Professor Bill Tomlinson Tuesday & Wednesday 6:00-7:50pm Fall 2005.
Chapter 1: Preliminaries Lecture # 2. Chapter 1: Preliminaries Reasons for Studying Concepts of Programming Languages Programming Domains Language Evaluation.
Introduction to Computer Programming Concepts M. Uyguroğlu R. Uyguroğlu.
1 Programming and problem solving in C, Maxima, and Excel.
Software Development Languages and Environments. Computer Languages Just as there are many human languages, there are many computer programming languages.
Done By: Ashlee Lizarraga Ricky Usher Jacinto Roches Eli Gomez
Types for Programs and Proofs
CSCI-235 Micro-Computer Applications
CS101 Introduction to Computing Lecture 19 Programming Languages
Introduction to MATLAB
CSC 253 Lecture 2.
Simulation And Modeling
Outline Announcements Differences between FORTRAN and C
Presentation transcript:

Language Issues Misunderstimated? Sublimable? Hopefuller? "I know how hard it is for you to put food on your family.” "I know the human being and fish can coexist peacefully."

Outline Announcements: Selecting a Language FORTRAN C MATLAB Java

When we last saw our heros… By now, you’ve –designed your program –specified important sections You are now ready to code –but what language will you choose?

Language Criteria You may not have a choice –If you are extending a program written in C, use C! You may only know one language –This is not a reason, it’s an excuse! –But, there’s a lot to be gained by sticking with what you know

Language Criteria Several things to keep in mind when picking a language –Libraries and legacy code: Can you easily utilize code that is already written, tested & debugged (& hopefully specified)? –Portability: is the language standardized so that it easy to compile and run on several platforms? –Elegance: will your program be easier to understand (and debug and extend) in one language –Future: will compilers still be available in 10 years? Will future users be comfortable in this language?

Languages for Scientific Computing Programming languages can be categorized –Procedural: Programs consist of one or more procedures (aka functions or subroutines). Data objects are passed to the procedures (FORTRAN, C, Matlab) –Object-Oriented: Programs are composed of several objects that encapsulate related data and the procedures to manipulate them (C++, Java) –Functional: Programs are functions that operate on data or other functions--highly recursive (LISP, ML)

Languages for Scientific Computing Language phylogeny FORTRAN C C++ Java Matlab

FORTRAN FORmula TRANslator –One of the first programming languages –Most common strain was standardized in 1977 –Designed for “Scientific Computing” (e.g. physics)

Types: –integer, float, double, complex, char Data structures: –arrays FORTRAN

complex type fully implemented, integrated lots of legacy code simple fast! FORTRAN: Key Advantages

F77 is ancient –Missing “modern” features like pointers, novel data structures (or even records) –Missing not-so-modern features like recursion! –Encourages bad programming: heavy use of goto-statement common blocks FORTRAN: Disadvantages

Modernizes F77 while maintaining backward compatability –Dynamic allocation of arrays (size set at run-time, not at compilation) –“Vectorized” operations: c= a(:)+b(:) I’m not a fan (just added stuff to F77), but some folks really like it –An attractive option for extending legacy code FORTRAN90

In many ways, C is similar to FORTRAN –Procedural –few built-in types and data structures But more modern –pointers--allows you to manipulate memory directly –structs--allows you to implement records –Together, pointers and structs allow you to create new data structures –supports recursion C

C: Key advantages Common--good compilers available for all platforms, often for free Legacy code--lots of stuff already written Good performance--comparable for FORTRAN, especially for simple, array-based code Very modular--library-concept tightly integrated through #include directive Modern--can do everything you could ever want to do (math, CS, graphics)

C: Key disadvantages Programming with pointers can be complicated and even dangerous No complex type or functions

Matlab Matlab is a “programming environment” for scientific computing –Lots of built-in functions –Easy to program, especially if you are comfortable with procedural programming –Data analysis/visualization tools make it easy to develop/debug code –Excellent system for building prototypes, but not suitable for production runs of large, computationally intensive code

Java Java is the current standard for object- oriented programming –objects are “classes” fields: data methods: functions –classes should encompass data-types with functions that operate on them

Java: Key Advantages Object-oriented--encapsulation of data and functions simplifies programs, makes management easier Popular--lots of available code, especially for graphics and common CS algorithms and data structures Standardized--very complete specification of language means that all Java code will run on all Java compilers –Several versions though, make sure your compilers is current –Be wary of Microsoft who is trying to create a proprietary version! Strongly-typed--many bugs are caught at compile time Run-time checks on array bounds avoids “segmentation faults” (returns an intelligent error message)

Java: Key Disadvantages Performance: object-oriented languages are complicated, so it is hard for compilers to make smart optimizations (applies to C++, too) –Also, standard java is interpreted, not compiled so optimization is out of the question! Main Audience: scientists are no longer the main driving force behind computers. –Java’s main audience are commercial developers (especially web) –Even so, there is still a lot of scientific code out there

For extending old code, stick with the original language For new code, I highly recommend Java –code is cleaner, and requires less debugging (reduces development time) –Especially true if your work doesn’t require heavy computation For any project, consider developing a prototype first (Matlab or Java) and then translate to C or FORTRAN for max performance My Advice