Marketing Functional Programming Perceptions and Reality R. Kent - - PowerPoint PPT Presentation

marketing functional programming perceptions and reality
SMART_READER_LITE
LIVE PREVIEW

Marketing Functional Programming Perceptions and Reality R. Kent - - PowerPoint PPT Presentation

Marketing Functional Programming Perceptions and Reality R. Kent Dybvig Cadence Research Systems September 2004 . p.1/28 Talk Outline Chez Scheme: where Im coming from background priorities business model Perceptions


slide-1
SLIDE 1

Marketing Functional Programming Perceptions and Reality

  • R. Kent Dybvig

Cadence Research Systems September 2004

. – p.1/28

slide-2
SLIDE 2

Talk Outline

Chez Scheme: where I’m coming from

  • background
  • priorities
  • business model

Perceptions Other issues

. – p.2/28

slide-3
SLIDE 3

Background

Implements ANSI/R

  • RS standard Scheme with extensions

Runs on multiple architectures and operating systems Compiles source incrementally to machine code Version 1 completed in December 1984 (almost 20 years ago!) Version 7 should be completed soon

. – p.3/28

slide-4
SLIDE 4

Priorities

Highest priorities:

  • reliability
  • reliable compiler and run-time system
  • no arbitrary limitations
  • failure recovery

. – p.4/28

slide-5
SLIDE 5

Priorities

Highest priorities:

  • reliability
  • reliable compiler and run-time system
  • no arbitrary limitations
  • failure recovery
  • performance
  • compilation speed
  • speed of generated code
  • storage management
  • performance continuity

. – p.4/28

slide-6
SLIDE 6

Priorities

Also important:

  • standards compliance
  • interoperability with other programs
  • features
  • debugging tools
  • documentation

. – p.5/28

slide-7
SLIDE 7

Business Model

Chez Scheme marketed to corporations, institutions Petite Chez Scheme freely available

  • serves as run-time system for distributed applications
  • serves as free implementation for personal use

work constantly to improve reliability

  • an ounce of prevention . . .

work constantly to improve performance work under contract to provide major new functionality

  • C, COM interfaces
  • ports to new architectures and operating systems
  • thread system
  • etc.

. – p.6/28

slide-8
SLIDE 8

Why not open source?

Open-source route is always worth considering Potential open-source benefits:

  • larger user base
  • contributions from qualified developers
  • cost sharing

Potential open-source downsides:

  • ineffective below critical mass of users/contributors
  • difficult to fund developers

. – p.7/28

slide-9
SLIDE 9

Commercial Model

Sticking with commercial model:

  • keeps us honest: more incentive to:
  • fill in functionality
  • maintain reliability and performance
  • eliminate rough edges
  • allows us to provide better support services
  • keeps us in contact with power users
  • client needs drive development
  • keeps it real

. – p.8/28

slide-10
SLIDE 10

Talk Outline

Chez Scheme: where I’m coming from Perceptions

  • expressiveness of FP languages
  • performance of FP languages
  • impact of Java
  • etc.

Other issues

. – p.9/28

slide-11
SLIDE 11

Expressiveness

Perception: FP languages are restrictive

. – p.10/28

slide-12
SLIDE 12

Expressiveness

Perception: FP languages are restrictive Reality: this perception is just plain wrong most FP languages support both imperative and functional programming most imperative languages support only imperative programming

  • no dynamic memory allocation without side effects
  • no bounded looping without side effects
  • no tail calls without danger of stack overflow

(sadly, most FP languages also fail to guarantee proper tail recursion)

. – p.10/28

slide-13
SLIDE 13

FP versus OOP

Perception:

  • kay, but surely OOP is better

. – p.11/28

slide-14
SLIDE 14

FP versus OOP

Perception:

  • kay, but surely OOP is better

Reality: OOP is nice for encapsulating state pervasive OOP leads to ultra-imperative programming (do this to that object, do that to this object, etc.) most FP languages or implementations support OOP FP languages thus support mix of paradigms

. – p.11/28

slide-15
SLIDE 15

Generality

Perception: but FP language X is good only for special purpose P

. – p.12/28

slide-16
SLIDE 16

Generality

Perception: but FP language X is good only for special purpose P Reality: most FP languages are general purpose languages early associations stick, like Scheme and AI same is true, however, for mainstream languages

  • Fortran good only for number crunching
  • C good only for systems programming
  • Java good only for web applets
  • Perl good only scripting

. – p.12/28

slide-17
SLIDE 17

Performance

Perception: but aren’t FP languages slow?

. – p.13/28

slide-18
SLIDE 18

Performance

Perception: but aren’t FP languages slow? Reality: FP languages aren’t inherently slow

  • early implementations were slow
  • present implementations run the gamut

higher level of abstraction makes optimization

  • more difficult
  • potentially more fruitful (less overspecification)

potential for big wins greater on larger programs

. – p.13/28

slide-19
SLIDE 19

Performance

Perception: but interpreted languages must be slow

. – p.14/28

slide-20
SLIDE 20

Performance

Perception: but interpreted languages must be slow Reality: languages aren’t interpreted

  • some implementations use interpreters
  • some use compilers
  • some use hybrids

this misperception might survive because

  • early implementations were interpreted
  • interactivity confused with interpretation

. – p.14/28

slide-21
SLIDE 21

Garbage Collection

Perception: but all garbage collected languages are slow

. – p.15/28

slide-22
SLIDE 22

Garbage Collection

Perception: but all garbage collected languages are slow Reality: garbage collection often outperforms explicit storage management

  • partnership with compiler, run-time system
  • support for inline allocation

some implementations not as good as others performance concerns outweighed by benefits:

  • no dangling pointers
  • fewer memory leaks
  • increased reliability, productivity

analogies: O/S scheduling, assembly versus high-level language

. – p.15/28

slide-23
SLIDE 23

Conservative Collection

Perception: so GC is good, but even C can be GC’d

. – p.16/28

slide-24
SLIDE 24

Conservative Collection

Perception: so GC is good, but even C can be GC’d Reality: this is true, after a fashion, with conservative collectors conservative collectors still susceptible to

  • memory leaks
  • dangling pointers

conservative collectors don’t enjoy same performance benefits analogies: “lite” cigarettes, low-carb big-macs

. – p.16/28

slide-25
SLIDE 25

Hardware Support

Perception: FP languages don’t mesh well with stock hardware

. – p.17/28

slide-26
SLIDE 26

Hardware Support

Perception: FP languages don’t mesh well with stock hardware Reality: FP languages could use better support for:

  • generic and arbitrary-precision arithmetic
  • bounds checking
  • tag checking (latently typed languages)

stock HW designed to support unsafe imperative languages we adapt with clever implementation techniques bigger concern may be virtual machines like JVM and .NET

. – p.17/28

slide-27
SLIDE 27

Libraries

Perception: FP languages lack libraries

. – p.18/28

slide-28
SLIDE 28

Libraries

Perception: FP languages lack libraries Reality: this has been a real problem, perhaps the major problem strides being made in Scheme community, elsewhere

. – p.18/28

slide-29
SLIDE 29

Interoperability

Perception: FP languages don’t play well with others

. – p.19/28

slide-30
SLIDE 30

Interoperability

Perception: FP languages don’t play well with others Reality: paradigm and datatype mismatches do exist many FP implementations support C interfaces some interface with Java

  • nus always on the FP implementation

(how many C implementations support FP interfaces?) ever tried to mix Haskell and Scheme?

. – p.19/28

slide-31
SLIDE 31

Java

Perception: Java will choke off demand for FP languages

. – p.20/28

slide-32
SLIDE 32

Java

Perception: Java will choke off demand for FP languages Reality: initially, this was probably true Java has, however, helped validate garbage collection (after a rocky start) may also shake up management conservatism

. – p.20/28

slide-33
SLIDE 33

Purity

Perception: FP is more about purity than usability

. – p.21/28

slide-34
SLIDE 34

Purity

Perception: FP is more about purity than usability Reality: FP language designers and implementors are purists great pressure to “get things right”

  • language design
  • implementation reliability
  • detecting errors

takes time and energy away from eye candy “right” doesn’t sell as well as eye candy

. – p.21/28

slide-35
SLIDE 35

Talk Outline

Chez Scheme: where I’m coming from Perceptions Other issues

  • backing
  • stability
  • etc.

. – p.22/28

slide-36
SLIDE 36

Institutional Backing

Big push from an 800-lb Gorilla would help

  • examples: C/AT&T, Java/Sun
  • not necessary: Perl does okay
  • not sufficient: Ada

. – p.23/28

slide-37
SLIDE 37

Software Patents

Software patents present a signficant problem

  • software patents handed out for “obvious” solutions
  • large companies churn out patents like mad . . .
  • . . . then lay in wait for profitable opportunities
  • small developers cannot afford patent process

(application or defense)

. – p.24/28

slide-38
SLIDE 38

Size and Stability

Big companies want to deal with other big companies

  • especially true for single-source technology
  • big companies shy away from FP languages
  • pressure suppliers to do the same

. – p.25/28

slide-39
SLIDE 39

Capitalization

Most FP implementations are undercapitalized

  • this is where 800-lb gorilla could help
  • typical investment problem
  • need for money to fund development and marketing
  • need development and marketing to increase demand
  • need demand to justify money
  • huge time and cost to develop competitive implementation
  • payoff, if any, may take many years

. – p.26/28

slide-40
SLIDE 40

Inertia

People just don’t want to try new things

  • some people still program in assembly language
  • some still insist that Fortran IV is all they need
  • reluctance part religion, part fear
  • educational institutions partly to blame
  • many who take the leap get pulled back

. – p.27/28

slide-41
SLIDE 41

Summary

Inaccurate perceptions:

  • FP is restrictive, special-purpose, and inefficient
  • vercome with education, better marketing

Accurate perceptions:

  • FP needs more libraries, better interoperability
  • vercome with time and hard work

Underlying problems:

  • lack of funding, inertia
  • not clear how to overcome

. – p.28/28