SlideShare a Scribd company logo
1 of 26
Download to read offline
APL – A Programming Language

        By Bryan Wilson
//TODO - Header
•   Short History
•   Brief APL Rundown
•   APL Details and Tools
•   Syntax
    – Data, Structures, Classes
    – Functions, Operands
    – System Variables, Functions
• Expanding APL
30 Second History
• This language is crazy
• History sheds light on why
Enter Kenneth E. Iverson




 Profession: Mathematics
    “5 is greater than 1. Look”
His Notation




Relic found in ancient Mayan ruins.
A Pointless Language
•   Entirely dynamic, highly abstract
•   Largely interpreted (line by line execution)
•   “Keywords” are symbols
•   Tacit programming
•   Short programs, probably about 1 line
•   Write-only language
How the magic happens
• Right to left evaluation, except for parens
       5 + 5
  10
       5 x 5
  25
       5 × 5 + 5
  50
       (5 × 5) + 5
  30
Time to get crazy
• Types of data are largely done for you
           1 2 3 + 5
     6 7 8
           ¼9
     1 2 3 4 5 6 7 8 9
           2 4 ½¼9
     1 2 3 4 5 6 7
     8 9 1 2 3 4 5
Stop. Demotime.
Boring APL stuff
• Specifications
  – ISO (International Standards Organization
  – APL2, by IBM
• Interpreted
  – Thus, Interpreters
     •   APL+
     •   APLX
     •   Dyalog APL
     •   VisualAPL
Interpreters
• Use workspaces, and have unique specs
  – Workspace
  – System Variables
  – System Functions
• Modes
  – Calculator mode
  – Definition mode
Simple Data
• A number
  – 24595
  – Can be decimal or negative
• A character
  – ‘s’
  – Wrapped in single quotes
  – ‘Use two ‘’ to escape the ‘’ ‘
Data Structures
• May have data, has dimensions
• Data does not have dimensions

•   Struct – 1 item, no dimensions
•   Vector- 1d list of items
•   Matrix -2D..nD list of items
•   Item can be character, number or structure
•   Data structures can have mixed data, or nested
Data and structure syntax
• To store a variable
  [name] „ [variable]
• Names can start with a letter and NOTHING
  else
• Names can have numbers and some symbols
• Don’t duplicate names
Functions
• Types
    – 0 arguments (niladic)
    – 1 argument (monadic)
       • Everything to the right
    – 2 arguments (dyadic)
       • Everything to the right
       • First item to the left
•   Can return data/data structure
•   Bucket brigade
•   Can be named like data
•   One symbol, 1-2 functions, depending on arguments
Operations
• Modify the function of…functions.
  – How functions are applied to data
• In addition to 0-2 arguments, can take 1-2
  operands
• Functions can be operands
• Can also be named like functions
Classes
• Logical grouping of data and functions
„ŒNEW CLASSNAME
[classname].[function/property]
• Can have constructors.
• Some interpreters let you use external classes
  – .NET
Alienspeak
• Arithmetic
  +, -, ×, ÷, ⌈, ⌊, |
• Algebraic
  ⍳ , ? , * , ⍟, ○, ! , ⌹
• Comparative
  <, ≤, =, ≥, >, ≠, ≡, ∊, ⍳, ⍷
• Logical
  ~, ∨, ^, ⍱, ⍲
• Manipulative
  ⍴, ≡, , , ∊, ~, ⌽, ⍉, ↑, ↓, ⊂, ⊃
Continued Mathyspeak
• Sorting
  ⍋, ⍒, ⊤, ⊥
• Miscellaneous
  ⎕, ⍞, ⋄, ⍕, ⍝, ⍎, ⌷, ⌻,¯
• Operators
  /, , ., ∘. , ¨, [ ]
Defining your own functions
• It can be done! Watch!
System Variables and Functions
• Variables
  – Easy to pick out, they start with Œ
  – Change depending on interpreter
• Functions
  – Start with a )
  – Also change depending on interpreter
Can’t cover everything!
• Can you have threads?
  – Yes. Some interpreters.
• Can you have labels?
  – In function and operation definitions.
  – This includes if/else and try/catch blocks
• Where can I learn more?
  – Classes quoted at ~$2000 per day per person
The future is J
• APL transformed to be easier to read

quicksort=: (($:@(<#[), (=#[), $:@(>#[)) ({~ ?@#))
^: (1<#)
Summary
• Simply put:
  – Dynamic
  – Abstract
  – Powerful
  – Awesome
Questions for YOU
1. ⍳9 Returns what?
  1 2 3 4 5 6 7 8 9


2. What does an operator in APL do?
  Changes how a function is applied to data


3. To create a 3 dimensional array:
  (1 2 3) ⍴ (5 4)
Questions for me?


There are three things a man must do
        before his life is done
       write two lines in APL,
   and make the damn thing run

More Related Content

What's hot

Fundamentals of Database ppt ch04
Fundamentals of Database ppt ch04Fundamentals of Database ppt ch04
Fundamentals of Database ppt ch04Jotham Gadot
 
Software System Engineering - Chapter 1
Software System Engineering - Chapter 1Software System Engineering - Chapter 1
Software System Engineering - Chapter 1Fadhil Ismail
 
Unit I Database concepts - RDBMS & ORACLE
Unit I  Database concepts - RDBMS & ORACLEUnit I  Database concepts - RDBMS & ORACLE
Unit I Database concepts - RDBMS & ORACLEDrkhanchanaR
 
system analysis and design chapter 1 Kendall & Kendall
system analysis and design chapter 1 Kendall & Kendallsystem analysis and design chapter 1 Kendall & Kendall
system analysis and design chapter 1 Kendall & KendallDana dia
 
System Analysis & Design - I
System Analysis & Design - ISystem Analysis & Design - I
System Analysis & Design - IGagan Deep
 
Operating Systems Process Scheduling Algorithms
Operating Systems   Process Scheduling AlgorithmsOperating Systems   Process Scheduling Algorithms
Operating Systems Process Scheduling Algorithmssathish sak
 
Privileges Escalation by Exploiting Client-Side Vulnerabilities Using Metasploit
Privileges Escalation by Exploiting Client-Side Vulnerabilities Using MetasploitPrivileges Escalation by Exploiting Client-Side Vulnerabilities Using Metasploit
Privileges Escalation by Exploiting Client-Side Vulnerabilities Using MetasploitVishal Kumar
 
Structured system analysis
Structured system analysisStructured system analysis
Structured system analysislearnt
 
Relationships within the relational database
Relationships within the relational databaseRelationships within the relational database
Relationships within the relational databaseJanecatalla
 
Database User and Administrator
Database User and AdministratorDatabase User and Administrator
Database User and AdministratorA. S. M. Shafi
 
System analysis ITM3(1).pptx
System analysis ITM3(1).pptx System analysis ITM3(1).pptx
System analysis ITM3(1).pptx Aram Mohammed
 
Software project management
Software project managementSoftware project management
Software project managementR A Akerkar
 
Designing Techniques in Software Engineering
Designing Techniques in Software EngineeringDesigning Techniques in Software Engineering
Designing Techniques in Software Engineeringkirupasuchi1996
 
Limitations of memory system performance
Limitations of memory system performanceLimitations of memory system performance
Limitations of memory system performanceSyed Zaid Irshad
 
Os Swapping, Paging, Segmentation and Virtual Memory
Os Swapping, Paging, Segmentation and Virtual MemoryOs Swapping, Paging, Segmentation and Virtual Memory
Os Swapping, Paging, Segmentation and Virtual Memorysgpraju
 

What's hot (20)

Fundamentals of Database ppt ch04
Fundamentals of Database ppt ch04Fundamentals of Database ppt ch04
Fundamentals of Database ppt ch04
 
Software System Engineering - Chapter 1
Software System Engineering - Chapter 1Software System Engineering - Chapter 1
Software System Engineering - Chapter 1
 
System proposal
System proposalSystem proposal
System proposal
 
Unit I Database concepts - RDBMS & ORACLE
Unit I  Database concepts - RDBMS & ORACLEUnit I  Database concepts - RDBMS & ORACLE
Unit I Database concepts - RDBMS & ORACLE
 
system analysis and design chapter 1 Kendall & Kendall
system analysis and design chapter 1 Kendall & Kendallsystem analysis and design chapter 1 Kendall & Kendall
system analysis and design chapter 1 Kendall & Kendall
 
System analysis
System analysisSystem analysis
System analysis
 
System Analysis & Design - I
System Analysis & Design - ISystem Analysis & Design - I
System Analysis & Design - I
 
Operating Systems Process Scheduling Algorithms
Operating Systems   Process Scheduling AlgorithmsOperating Systems   Process Scheduling Algorithms
Operating Systems Process Scheduling Algorithms
 
Dbms
DbmsDbms
Dbms
 
Privileges Escalation by Exploiting Client-Side Vulnerabilities Using Metasploit
Privileges Escalation by Exploiting Client-Side Vulnerabilities Using MetasploitPrivileges Escalation by Exploiting Client-Side Vulnerabilities Using Metasploit
Privileges Escalation by Exploiting Client-Side Vulnerabilities Using Metasploit
 
Structured system analysis
Structured system analysisStructured system analysis
Structured system analysis
 
Relationships within the relational database
Relationships within the relational databaseRelationships within the relational database
Relationships within the relational database
 
Database User and Administrator
Database User and AdministratorDatabase User and Administrator
Database User and Administrator
 
Normal forms
Normal formsNormal forms
Normal forms
 
System analysis ITM3(1).pptx
System analysis ITM3(1).pptx System analysis ITM3(1).pptx
System analysis ITM3(1).pptx
 
ThinClient
ThinClientThinClient
ThinClient
 
Software project management
Software project managementSoftware project management
Software project management
 
Designing Techniques in Software Engineering
Designing Techniques in Software EngineeringDesigning Techniques in Software Engineering
Designing Techniques in Software Engineering
 
Limitations of memory system performance
Limitations of memory system performanceLimitations of memory system performance
Limitations of memory system performance
 
Os Swapping, Paging, Segmentation and Virtual Memory
Os Swapping, Paging, Segmentation and Virtual MemoryOs Swapping, Paging, Segmentation and Virtual Memory
Os Swapping, Paging, Segmentation and Virtual Memory
 

Viewers also liked

Possible Blacksmith - Gatehouse museum
Possible Blacksmith - Gatehouse museumPossible Blacksmith - Gatehouse museum
Possible Blacksmith - Gatehouse museumjarrodprice
 
Blacksmith Award Winners
Blacksmith Award WinnersBlacksmith Award Winners
Blacksmith Award WinnersJeremy Fischer
 
Nephin Blacksmiths, Blacksmithing through the years in Lahardane Ballina Co M...
Nephin Blacksmiths, Blacksmithing through the years in Lahardane Ballina Co M...Nephin Blacksmiths, Blacksmithing through the years in Lahardane Ballina Co M...
Nephin Blacksmiths, Blacksmithing through the years in Lahardane Ballina Co M...Lahardane
 
Blacksmithing 101: Basic Tools
Blacksmithing 101: Basic ToolsBlacksmithing 101: Basic Tools
Blacksmithing 101: Basic ToolsCarl Nelson France
 
SPH Analytics Indicators QMD Press Release
SPH Analytics Indicators QMD Press ReleaseSPH Analytics Indicators QMD Press Release
SPH Analytics Indicators QMD Press ReleaseRibitzky
 
The Village Blacksmith- a presentation
The Village Blacksmith- a presentationThe Village Blacksmith- a presentation
The Village Blacksmith- a presentationstephythomas4
 
Fear and loathing with APL (oredev)
Fear and loathing with APL (oredev)Fear and loathing with APL (oredev)
Fear and loathing with APL (oredev)Yan Cui
 
Innovative Lesson Plan on Present Continuous Tense
Innovative Lesson Plan on Present Continuous Tense Innovative Lesson Plan on Present Continuous Tense
Innovative Lesson Plan on Present Continuous Tense stephythomas4
 
apl_slides
apl_slidesapl_slides
apl_slidesRibitzky
 

Viewers also liked (11)

Possible Blacksmith - Gatehouse museum
Possible Blacksmith - Gatehouse museumPossible Blacksmith - Gatehouse museum
Possible Blacksmith - Gatehouse museum
 
Blacksmith Award Winners
Blacksmith Award WinnersBlacksmith Award Winners
Blacksmith Award Winners
 
Blacksmithing
BlacksmithingBlacksmithing
Blacksmithing
 
Nephin Blacksmiths, Blacksmithing through the years in Lahardane Ballina Co M...
Nephin Blacksmiths, Blacksmithing through the years in Lahardane Ballina Co M...Nephin Blacksmiths, Blacksmithing through the years in Lahardane Ballina Co M...
Nephin Blacksmiths, Blacksmithing through the years in Lahardane Ballina Co M...
 
Blacksmithing 101: Basic Tools
Blacksmithing 101: Basic ToolsBlacksmithing 101: Basic Tools
Blacksmithing 101: Basic Tools
 
SPH Analytics Indicators QMD Press Release
SPH Analytics Indicators QMD Press ReleaseSPH Analytics Indicators QMD Press Release
SPH Analytics Indicators QMD Press Release
 
Toxic boss
Toxic bossToxic boss
Toxic boss
 
The Village Blacksmith- a presentation
The Village Blacksmith- a presentationThe Village Blacksmith- a presentation
The Village Blacksmith- a presentation
 
Fear and loathing with APL (oredev)
Fear and loathing with APL (oredev)Fear and loathing with APL (oredev)
Fear and loathing with APL (oredev)
 
Innovative Lesson Plan on Present Continuous Tense
Innovative Lesson Plan on Present Continuous Tense Innovative Lesson Plan on Present Continuous Tense
Innovative Lesson Plan on Present Continuous Tense
 
apl_slides
apl_slidesapl_slides
apl_slides
 

Similar to Apl – a programming language

Lisp, An Introduction.ppt
Lisp, An Introduction.pptLisp, An Introduction.ppt
Lisp, An Introduction.pptLuis Soza
 
The joy of functional programming
The joy of functional programmingThe joy of functional programming
The joy of functional programmingSteve Zhang
 
Adbms 19 object technology in rdbms
Adbms 19 object technology in rdbmsAdbms 19 object technology in rdbms
Adbms 19 object technology in rdbmsVaibhav Khanna
 
Intro to data science module 1 r
Intro to data science module 1 rIntro to data science module 1 r
Intro to data science module 1 ramuletc
 
Functional Python Webinar from October 22nd, 2014
Functional Python Webinar from October 22nd, 2014Functional Python Webinar from October 22nd, 2014
Functional Python Webinar from October 22nd, 2014Reuven Lerner
 
Basic terminologies & asymptotic notations
Basic terminologies & asymptotic notationsBasic terminologies & asymptotic notations
Basic terminologies & asymptotic notationsRajendran
 
Excel basics for everyday use part two
Excel basics for everyday use part twoExcel basics for everyday use part two
Excel basics for everyday use part twoKevin McLogan
 
Functional Programming - Past, Present and Future
Functional Programming - Past, Present and FutureFunctional Programming - Past, Present and Future
Functional Programming - Past, Present and FuturePushkar Kulkarni
 
Functional Programming Past Present Future
Functional Programming Past Present FutureFunctional Programming Past Present Future
Functional Programming Past Present FutureIndicThreads
 
[YIDLUG] Programming Languages Differences, The Underlying Implementation 1 of 2
[YIDLUG] Programming Languages Differences, The Underlying Implementation 1 of 2[YIDLUG] Programming Languages Differences, The Underlying Implementation 1 of 2
[YIDLUG] Programming Languages Differences, The Underlying Implementation 1 of 2Yo Halb
 
Clojure - An Introduction for Lisp Programmers
Clojure - An Introduction for Lisp ProgrammersClojure - An Introduction for Lisp Programmers
Clojure - An Introduction for Lisp Programmerselliando dias
 
Python Programming and GIS
Python Programming and GISPython Programming and GIS
Python Programming and GISJohn Reiser
 

Similar to Apl – a programming language (20)

محاضرة برنامج التحليل الكمي R program د.هديل القفيدي
محاضرة برنامج التحليل الكمي   R program د.هديل القفيديمحاضرة برنامج التحليل الكمي   R program د.هديل القفيدي
محاضرة برنامج التحليل الكمي R program د.هديل القفيدي
 
intro.ppt
intro.pptintro.ppt
intro.ppt
 
Lisp, An Introduction.ppt
Lisp, An Introduction.pptLisp, An Introduction.ppt
Lisp, An Introduction.ppt
 
intro.ppt
intro.pptintro.ppt
intro.ppt
 
Funtional Programming
Funtional ProgrammingFuntional Programming
Funtional Programming
 
محاضرة برنامج التحليل الكمي R program د.هديل القفيدي
محاضرة برنامج التحليل الكمي   R program د.هديل القفيديمحاضرة برنامج التحليل الكمي   R program د.هديل القفيدي
محاضرة برنامج التحليل الكمي R program د.هديل القفيدي
 
The joy of functional programming
The joy of functional programmingThe joy of functional programming
The joy of functional programming
 
Adbms 19 object technology in rdbms
Adbms 19 object technology in rdbmsAdbms 19 object technology in rdbms
Adbms 19 object technology in rdbms
 
Lisp and scheme i
Lisp and scheme iLisp and scheme i
Lisp and scheme i
 
Intro to data science module 1 r
Intro to data science module 1 rIntro to data science module 1 r
Intro to data science module 1 r
 
Python Tutorial Part 1
Python Tutorial Part 1Python Tutorial Part 1
Python Tutorial Part 1
 
Functional Python Webinar from October 22nd, 2014
Functional Python Webinar from October 22nd, 2014Functional Python Webinar from October 22nd, 2014
Functional Python Webinar from October 22nd, 2014
 
Basic terminologies & asymptotic notations
Basic terminologies & asymptotic notationsBasic terminologies & asymptotic notations
Basic terminologies & asymptotic notations
 
Excel basics for everyday use part two
Excel basics for everyday use part twoExcel basics for everyday use part two
Excel basics for everyday use part two
 
DBMS UNIT 3
DBMS UNIT 3DBMS UNIT 3
DBMS UNIT 3
 
Functional Programming - Past, Present and Future
Functional Programming - Past, Present and FutureFunctional Programming - Past, Present and Future
Functional Programming - Past, Present and Future
 
Functional Programming Past Present Future
Functional Programming Past Present FutureFunctional Programming Past Present Future
Functional Programming Past Present Future
 
[YIDLUG] Programming Languages Differences, The Underlying Implementation 1 of 2
[YIDLUG] Programming Languages Differences, The Underlying Implementation 1 of 2[YIDLUG] Programming Languages Differences, The Underlying Implementation 1 of 2
[YIDLUG] Programming Languages Differences, The Underlying Implementation 1 of 2
 
Clojure - An Introduction for Lisp Programmers
Clojure - An Introduction for Lisp ProgrammersClojure - An Introduction for Lisp Programmers
Clojure - An Introduction for Lisp Programmers
 
Python Programming and GIS
Python Programming and GISPython Programming and GIS
Python Programming and GIS
 

Apl – a programming language

  • 1. APL – A Programming Language By Bryan Wilson
  • 2. //TODO - Header • Short History • Brief APL Rundown • APL Details and Tools • Syntax – Data, Structures, Classes – Functions, Operands – System Variables, Functions • Expanding APL
  • 3. 30 Second History • This language is crazy • History sheds light on why
  • 4. Enter Kenneth E. Iverson Profession: Mathematics “5 is greater than 1. Look”
  • 5. His Notation Relic found in ancient Mayan ruins.
  • 6. A Pointless Language • Entirely dynamic, highly abstract • Largely interpreted (line by line execution) • “Keywords” are symbols • Tacit programming • Short programs, probably about 1 line • Write-only language
  • 7. How the magic happens • Right to left evaluation, except for parens 5 + 5 10 5 x 5 25 5 × 5 + 5 50 (5 × 5) + 5 30
  • 8. Time to get crazy • Types of data are largely done for you 1 2 3 + 5 6 7 8 ¼9 1 2 3 4 5 6 7 8 9 2 4 ½¼9 1 2 3 4 5 6 7 8 9 1 2 3 4 5
  • 10. Boring APL stuff • Specifications – ISO (International Standards Organization – APL2, by IBM • Interpreted – Thus, Interpreters • APL+ • APLX • Dyalog APL • VisualAPL
  • 11. Interpreters • Use workspaces, and have unique specs – Workspace – System Variables – System Functions • Modes – Calculator mode – Definition mode
  • 12. Simple Data • A number – 24595 – Can be decimal or negative • A character – ‘s’ – Wrapped in single quotes – ‘Use two ‘’ to escape the ‘’ ‘
  • 13. Data Structures • May have data, has dimensions • Data does not have dimensions • Struct – 1 item, no dimensions • Vector- 1d list of items • Matrix -2D..nD list of items • Item can be character, number or structure • Data structures can have mixed data, or nested
  • 14. Data and structure syntax • To store a variable [name] „ [variable] • Names can start with a letter and NOTHING else • Names can have numbers and some symbols • Don’t duplicate names
  • 15. Functions • Types – 0 arguments (niladic) – 1 argument (monadic) • Everything to the right – 2 arguments (dyadic) • Everything to the right • First item to the left • Can return data/data structure • Bucket brigade • Can be named like data • One symbol, 1-2 functions, depending on arguments
  • 16. Operations • Modify the function of…functions. – How functions are applied to data • In addition to 0-2 arguments, can take 1-2 operands • Functions can be operands • Can also be named like functions
  • 17. Classes • Logical grouping of data and functions „ŒNEW CLASSNAME [classname].[function/property] • Can have constructors. • Some interpreters let you use external classes – .NET
  • 18. Alienspeak • Arithmetic +, -, ×, ÷, ⌈, ⌊, | • Algebraic ⍳ , ? , * , ⍟, ○, ! , ⌹ • Comparative <, ≤, =, ≥, >, ≠, ≡, ∊, ⍳, ⍷ • Logical ~, ∨, ^, ⍱, ⍲ • Manipulative ⍴, ≡, , , ∊, ~, ⌽, ⍉, ↑, ↓, ⊂, ⊃
  • 19. Continued Mathyspeak • Sorting ⍋, ⍒, ⊤, ⊥ • Miscellaneous ⎕, ⍞, ⋄, ⍕, ⍝, ⍎, ⌷, ⌻,¯ • Operators /, , ., ∘. , ¨, [ ]
  • 20. Defining your own functions • It can be done! Watch!
  • 21. System Variables and Functions • Variables – Easy to pick out, they start with Œ – Change depending on interpreter • Functions – Start with a ) – Also change depending on interpreter
  • 22. Can’t cover everything! • Can you have threads? – Yes. Some interpreters. • Can you have labels? – In function and operation definitions. – This includes if/else and try/catch blocks • Where can I learn more? – Classes quoted at ~$2000 per day per person
  • 23. The future is J • APL transformed to be easier to read quicksort=: (($:@(<#[), (=#[), $:@(>#[)) ({~ ?@#)) ^: (1<#)
  • 24. Summary • Simply put: – Dynamic – Abstract – Powerful – Awesome
  • 25. Questions for YOU 1. ⍳9 Returns what? 1 2 3 4 5 6 7 8 9 2. What does an operator in APL do? Changes how a function is applied to data 3. To create a 3 dimensional array: (1 2 3) ⍴ (5 4)
  • 26. Questions for me? There are three things a man must do before his life is done write two lines in APL, and make the damn thing run

Editor's Notes

  1. He didn&apos;t like the standard mathematical notation so he created his ownOriginally named IBM (Iverson’s Better Math), but that didn&apos;t fly with IBMwhich describe interpersonal communication, not a programming languageName was changed to APL, a programming language, named after a chapter in his book
  2. notation used normal mathematical symbols