Defects of von Neumann languages

John Backus, the inventor of Fortran criticized the defects of von Neumann languages (aka, imperative languages) in his 1977 Turing Award Lecture. Most of his points still remain valid until today!

The defects can be summarized:

  • close coupling of semantics to state transitions
  • division of programming into a world of expressions and a world of statements
  • inability to effectively use powerful combining forms for building new programs from existing ones
  • lack of mathematical properties for reasoning about programs

He described conventional programming languages as fat and flabby because each successive programming language adds more and more features with little cleaning up. Even though most conventional languages are similar as they simply add higher level constructs to the same underlying von Neumann computing model, learning a new language still takes long time due to many subtle corner cases in their semantics.

He evaluated von Neumann model with 4 criteria:

  • Foundations: complex, bulky, not useful compared to Turing machines, various automata, Church’s lambda calculus or Curry’s system of combinators
  • History sensitivity: have storage, are history sensitive
  • Type of semantics: state transition with complex states (not simple as in automata)
  • Clarity and conceptual usefulness of programs: programs can be moderately clear, are not very useful conceptually

What’s the von Neumann computer? It has three parts: CPU, a store and a connecting tube that can transmit a single word between the CPU and the store. Programming on this machine is to change the contents of the store by repeatedly transferring single words between CPU and the store through the tube. So he called this tube the von Neumann bottleneck.

By the von Neumann bottleneck, he does not mean the limited bandwidth of the tunnel (bus). The real problem is that it becomes an intellectual bottleneck that keeps us tied to word-at-a-time thinking instead of larger conceptual thinking. The assignment statement in von Neumann languages corresponds to the von Neumann bottleneck which keeps us thinking in word-at-a-time terms in much the same way the computer’s bottleneck does.

So he proposed Functional Programming (FP) system as an alternative to von Neumann languages. FP is a functional programming language in point-free style. Please read the original paper for the details of the language. If you are interested in the implementation of FP, FP is my Haksell implementation of FP.

Disable Chrome’s two-finger back/forward navigation

Page change gesture is a bit annoying to me because I often accidentally change pages when I just wanted to scroll up and down.

Because Google Chrome uses Apple’s default gestures, we can turn it off from System Preferences.

System Preferences > Trackpad > More Gestures > Swipe between pages

If you want to turn it off only on Google Chrome, open the terminal and type

defaults write com.google.Chrome.plist AppleEnableSwipeNavigateWithScrolls -bool FALSE

Haskell Platform with Mac OS X 10.9 (Mavericks)

XCode 5.0 on Mac OS X 10.9 (Mavericks) no longer provides GCC, only clang. According to Haskell Platform for Mac OS X,

Xcode 5 supplies clang as the C compier, and with respect to pre-processing there are some “differences of interpretation” between it and gcc. These differences can affect some Haskell code that uses the CPP extension.

There are two alternatives to solve this problem

  1. Download ghc-clang-wrapper.  Copy this script to /usr/bin, and make sure it is exectuable. Run it sudo.

  2. Install a gcc and direct GHC at that.

I installed Haskell Platform using MacPorts and confirmed that the first method works well. If ghc-clang-wrapper does not find where ghc is installed, you can manually edit /opt/local/lib/ghc-7.6.3/settings by replacing the line

(“C compiler command”, “/opt/local/bin/gcc-mp-4.7”),

with

(“C compiler command”, “/usr/bin/ghc-clang-wrapper”),

Joining the FSF membership program

Yesterday I joined the Free Software Foundation Associate membership, so I donate $10 per month now.

[FSF Associate Member]

I think $10/month is a small money compared to the value and freedom I got from many free software I’ve always used.

If you purchase many silly apps on App Store and Google Play and never donate any money to the free software you use everyday, you should feel shame on you.

Free software is a cornerstone of any modern free society. Please help build this foundation.

WebKitGTK+ Hackfest 2013

I’ve just got back to Korea from WebKitGTK+ Hackfest. The fifth WebKitGTK+ Hackfest was held in A Coruña, Spain December 9-12. I attended the hackfest for the first time and really enjoyed hacking thanks to many excellent hackers from Igalia, Collabora, Samsung RedHat and CableLabs.

GNOME WebKitGTK+ hackfest

I helped enabling network process for WebKitGTK+ with Andy Wingo, Carlos Garcia Campos, Gustavo Noronha, Brian Holt, Martin Robinson, Alberto Garcia and Sergio Villar. Enabling network process was a top priority because it is a prerequisite to support  a one process per tab (multiple web process model). And we succeeded. WebKitGTK+ now supports multiple web process model with a nice bonus of network process though we still have lots of issues and bugs to fix. For more details on the work, refer to Carlos’s excellent summary: WebKitGTK+ Hackfest 2013: The Network Process.

Big thanks to Igalia and GNOME foundation for hosting this great event!

Classic papers on functional languages

I listed a number of classic papers on functional languages. I read these papers whenever I have spare time to refresh my mind.

[0] Can Programming Be Liberated from the von Neumann Style? A Functional Style and Its Algebra of Programs

[1] Why Functional Programming Matters, John Hughes, The University, Glasgow

[2] A tutorial on the universality and expressiveness of fold, GRAHAM HUTTON, University of Nottingham, Nottingham, UK

[3] Monads for functional programming, Philip Wadler, University of Glasgow

[4] Theorems for free, Philip Wadler, University of Glasgow

I will keep updating the list of papers here. If you think I missed an important paper, please let me know.