Archive for the ‘Lisp’ Category

Pattern Overloading

Tuesday, December 6th, 2016

Pattern Overloading by Ramsey Nasser.

From the post:

C-like languages have a problem of overloaded syntax that I noticed while teaching high school students. Consider the following snippets in such a language:

foo(45)

function foo(int x) {

for(int i=0;i < 10; i++) {

if(x > 10) {

case(x) {

A programmer experienced with this family would see

  1. Function invocation
  2. Function definition
  3. Control flow examples

In my experience, new programmers see these constructs as instances of the same idea: name(some-stuff) more-stuff. This is not an unreasonable conclusion to reach. The syntax for each construct is shockingly similar given that their semantics are wildly different.

You won’t be called upon to re-design C but Nasser’s advice:

Syntactic similarity should mirror semantic similarity

Or, to take a quote from the UX world

Similar things should look similar and dissimilar things should look dissimilar

is equally applicable to any syntax that you design.

Re-Use, Re-Use! Using Weka within Lisp

Friday, August 19th, 2016

Suggesting code re-use, as described by Paul Homer in The Myth of Code Reuse, provokes this reaction from most programmers (substitute re-use for refund):

😉

Atabey Kaygun demonstrates he isn’t one of those programmers in Using Weka within Lisp:

From the post:

As much as I like implementing machine learning algorithms from scratch within various languages I like using, in doing serious research one should not take the risk of writing error-prone code. Most likely somebody already spent many thousand hours writing, debugging and optimizing code you can use with some effort. Re-use people, re-use!

In any case, today I am going to describe how one can use weka libraries within ABCL implementation of common lisp. Specifically, I am going to use the k-means implementation of weka.

As usual, well written and useful guide to using Weka and Lisp.

The issues of code re-use aren’t confined to programmers.

Any stats you can suggest on re-use of database or XML schemas?

Rich Hickey and Brian Beckman – Inside Clojure (video)

Thursday, August 18th, 2016

From the description:

Clojure is a dynamic programming language created by Rich Hickey that targets both the Java Virtual Machine and the CLR. It is designed to be a general-purpose language, combining the approachability and interactive development of a scripting language with an efficient and robust infrastructure for multithreaded programming. Clojure is a compiled language – it compiles directly to JVM bytecode, yet remains completely dynamic. Every feature supported by Clojure is supported at runtime. Clojure provides easy access to the Java frameworks, with optional type hints and type inference, to ensure that calls to Java can avoid reflection.

Clojure is a dialect of Lisp, and shares with Lisp the code-as-data philosophy and a powerful macro system. Clojure is predominantly a functional programming language, and features a rich set of immutable, persistent data structures. When mutable state is needed, Clojure offers a software transactional memory system and reactive Agent system that ensure clean, correct, multithreaded designs.

Astrophysicist and Software Architect Brian Beckman interviews Rich Hickey to dig into the details of this very interesting language. If you don’t know much about Clojure and the general problems it aims to solve, well, watch and listen carefully to this great conversation with plenty of whiteboarding and outstanding questions. Expert to Expert simply rocks! Thank you for spending time with us, Rich! Clojure is great!

From 2013 but what a nice find for a Thursday afternoon!

Do you know the origin of “conj” in Clojure? 😉

Enjoy!

Writing Games with Emacs

Sunday, February 28th, 2016

Writing Games with Emacs by Zachary Kanfer. (video)

From the description:

Games are a great way to get started writing programs in any language. In Emacs Lisp, they’re even better—you use the same exact techniques to extend Emacs, configuring it to do what you want. In this presentation, Zachary Kanfer livecodes tic-tac-toe. You’ll see how to create a basic major mode, make functions, store state, and set keybindings.

You can grab the source code at: zck.me.

Ready to build some muscle memory?

LispNYC Videos

Wednesday, February 3rd, 2016

LispNYC Videos

Videos recorded at some LispNYC meetings have been posted online.

Not enough to get your through the 2016 election cycle but a good start!

Enjoy!

You Can Contribute Proof Reading! (Emacs/Elisp)

Wednesday, January 20th, 2016

I saw a tweet today by John Wiegley asking for volunteers to proof read the manual for Emacs 25.0.50 and Elisp 25.0.50.

Obtain the files: http://ftp.newartisans.com/pub/emacs/manuals/ (PDF and info formats)

Report bugs: M-x report-emacs-bug.

Is this the year you are going to make a contribution to an open source project?

Emacs – Helm and @ndw

Sunday, January 3rd, 2016

A Package in a league of its own: Helm

From the webpage:

Helm is incremental completion and selection narrowing framework for Emacs. It will help steer you in the right direction when you’re looking for stuff in Emacs (like buffers, files, etc).

Helm is a fork of anything.el originally written by Tamas Patrovic and can be considered to be its successor. Helm sets out to clean up the legacy code in anything.el and provide a cleaner, leaner and more modular tool, that’s not tied in the trap of backward compatibility.

I saw the following tweet from Norman Walsh today:

Been hacking #Emacs again the past few days. Serious fun. Also: finally became a helm convert. Seriously productive.

I know better.

I should look away, quickly when I see “Emacs” and “Norman Walsh” in a tweet together.

But, just like every other time, I follow the reference, this time to Helm (see above).

I will become more productive, from using Helm or learning more about Emacs in the process. It’s a win either way.

The downside, not too serious a downside, is that I will lose N hours this week as I pursue this lead.

It’s one of the risks of following someone like Norman Walsh on Twitter. But an acceptable one.

Enjoy!

SICP Distilled Now Public

Thursday, October 8th, 2015

SICP Distilled Now Public by Tom Hall.

From the post:

I have made the SICP Distilled site public.

It is now a year since the SICP Distilled Kickstarter was funded, I originally thought it would take 5 months to complete and had a slightly different vision for what it would look like, massive thanks to all of the supporters for their patience and understanding.

I originally thought an accompaniment to the original book but it has wound up being more like a rewrite, fortunately the original text is under a Creative Commons Attribution-ShareAlike 4.0 License so I can ‘remix’ it without getting into copyright issues if I have the same licence.

It is not complete yet, but I think I now have good explanations of:

Which really are (for me at least) the highlights of the book.

As a very minor supporter in the Kickstarter campaign I deeply appreciate all the effort that Tom has devoted to this effort.

Comment early and often!

Computational Literary Analysis

Wednesday, October 7th, 2015

Computational Literary Analysis by Atabey Kaygun.

From the post:

Description of the problem

One of the brilliant ideas that Kurt Vonnegut came up with was that one can track the plot of a literary work using graphical methods. He did that intuitively. Today’s question is “Can we track the plot changes in a text using computational or algorithmic methods?”

Overlaps between units of texts

The basic idea is to split a text into fundamental units (whether this is a sentence, or a paragraph depends on the document) and then convert each unit into a hash table where the keys are stemmed words within the unit, and the values are the number of times these (stemmed) words appear in each unit.

My hypothesis is (and I will test that in this experiment below) that the amount of overlap (the number of common words) between two consecutive units tells us how the plot is advancing.

I will take the fundamental unit as a sentence below.

Clojure, Lisp, computational literary analysis, what’s there not to like? 😉

Given the hypothesis:

the amount of overlap (the number of common words) between two consecutive units tells us how the plot is advancing

Atabey doesn’t say what his criteria is for “the plot advancing.” I mention that because both of the plots he offers trail off from their highs.

If there is a plot advance, shouldn’t the respective speeches build until they peak at the end?

Or is there some more complex “plot advancement” at play?

One of the things that makes this and similar analyses useful, particularly of well known speeches/works, is that we all “know” the high points. We have been conditioned to hear those as distinct, when the original hearers/readers were encountering it for the first time.

Such tools can pry us out of the rut of prior analysis. Sometimes.

Lisp for the Modern Web

Sunday, August 23rd, 2015

Lisp for the Modern Web by Vito Van.

From the post:

What to Expect

This piece is about how to build a modern web application with Common Lisp in the backend, from scratch.

You may need to have some knowledge about Front End Development, cause we won’t explain the steps for building the client.

Why Lisp? Again

It is awesome.

I don’t think we need another reason for using Lisp, do we? Life is short, let’s be awesome!

It’s been more than half a century since Lisp first appeared, she’s like the The One Ring in the Middle-earth. The one who mastered the spell of Lisp, will rule the world, once again.

Other reasons.

If you need some other reasons beside awesome, here is some articles about Lisp, enjoy them.

I have never been fond of triumphalism so let me give you a more pragmatic reason for using Lisp:

Ericka Chickowski reports in Angler Climbing To Top Of Exploit Heap that Angler makes up 82% of the exploit kits in use.

Angler targets? Adobe Flash and Java.

Any questions?

You can write vulnerable code in Lisp just as you can any other language. But then it will be your mistake and not something broken at the outset.

I first saw this in a tweet by Christophe Lalanne.

Running Lisp in Production

Saturday, June 27th, 2015

Running Lisp in Production by Vsevolod Dyomkin and Kevin McIntire.

From the post:

At Grammarly, the foundation of our business, our core grammar engine, is written in Common Lisp. It currently processes more than a thousand sentences per second, is horizontally scalable, and has reliably served in production for almost 3 years.

We noticed that there are very few, if any, accounts of how to deploy Lisp software to modern cloud infrastructure, so we thought that it would be a good idea to share our experience. The Lisp runtime and programming environment provides several unique, albeit obscure, capabilities to support production systems (for the impatient, they are described in the final chapter).

An inspirational story about Lisp, along with tips on features you are unlikely to find elsewhere. A good read and worth the time.

Since the OPM is still running COBOL, I am sure one of your favorite agencies is still crunching Lisp. You might need to get them to upgrade.

Read Lisp, Tweak Emacs:..

Thursday, January 1st, 2015

Read Lisp, Tweak Emacs: How to read Emacs Lisp so that you can customize Emacs by Sacha Chua

From the introduction:

Hi! This is a guide to help you pick up the basics of reading customization code for Emacs – little snippets of Emacs Lisp that you can add to your ~/.emacs.d/init.el to change how Emacs works. I hope this will help you learn how to borrow interesting snippets from README files and other people’s configs so that you can tweak Emacs to fit the way you work. This is not a detailed guide on how to understand Emacs internals, but by the time you find yourself digging through comint.el to figure out what’s going on with command interpretation, you probably already know your way around.

We’ll assume that you already have Emacs installed and that you’ve gone through the built-in tutorial (Help – Emacs Tutorial, <f1> t, C-h t, or M-x help-with-tutorial). I’ll also assume you have a little programming background or can deal with the concepts of variables and functions. Feel free to ask questions if you get stuck on something or if you want to clarify your understanding.

Please e-mail questions, comments, and suggestions to sacha@sachachua.com. I want to make this guide better, and I’d love to hear from you. If you would like to help improve this guide, you can find it on Github – pull requests welcome. This guide is dual-licensed under the Creative Commons Attribution License and the GNU Free Documentation License, so feel free to read, share, and build on it.

You can find this guide on the Web athttp://emacslife.com/how-to-read-emacs-lisp.html . If you want an EPUB version or a downloadable HTML version, you can get it from Gumroad (free/pay-what-you-want).

Documentation on Emacs can best be described as “varied.” Both in terms of ease of reading and usefulness.

Sacha’s guide to tweaking Emacs ranks high on both counts.

Do you want an editor:

  1. brimming with features you don’t want, or
  2. brimming with features you do want?

Even if you are a user community of one (1), tweaked Emacs can delivery that type of editing experience.

Start the year off right! Learn/tweak Emacs today!

Awesome Common Lisp

Wednesday, December 31st, 2014

Awesome Common Lisp by Koz Ross.

From the webpage:

A curated list of Common Lisp good stuff. I give preference to free software for code, and sellers who aren’t evil for physical resources.

This is released under the GNU Free Documentation License – its text is provided in the LICENSE file.

All libraries listed here are available from Quicklisp unless stated otherwise.

A deeply impressive list of Common Lisp resources. As “big data” becomes even bigger, curated lists (or more sophisticated) collections of resources will become quite popular.

Yahoo tried that at the inception of the WWW but its buckets were too random and too large. Drowning in a bucket is as bad as drowning in the ocean. Perhaps more so because you jumped into the bucket to avoid drowning at all.

Curated collections of resources will have to be more focused and sophisticated than the Yahoo bucket model.

Specific suggestions?

The Concert Programmer

Saturday, November 8th, 2014

From the description:

From OSCON 2014: Is it possible to imagine a future where “concert programmers” are as common a fixture in the worlds auditoriums as concert pianists? In this presentation Andrew will be live-coding the generative algorithms that will be producing the music that the audience will be listening too. As Andrew is typing he will also attempt to narrate the journey, discussing the various computational and musical choices made along the way. A must see for anyone interested in creative computing.

This impressive demonstration is performed using Extempore.

From the GitHub page:

Extempore is a systems programming language designed to support the programming of real-time systems in real-time. Extempore promotes human orchestration as a meta model of real-time man-machine interaction in an increasingly distributed and environmentally aware computing context.

Extempore is designed to support a style of programming dubbed ‘cyberphysical’ programming. Cyberphysical programming supports the notion of a human programmer operating as an active agent in a real-time distributed network of environmentally aware systems. The programmer interacts with the distributed real-time system procedurally by modifying code on-the-fly. In order to achieve this level of on-the-fly interaction Extempore is designed from the ground up to support code hot-swapping across a distributed heterogeneous network, compiler as service, real-time task scheduling and a first class semantics for time.

Extempore is designed to mix the high-level expressiveness of Lisp with the low-level expressiveness of C. Extempore is a statically typed, type-inferencing language with strong temporal semantics and a flexible concurrency architecture in a completely hot-swappable runtime environment. Extempore makes extensive use of the LLVM project to provide back-end code generation across a variety of architectures.

For more detail on what the Extempore project is all about, see the Extempore philosophy.

For programmers only at this stage but can you imagine the impact of “live searching?” Where data structures and indexes arise from interaction with searchers? Definitely worth a long look!

I first saw this in a tweet by Alan Zucconi.

The Common Lisp Cookbook

Sunday, November 2nd, 2014

The Common Lisp Cookbook

From the webpage:

This is a collaborative project that aims to provide for Common Lisp something similar to the Perl Cookbook published by O’Reilly. More details about what it is and what it isn’t can be found in this thread from comp.lang.lisp.

The credit for finally giving birth to the project probably goes to "dj_special_ed" who posted this message to comp.lang.lisp.

If you want to contribute to the CL Cookbook, you can

  • ask one of the project admins to become a registered developer,
  • submit patches via Sourceforge’s patch tracking system,
  • or simply send stuff (corrections, additions, or even whole chapters) by email.

Yes, we’re talking to you! We need contributors – write a chapter that’s missing and add it, find an open question and provide an answer, find bugs and report them, or just send questions and wait for somebody else to answer them. (If you have no idea what might be missing but would like to help, take a look at the table of contents of the Perl Cookbook. [Updated the link to point to 2nd edition, 2003.]) Don’t worry about the formatting, just send plain text if you like – we’ll take care about that later.

Thanks in advance for your help!

The pages here on Sourceforge’s web server should be fairly up-to-date – they’re automatically checked out of theCVS repository once per day. You can also download a nightly CVS tarball for offline browsing. More info, including mailing list(s), can be found at the Sourceforge project page. There’s also a CHANGELOG available.

Is the 2nd edition of the Perl Cookbook really eleven (11) years old? What needs to be added to that toc for Common Lisp?

I first saw this in a tweet by Christophe Lalanne.

COMMON LISP: An Interactive Approach

Friday, October 31st, 2014

COMMON LISP: An Interactive Approach by Stuart C. Shapiro.

From the preface:

Lisp is the language of choice for work in artificial intelligence and in symbolic algebra. It is also important in the study of programming languages, because, since its inception over thirty years ago, it has had full recursion, the conditional expression, the equivalence of program and data structure, its own evaluator available to the programmer, and extensibility—the syntactic indistinguishability of programmer-defined functions and “built-in” operators. It is also the paradigm of “functional,” or “applicative,” programming. Because of the varied interests in Lisp, I have tried to present it in a general and neutral setting, rather than specifically in the context of any of the special fields in which it is used.

Although published in 1992, this book remains quite relevant today. How many languages can you name that have with equivalence of program and data structure? Yes, that’s what I thought.

Notes from CSE 202 (2002) are available along with Stuart C. Shapiro & David R. Pierce, A Short Course in Common Lisp (2004).

Announcing Clasp

Tuesday, October 28th, 2014

Announcing Clasp by Christian Schafmeister.

From the post:

Click here for up to date build instructions

Today I am happy to make the first release of the Common Lisp implementation “Clasp”. Clasp uses LLVM as its back-end and generates native code. Clasp is a super-set of Common Lisp that interoperates smoothly with C++. The goal is to integrate these two very different languages together as seamlessly as possible to provide the best of both worlds. The C++ interoperation allows Common Lisp programmers to easily expose powerful C++ libraries to Common Lisp and solve complex programming challenges using the expressive power of Common Lisp. Clasp is licensed under the LGPL.

Common Lisp is considered by many to be one of the most expressive programming languages in existence. Individuals and small teams of programmers have created fantastic applications and operating systems within Common Lisp that require much larger effort when written in other languages. Common Lisp has many language features that have not yet made it into the C++ standard. Common Lisp has first-class functions, dynamic variables, true macros for meta-programming, generic functions, multiple return values, first-class symbols, exact arithmetic, conditions and restarts, optional type declarations, a programmable reader, a programmable printer and a configurable compiler. Common Lisp is the ultimate programmable programming language.

Clojure is a dialect of Lisp, which means you may spot situations where Lisp would be the better solution. Especially if you can draw upon C++ libraries.

The project is “actively looking” for new developers. Could be your opportunity to get in on the ground floor!

The Hitchhiker’s Guide to…

Tuesday, August 26th, 2014

The Hitchhiker’s Guide to the Curry-Howard Correspondence by Chris Ford.

From the description:

Slides can be found here: speakerdeck.com/ctford/the-hitchikers-guide-to-the-curry-howard-correspondence

Functions are proofs. Um, I can see how that might work. Go on.

Types are propositions. Really? In what sense?

In fact, a function is the proof of the proposition its type represents. Woah, you’ve lose me now.

Don’t Panic!

The Curry-Howard Correspondence is an elegant bridge between the planet of logic and the planet of programming, and it’s not actually that hard to understand.

In this talk I’ll use the Idris dependently-typed functional programming language for examples, as its type system is sophisticated enough to construct interesting automated proofs simply by writing functions. This talk is not designed to convert you into a theoretical computer scientist, but to share with you a wonderful sight in your journey through the vast and peculiar universe of programming.

A familiarity with functional programming would be useful for appreciating this talk, but it will not require any significant prior study of theoretical computer science.

Great presentation by Chris Ford at EuroClojure!

The only problem I had was coordinating the slides, which aren’t very visible in the presentation, with the slide deck you can download.

Definitely a watch more than once video.

Enjoy!

Useful links (references in the slides):

Edwin Brady, Indris

Edwin Brady, Programming in Indris: A Tutorial

Brian McKenna, EvenOdd in Agda, Idris, Haskell, Scala

Philip Wadler, Propositions as Types (Updated, June 2014)

Where to get help with Common Lisp

Monday, August 25th, 2014

Where to get help with Common Lisp by Zach Beane.

An annotated listing of help resources for Common Lisp.

I especially appreciated his quote/comment from one mailing list:

Beware that “the accuracy of postings made to the list is not guaranteed.” (I think that goes for every mailing list, ever.)

😉

I first saw this in a tweet by Planet Lisp.

Ninety-Nine Haskell Problems [Euler/Clojure too]

Monday, July 21st, 2014

Ninety-Nine Haskell Problems

From the webpage:

These are Haskell translations of Ninety-Nine Lisp Problems, which are themselves translations of Ninety-Nine Prolog Problems.

Also listed are:

Naming isn’t the only hard problem in computer science. The webpage points out that due to gaps and use of letters, there are 88 problems and not 99.

If you want something a bit more challenging, consider the Project Euler problems. No peeking but there is a wiki with some Clojure answers, http://clojure-euler.wikispaces.com/.

Enjoy!

I first saw this in a tweet by Computer Science.

L(λ)THW

Monday, July 14th, 2014

L(λ)THW Learn Lisp The Hard Way by “the Phoeron” Colin J.E. Lupton

From the preface:

TANSTAAFL

“There Ain't No Such Thing As A Free Lunch… anything free costs twice as much in the long run or turns out worthless.”

Robert A. Heinlein, The Moon Is A Harsh Mistress

Programming is hard. Anyone who says differently is either trying to make you feel inferior to them or sell you something. In the case of many “easy-to-learn” programming languages, both happen to be true. But you're not here for inefficient, glorified, instant-gratification scripting languages that pigeon-hole you into prescribed execution control-flows and common use-cases. You're not here for monolithic imperative languages that have to be tamed into submission for the simplest tasks. You've sought out the Hard Way, and the hardest language to master, Common Lisp. You're not afraid of working for what you want or committing to a new way of thinking—you're here because you want to be a Lisp Hacker, and you're not going to let anything get in your way.

That being said, learning Lisp is not an impossible dream. Like any skill, practice makes perfect—and that's what the Hard Way is all about. Lisp may seem like an ancient mystical secret, cherished and protected by an impenetrable cabal of hacker elites, but that, much like the language's popular association solely with Artificial Intelligence applications, is a misconception. You don't have to be a genius or Black Hat to crack the mystery surrounding the language and the open-source subculture where it thrives. You just have to follow a few essential steps, and apply them without fail.

The biggest secret to Lisp is that it is actually the simplest programming language ever created—and that, coupled with its expressiveness and elegance, is why it is favored exclusively by the best programmers in the world. With hard work, attention to detail, and careful reflection over the subject material, you will be up and running with Lisp and writing real applications much earlier than you could with other, lesser languages.

Lisp dates from 1958 so there is no shortage of materials if you need to search for online resources. 😉

The resources section is a bit “lite” but the resources cited do point you to more resources.

Enjoy!

I first saw this in a tweet by Computer Science.

Read Lisp, Tweak Emacs

Sunday, June 15th, 2014

Read Lisp, Tweak Emacs by Sacha Chua.

Sacha is writing a series of posts on reading Lisp and tweaking Emacs.

Thus far:

And she is writing content for an email course on Lisp and Emacs, that can be found at:

http://emacslife.com/how-to-read-emacs-lisp.html

Not that Emacs will ever be a mainstream editor for topic maps but it could be useful to experiment with features for a topic map authoring/editing environment.

How to translate useful features into less capable editors will vary from editor to editor. 😉

Lisp Flavored Erlang

Saturday, May 24th, 2014

Lisp Flavored Erlang These are your father’s parentheses Elegant weapons, for a more …civilized age1.

From the homepage:

Origins

LFE has many origins, depending upon whether you’re looking at Lisp (and here), Erlang, or LFE-proper. The LFE community of contributors embraces all of these and more.

From the original release message:

I have finally released LFE, Lisp Flavoured Erlang, which is a lisp syntax front-end to the Erlang compiler. Code produced with it is compatible with “normal” Erlang code. The is an LFE-mode for Emacs and the lfe-mode.el file is include in the distribution… (Robert Virding)

I haven’t looked up the numbers but I am sure that LFE is in the terminology of academia, one of the less often taught languages. However, it sounds deeply interesting as we all march towards scalable concurrent processing.

Lisp: Common Lisp, Racket, Clojure, Emacs Lisp

Wednesday, May 14th, 2014

Lisp: Common Lisp, Racket, Clojure, Emacs Lisp

A “hyperpolyglot” (although technically only a quadglot) that is a side-by-side reference sheet for Common Lisp, Racket, Clojure, and, Emacs Lisp.

One of the Hexaglot versions of the Bible included: Old Testament in Hebrew, Greek, Latin, English, German and French; New Testament in Greek, Syriac, Latin, English, German and French.

For another interesting example of analog information retrieval, see: Complutensian Polyglot Bible

Note that the location of the parallel texts meant the reader did not lose their original context when consulting another text. Unlike hyperlinks that take a reader away from the current resource.

Just out of curiosity I backed up the URL and found: Hyperpolyglot.

Which includes side by side references for:

Programming Languages

commonly used features in a side-by-side format

Interpreted Languages: JavaScript, PHP, Python, Ruby
More Interpreted Languages: Perl, Tcl, Lua, Groovy
C++ Style Languages: C++, Objective-C, Java, C#
Languages in the Key of C: C, Go
Pascal Style Languages: Pascal, Ada, PL/pgSQL
Lisp Dialects: Common Lisp, Racket, Clojure, Emacs Lisp
ML Dialects and Friends: OCaml, F#, Scala, Haskell
Prolog and Erlang: Prolog, Erlang
Stack-Oriented Languages: Forth, PostScript, Factor
Operating System Automation: POSIX Shell, AppleScript, PowerShell
Relational Data Languages: SQL, Awk, Pig
Numerical Analysis & Statistics: MATLAB, R, NumPy and Fortran
Computer Algebra Software: Mathematica, SymPy, Pari/GP

Programming Tools

Unix Shells: Bash, Fish, Ksh, Tcsh, Zsh
Text Mode Editors: Vim, Emacs, Nano
Version Control: Git, Mercurial
Build Tools: Make, Rake, Ant
Terminal Multiplexers: Screen, Tmux
Databases: PostgreSQL, MySQL, SQLite, Redis, MongoDB, Neo4j
Markup: Markdown, reStructuredText, MediaWiki, Wikidot, LaTeX
2D Vector Graphics: PostScript, Processing, SVG
Mathematical Notation: LaTeX, Mathematica, HTML Entities, Unicode

Of course, one downside to such a listing is that it would be difficult to supplement the information given without manually editing the tables.

Future Values of Merges

Thursday, April 17th, 2014

Multilisp: A Language for Concurrent Symbolic Computation by Robert H. Halstead. (ACM Transactions on Programming Languages and Systems, Vol. 7, No. 4, October 1985, Pages 501-538.)

Abstract:

Multilisp is a version of the Lisp dialect Scheme extended with constructs for parallel execution. Like Scheme, Multilisp is oriented toward symbolic computation. Unlike some parallel programming languages, Multilisp incorporates constructs for causing side effects and for explicitly introducing parallelism. The potential complexity of dealing with side effects in a parallel context is mitigated by the nature of the parallelism constructs and by support for abstract data types: a recommended Multilisp programming style is presented which, if followed, should lead to highly parallel, easily understandable programs. Multilisp is being implemented on the 32-processor Concert multiprocessor; however, it is ulti-mately intended for use on larger multiprocessors. The current implementation, called Concert Multilisp, is complete enough to run the Multilisp compiler itself and has been run on Concert prototypes including up to eight processors. Concert Multilisp uses novel techniques for task scheduling and garbage collection. The task scheduler helps control excessive resource utilization by means of an unfair scheduling policy; the garbage collector uses a multiprocessor algorithm based on the incremental garbage collector of Baker.

Of particular interest:

Multilisp’s principal construct for both creating tasks and synchronizing among them is the future. The construct ( future X ) immediately returns a future for the value of the expression X and concurrently begins evaluating X. When the evaluation of X yields a value, that value replaces the future. The future is said to be initially undetermined; it becomes determined when its value has been computed. An operation (such as addition) that needs to know the value of an undetermined future will be suspended until the future becomes determined, but many operations, such as assignment and parameter passing, do not need to know anything about the values of their operands and may be performed quite comfortably on undetermined futures. The use of futures often exposes surprisingly large amounts of parallelism in a program, as illustrated by a Quicksort program given in Figure 1.

The use of a future value for merge operations, which could avoid re-processing a topic map for each cycle of merging, sounds promising.

Deferral of the results isn’t just an old Lisp idea as you will find in: Counting complex disordered states by efficient pattern matching: chromatic polynomials and Potts partition functions by Marc Timme, Frank van Bussel, Denny Fliegner, and Sebastian Stolzenberg.

Abstract:

Counting problems, determining the number of possible states of a large system under certain constraints, play an important role in many areas of science. They naturally arise for complex disordered systems in physics and chemistry, in mathematical graph theory, and in computer science. Counting problems, however, are among the hardest problems to access computationally. Here, we suggest a novel method to access a benchmark counting problem, finding chromatic polynomials of graphs. We develop a vertex-oriented symbolic pattern matching algorithm that exploits the equivalence between the chromatic polynomial and the zero-temperature partition function of the Potts antiferromagnet on the same graph. Implementing this bottom-up algorithm using appropriate computer algebra, the new method outperforms standard top-down methods by several orders of magnitude, already for moderately sized graphs. As a first application, we compute chromatic polynomials of samples of the simple cubic lattice, for the first time computationally accessing three-dimensional lattices of physical relevance. The method offers straightforward generalizations to several other counting problems.

In lay person’s terms the work by Timme and company visits each node in a graph and records an expression that includes unkowns (futures?), that is the values at other nodes in the graph. Using pattern matching techniques, the algorithm then solves all of the unknowns and replaces them with appropriate values. How effective is this?

“The existing algorithm copies the whole network for each stage of the calculation and only changes one aspect of it each time,” explains Frank van Bussel of the Max Planck Institute for Dynamics and Self-Organization (MPIDS). Increasing the number of nodes dramatically increases the calculation time. For a square lattice the size of a chess board, this is estimated to be many billions of years. The new algorithm developed by the Göttingen-based scientists is significantly faster. “Our calculation for the chess board lattice only takes seven seconds,” explains Denny Fliegner from MPIDS. (A New Kind of Counting)

Hmmm, “many billions of years” versus “seven seconds.”

For further details on the pattern matching work see the project page at: Complex Disordered Systems: Statistical Physics and Symbolic Computation

Deferral of results looks like a fruitful area for research for topic maps in general and parallel processing of topic maps in particular.

I first saw the Multilisp paper in a tweet by Mom of Finland.

Why and How to Start Your SICP Trek

Tuesday, April 15th, 2014

Why and How to Start Your SICP Trek by Kai Wu.

From the post:

This post was first envisioned for those at Hacker Retreat – or thinking of attending – before it became more general. It’s meant to be a standing answer to the question, “How can I best improve as a coder?”

Because I hear that question from people committed to coding – i.e. professionally for the long haul – the short answer I always give is, “Do SICP!” *

Since that never seems to be convincing enough, here’s the long answer. 🙂 I’ll give a short overview of SICP’s benefits, then use arguments from (justified) authority and argument by analogy to convince you that working through SICP is worth the time and effort. Then I’ll share some practical tips to help you on your SICP trek.

* Where SICP = The Structure and Interpretation of Computer Programs by Hal Abelson and Gerald Sussman of MIT, aka the Wizard book.

BTW, excuse my enthusiasm for SICP if it comes across at times as monolingual theistic fanaticism. I’m aware that there are many interesting developments in CS and software engineering outside of the Wizard book – and no single book can cover everything. Nevertheless, SICP has been enormously influential as an enduring text on the nature and fundamentals of computing – and tends to pay very solid dividends on your investments of attention.

A great post with lots of suggestions on how to work your way through SICP.

What it can’t supply is the discipline to actually make your way through SICP.

I was at a Unicode Conference some years ago and met Don Knuth. I said something in the course of the conversation about reading some part of TAOCP and Don said rather wistfully that he wished he would met someone who had read it all.

It seems sad that so many of us have dipped into it here or there but not really taken the time to explore it completely. Rather like reading Romeo and Juliet for the sexy parts and ignoring the rest.

Do you have a reading plan for TAOCP after you finish SICP?

I first saw this in a tweet by Computer Science.

Structure and Interpretation of Computer Programs (OCW)

Wednesday, April 9th, 2014

Structure and Interpretation of Computer Programs (MIT OCW)

From the course description:

This course introduces students to the principles of computation. Upon completion of 6.001, students should be able to explain and apply the basic methods from programming languages to analyze computational systems, and to generate computational solutions to abstract problems. Substantial weekly programming assignments are an integral part of the course. This course is worth 4 Engineering Design Points.

Twenty lecture videos of Abelson and Sussman, twenty-four sets of lecture notes, a couple of tests and while there I found:

Structure and Interpretation of Computer Programs Tutor

This is a public implementation of the online tutor for the MIT course Structure and Interpretation of Computer Programs (MIT course 6.001).

I’m not sure how helpful you will find it. Apparently part of an experiment that was abandoned some time ago. Still, it has slides problem sets, links to other materials, etc. but I was unable to find the promised audio files.

The main course should be cited as:

Grimson, Eric, Peter Szolovits, and Trevor Darrell. 6.001 Structure and Interpretation of Computer Programs, Spring 2005. (MIT OpenCourseWare: Massachusetts Institute of Technology), http://ocw.mit.edu/courses/electrical-engineering-and-computer-science/6-001-structure-and-interpretation-of-computer-programs-spring-2005 (Accessed 9 Apr, 2014). License: Creative Commons BY-NC-SA

Enjoy!

Learning Lisp With C

Wednesday, April 9th, 2014

Build Your Own Lisp by Daniel Holden.

From the webpage:

If you’re looking to learn C, or you’ve ever wondered how to build your own programming language, this is the book for you.

In just a few lines of code, I’ll teach you how to effectively use C, and what it takes to start building your own language.

Along the way we’ll learn about the weird and wonderful nature of Lisps, and what really makes a programming language. By building a real world C program we’ll learn implicit things that conventional books cannot teach. How to develop a project, how to make life easy for your users, and how to write beautiful code.

This book is free to read online. Get started now!

Read Online!

This looks interesting and useful.

Enjoy!

Data Structures in Clojure:…

Tuesday, February 4th, 2014

Data Structures in Clojure: Singly-Linked Lists by Max Countryman.

From the post:

This series is about the implementation of common data structures. Throughout the series we will be implementing these data structures ourselves, exploring how they work. Our implementations will be done in Clojure. Consequently this tutorial is also about Lisp and Clojure. It is important to note that, unlike the standard collection of data structures found in Clojure, which are persistent, ours will be mutable.

To start with, we will explore a linked list implementation using deftype (more on this later) to define a JVM class from Clojure-land. This implementation will be expanded to include in-place reversal. Finally we will utilize Clojure’s built-in interfaces to give our linked list access to some of the methods Clojure provides.

If you aren’t going to invent your own computer language, why not learn an existing one better?

The next post is on hash tables.

Enjoy!