Another Word For It Patrick Durusau on Topic Maps and Semantic Diversity

March 1, 2015

Help! Lost Source! (for story)

Filed under: Functional Programming — Patrick Durusau @ 4:35 pm

I read a delightful account of functional versus imperative programming yesterday while in the middle of a major system upgrade. Yes, I can tell by your laughter that you realize I either failed to bookmark the site and/or lost it somewhere along the way. Yes, I have tried searching for it but with all the interest in functional programming, I was about as successful as the NSA in predicting the next terror attack.

Let me relate to you as much of it as I remember, in no particular order, and perhaps you will recognize the story. It was quite clever and I want to cite it properly as well as excerpt parts of it for this blog.

The story starts off talking about functional programming and how this is the author’s take on that subject. They start with Turing and the Turing machine and observes the Turning machine writes down results on a tape. Results that are consulted by later operations.

After a paragraph or two, they move onto Church and lamda calculus. Rather than writing down results, with functional programming, the results are passed from function to function.

I thought it was an excellent illustration of why Turing machines have “state” (marks on the tape) whereas functional languages (in theory at any rate) have none.

Other writers have made the same distinction but I found the author’s focus on whether results are captured or not being the clearest I have seen.

My impression is that the piece was fairly recent, in the last month or two but I could be mistaken in that regard. It was a blog post and not terribly long. (Exclude published articles and the like.)

Are you the author? Know of the author?

Pointers are most welcome!

February 27, 2015

ClojureScript Tutorial

Filed under: ClojureScript,Functional Programming — Patrick Durusau @ 8:32 pm

ClojureScript Tutorial by Andrey Antukh.

From the webpage:

This tutorial consists on to provide an introduction to clojurescript from very basic setup, to more complex application in little incremental steps.

It includes:

  • Setup initial clojure app layout.
  • Setup initial clojurescript app layout.
  • First contact to clojurescript language.
  • Working with dom events.
  • Working with routing in the browser.
  • Working with ajax requests.
  • First contact with core.async.
  • Working with events and ajax using core.async.
  • First contact with om/reactjs.
  • Working with om and timetraveling.
  • Working with om and peristent state.
  • Little bonus: browser enabled repl.

I mention this because it will be helpful background for:

From the description:

Facebook’s React uses a virtual DOM diff implementation for high performance. It updates the view only when it’s needed. But David Nolen’s Om library (ClojureScript wrapper over React) goes even further. It stores application state in one place and passes “branches” of that state to a number of components. Data is immutable, and components are reusable. No more juggling around with JavaScript object literals. If anyone likes data as much as I do they will enjoy working with Om. It’s a great tool for building user interfaces around your data.

This talk will show how to combine core.async, liberator and om with JavaScript visualisation libraries to create interactive charts and maps. I will walk everyone through how to:

  • Generate a resource that can be used in a route and use it to pull data for visualisations
  • Use om to create reusable components out of JavaScript libraries: dimple.js and leaflet.js
  • Create core.async channels and use them communicate user clicks and selections between those components, e.g. selection on a checkbox component triggers reloading of data on a chart component.

The talk will be a practical guide to building small web applications and will be accessible to Clojurians with a basic knowledge of Clojure and HTML.

Enjoy!

February 22, 2015

Companion to “Functional Programming in Scala”

Filed under: Functional Programming,Publishing,Scala — Patrick Durusau @ 2:48 pm

A companion booklet to “Functional Programming in Scala” by Rúnar Óli Bjarnason.

From the webpage:

This full colour syntax-highlighted booklet comprises all the chapter notes, hints, solutions to exercises, addenda, and errata for the book “Functional Programming in Scala” by Paul Chiusano and Runar Bjarnason. This material is freely available online, but is compiled here as a convenient companion to the book itself.

If you talk about supporting alternative forms of publishing, here is your chance to support an alternative form of publishing, financially.

Authors are going to gravitate to models that sustain their ability to write.

It is up to you what model that will be.

Commercial Users of Functional Programming 2015 (Call for Presentations)

Filed under: Conferences,Functional Programming — Patrick Durusau @ 11:19 am

Commercial Users of Functional Programming 2015 (Call for Presentations)

CUFP 2015
Co-located with ICFP 2015
Vancouver, Canada
September 3-5
Talk Proposal Submission Deadline: 14 June 2015
CUFP 2015 Presentation Submission Form

From the webpage:


If you have experience using functional languages in a practical setting, we invite you to submit a proposal to give a talk at the event. We’re looking for two kinds of talks:

Experience reports are typically 25 minutes long, and aim to inform participants about how functional programming plays out in real-world applications, focusing especially on lessons learnt and insights gained. Experience reports don’t need to be highly technical; reflections on the commercial, management, or software engineering aspects are, if anything, more important.

Technical talks are also 25 minutes long, and should focus on teaching the audience something about a particular technique or methodology, from the point of view of someone who has seen it play out in practice. These talks could cover anything from techniques for building functional concurrent applications, to managing dynamic reconfigurations, to design recipes for using types effectively in large-scale applications. While these talks will often be based on a particular language, they should be accessible to a broad range of programmers.

I thought it was particularly interesting that you can propose a presentation or nominate someone to make a presentation. That may be standard at CUFP but I haven’t noticed it at other conferences. An innovation that could/should be adopted elsewhere?

BTW, while you wait for this year’s CUFP meeting, you can review videos from CUFP meetings starting with 2011 up to 2015. A very nice resource tucked away on a conference page. (see “Videos” on the top menu bar)

AccuWeather.com reports the June average temperature is between 66 and 70 degrees F. Great conference weather!

I first saw this in a tweet by fogus.

February 18, 2015

Clojure (introduction)

Filed under: Clojure,Functional Programming — Patrick Durusau @ 2:35 pm

Clojure (introduction) by Marko Bonaci.

Another “Clojure? That’s a Lisp, for god’s sake!” Clojure introduction by a rehabilitated Lisp avoider.

From some of the Lisp horror stories, I have to wonder if the C or C++ communities have agents they send out to teach Lisp. 😉

Your experience here will be nothing like any prior unpleasant Lisp memories!

The GitHub view of the tutorial exposes other interesting resources on Scala, Spark, and more.

I first saw this in a tweet by Anna Pawlicka

February 15, 2015

LamdaConf 2015 – May 22-25 Boulder CO

Filed under: Conferences,Functional Programming,Functional Reactive Programming (FRP) — Patrick Durusau @ 10:17 am

LamdaConf 2015 – May 22-25 Boulder CO

Early Bird Registration (self payment) ends Feb. 28, 2015

From the webpage:

Ignite your functional programming skills at the second annual LambdaConf — the largest interdisciplinary functional programming conference in the Mountain West.

With more than 40 speakers and two and a half days worth of content, LambdaConf brings together attendees with a diverse set of skills and backgrounds, united by a common passion for the power of functional programming.

Students, researchers, and programming professionals of all persuasions will find relevant topics, including introductory material on functional programming, PL and type theory, industry case studies, language workshops, and library tutorials.

In addition to two and a half days of content, the conference has ample opportunity for networking, including five group meals, one drink social, one group activity (hiking or tea), a half day unconference, and unscheduled time Saturday evening.

A non-final list of presentations:

  • How to Learn Haskell in Less Than 5 Years by Chris Allen
  • The Abstract Method, In General by Gershom Bazerman
  • Make Up Your Own: “Hello World!” by Justin Campbell
  • Why I Like Functional Programming by Adelbert Chang
  • Scalaz-Streams: A Functional Approach to Compositional, Streaming I/O by Derek Chen-Becker
  • HTTP through Functional Programming by Andrew Cherry
  • Reactive Programming with Algebra by André van Delft and Anatoliy Kmetyuk
  • Shipping a Production Web App in Elm by Richard Feldman
  • ooErlang: A Programmer-Friendly Approach to OOP in Erlang by Emiliano Firmino
  • Scalaz 102 – Taking Your Scalaz Usage Up a Notch! by Colt Fredrickson
  • Loom and Functional Graphs in Clojure by Aysylu Greenberg
  • Dynamic vs. Static: Having a Discussion without Sounding Like a Lunatic by David Greenberg
  • The Meaning of LFE by Zeeshan Lakhani
  • What’s New in Scala by Marconi Lanna
  • Idiomatic Scala: Your Options Do Not Match by Marconi Lanna
  • Introducing Emily: Simplifying Functional Programming by Andi McClure
  • Pattern Functors: Wandering Around Fix-points, Free Monads and Generics by Alejandro Serrano Mena
  • Accelerating Haskell: GPGPU Programming with Haskell by Joe Nash
  • Programs as Values: Pure Composable Database Access in Scala by Rob Norris
  • Type Theory and its Meaning Explanations by Jon Sterling
  • A Bird’s Eye View of ClojureScript by Chandu Tennety
  • Building Concurrent, Fault-Tolerant, Scalable Applications in F# using Akka.Net by Riccardo Terrell
  • Fault-Tolerance on the Cheap: Making Systems That (Probably) Won’t Fall Over by Brian L. Troutwine

With more content in the form of lighting talks, workshops, etc.

You have seen languages modifying themselves to become more functional.

Now see languages that are functional!

February 9, 2015

LambdaCms (Haskell based cms)

Filed under: CMS,Functional Programming,Hashtags — Patrick Durusau @ 10:23 am

LambdaCms (Haskell based cms)

Documentation

LambdaCms is an open source CMS in Haskell, buildon top of the Yesod web-application framework. All of Yesod’s features are available to LambdaCms sites. The main features of LambdaCms include:

  • Performant: we measured 2-10ms response times for dynamic content (HTML), w/o caching.
  • Responsive admin interface: works well on tablets and phones.
  • Modular: LambdaCms extensions using Yesod’s subsite mechanism, extensions use Cabal’s dependency specifications to depend on eachother.
  • Support for SQL databases that Yesod’s persistent supports (Postgres, MySQL, Sqlite).
  • Out-of-the-box support for authentication strategies that yesod-auth provides (BrowserID, Google, Email), and extendible with yesod-auth plugins (such as the ones for Facebook and OAuth2).
  • User management.
  • User roles.
  • Fully programmable route-based permissions.
  • Admin activity log that extensions can plug into.
  • Allows internationalization of the admin interface.
  • UI strings of the admin interface allow overrides.
  • Basic media management capabilities (from the lambdacms-media extension).

Version specific API documentation can be found on Hackage:

Besides the README’s in the various repositories, and the documentation on Hackage, we maintain some tutorials —providing guidance through several common tasks— which can be found in the section below.

From reading the documentation, LambdaCms isn’t a full featured cms, yet, but if you are interested in Haskell, this may prove to be the perfect CMS for you!

I first saw this in a tweet by Dora Marquez

February 2, 2015

Master Concurrent Processes with core.async

Filed under: Clojure,Functional Programming,Programming — Patrick Durusau @ 7:21 pm

Master Concurrent Processes with core.async

From the post:

One day, while you are walking down the street, you will be surprised, intrigued, and a little disgusted to discover a hot dog vending machine. Your scalp tingling with guilty curiosity, you won’t be able to help yourself from pulling out three Sacagawea dollars and seeing if this contraption actually works. After accepting your money, it will emit a click and a whirr, and out will pop a fresh hot dog, bun and all.

The vending machine exhibits simple behavior: when it receives money, it releases a hot dog, then readies itself for the next purchase. When it’s out of hot dogs, it stops. All around us are hot dog vending machines in different guises, independent entities concurrently responding to events in the world according to their nature. The espresso machine at your favorite coffee shop, the pet hamster you loved as a child – everything can be modeled in terms of behavior using the general form, “when x happens, do y.” Even the programs we write are just glorified hot dog vending machines, each one an independent process waiting for the next event, whether it’s a keystroke, a timeout, or the arrival of data on a socket.

machine

Clojure’s core.async library allows you to create independent processes within a single program. This chapter describes a useful model for thinking about this style of programming as well as the practical details you need to actually write stuff. You’ll learn how to use channels, alts, and go blocks to create independent processes and communicate between them, and you’ll learn a bit about how Clojure uses threads and something called “parking” to allow this all to happen efficiently.

One of the things I like the best about CLOJURE for the BRAVE and TRUE by Daniel Higginbotham is the writing style.

Yes, most processes are more complicated than a hot dog vending machine but then the inside of a hot dog vending machine if probably more complicated than you would think as well. But the example captures enough of the essence of the vending machine to make it work.

That’s a rare authoring talent and you should take advantage of it whenever you see it. (As in Daniel’s Clojure site.)

January 25, 2015

A practical introduction to functional programming

Filed under: Functional Programming,Python — Patrick Durusau @ 5:12 pm

A practical introduction to functional programming by Mary Rose Cook.

From the post:

Many functional programming articles teach abstract functional techniques. That is, composition, pipelining, higher order functions. This one is different. It shows examples of imperative, unfunctional code that people write every day and translates these examples to a functional style.

The first section of the article takes short, data transforming loops and translates them into functional maps and reduces. The second section takes longer loops, breaks them up into units and makes each unit functional. The third section takes a loop that is a long series of successive data transformations and decomposes it into a functional pipeline.

The examples are in Python, because many people find Python easy to read. A number of the examples eschew pythonicity in order to demonstrate functional techniques common to many languages: map, reduce, pipeline.

After spending most of the day with poor documentation, this sort of post is a real delight. It took more effort than the stuff I was reading today but it saves every reader time, rather than making them lose time.

Perhaps I should create an icon to mark documentation that will cost you more time than searching a discussion list for the answer.

Yes?

I first saw this in a tweet by Gianluca Fiore.

January 19, 2015

Datomic Training Videos

Filed under: Clojure,Datomic,Functional Programming — Patrick Durusau @ 7:38 pm

Datomic Training Videos by Stu Halloway.

Part I: What is Datomic?

Part II: The Datomic Information Model

Part III: The Datomic Transaction Model

Part IV: The Datomic Query Model

Part V: The Datomic Time Model

Part VI: The Datomic Operational Model

About four (4) hours of videos with classroom materials, slides, etc.

OK, it’s not Downton Abbey but if you missed it last night you have a week to kill before it comes on TV again. May as well learn something while you wait. 😉

Pay particular attention to the time model in Datomic. Then ask yourself (intelligence community): Why can’t I do that with my database? (Insert your answer as a comment, leaving out classified details.)

A bonus question: What role should Stu play on Downton Abbey?

January 9, 2015

Frequently brought up topics in #haskell [Do you have a frequency-based FAQ?]

Filed under: Functional Programming,Haskell — Patrick Durusau @ 5:32 pm

Frequently brought up topics in #haskell by David Luposchainsky.

From the webpage:

(This is like an FAQ, except that the F stands for frequently instead of someone thought this might be worth mentioning.)

Ouch!

David doesn’t say how he determined the frequency of these topics but it does suggest a number of interesting data mining and curation projects.

Where would you go to find and measure the frequency of questions on particular issues?

My first thought was StackOverflow. I didn’t see any obvious way to download their data so I pinged the admin team.

While waiting for a response, I searched and found:

Stack Exchange Data Dump (September 26, 2014) at the Internet Archive.

How cool is that?! You can get the “big” file or individual files. Well, I don’t see “computer science” listed as a separate file so I assume that would require downloading the “big” file.

Rather than a “worth mentioning” FAQ you could have a “frequently” mentioned based FAQ for a large number of areas.

The further you move away from the dump date, the less accurate your “frequency,” and I don’t know how much of an impact that would have.

Still, has a great deal of promise!

GHC (STG,Cmm,asm) illustrated for hardware persons

Filed under: Functional Programming,Haskell — Patrick Durusau @ 3:53 pm

GHC (STG,Cmm,asm) illustrated for hardware persons

From the slides:

NOTE
– This is not an official document by the ghc development team.
– Please don’t forget “semantics”. It’s very important.
– This is written for ghc 7.8 (and ghc 7.10).

As the weekend approaches I thought you might enjoy the discipline of getting a bit closer to the metal than usual. 😉

Enjoy!

I first saw this in a tweet by Pat Shaughnessy

January 8, 2015

The Type Theory Podcast

Filed under: Functional Programming,Programming,Types — Patrick Durusau @ 1:58 pm

The Type Theory Podcast

From the about page:

The Type Theory Podcast is a podcast about type theory and its interactions with programming, mathematics, and philosophy. Our goal is to bring interesting research to a wider audience.

I’m not sure how I missed this when it started. 😉

There are three episodes available now:

Episode 1: Peter Dybjer on types and testing

In our inaugural episode, we speak with Peter Dybjer from Chalmers University of Technology. Peter has made significant contributions to type theory, including inductive families, induction-recursion, and categorical models of dependent types. He is generally interested in program correctness, programming language semantics, and the connection between mathematics and programming. Today, we will talk about the relationship between QuickCheck-style testing and proofs and verification in type theory.

Episode 2: Edwin Brady on Idris

In our second episode, we speak with Edwin Brady from the University of St. Andrews. Since 2008, Edwin has been working on Idris, a functional programming language with dependent types. This episode is very much about programming: we discuss the language Idris, its history, its implementation strategies, and plans for the future.

Episode 3: Dan Licata on Homotopy Type Theory

In our third episode, we dicuss homotopy type theory (HoTT) with Wesleyan University’s Dan Licata. Dan has participated during much of the development of HoTT, having completed his PhD at CMU and having been a part of the Institute for Advanced Study’s special year on the subject. In our interview, we discuss the basics of HoTT, some potential applications in both mathematics and computing, as well as ongoing work on computation, univalence, and cubes.

Each episode has links to additional reading materials and resources.

Enjoy!

January 2, 2015

Clojure 2014 Year in Review

Filed under: Clojure,Functional Programming,Programming — Patrick Durusau @ 5:52 pm

Clojure 2014 Year in Review by Stuart Sierra.

A good collection of links to Clojure news in 2014. Easy to scan to see if you missed anything or to revisit things you saw.

+1!

December 29, 2014

Bioclojure: a functional library for the manipulation of biological sequences

Filed under: Bioinformatics,Clojure,Functional Programming — Patrick Durusau @ 12:05 pm

Bioclojure: a functional library for the manipulation of biological sequences by Jordan Plieskatt, Gabriel Rinaldi, Paul J. Brindley, Xinying Jia, Jeremy Potriquet, Jeffrey Bethony, and Jason Mulvenna.

Abstract:

Motivation: BioClojure is an open-source library for the manipulation of biological sequence data written in the language Clojure. BioClojure aims to provide a functional framework for the processing of biological sequence data that provides simple mechanisms for concurrency and lazy evaluation of large datasets.

Results: BioClojure provides parsers and accessors for a range of biological sequence formats, including UniProtXML, Genbank XML, FASTA and FASTQ. In addition, it provides wrappers for key analysis programs, including BLAST, SignalP, TMHMM and InterProScan, and parsers for analyzing their output. All interfaces leverage Clojure’s functional style and emphasize laziness and composability, so that BioClojure, and user-defined, functions can be chained into simple pipelines that are thread-safe and seamlessly integrate lazy evaluation.

Availability and implementation: BioClojure is distributed under the Lesser GPL, and the source code is freely available from GitHub (https://github.com/s312569/clj-biosequence).

Contact: jason.mulvenna@qimberghofer.edu.au or jason.mulvenna@qimr.edu.au

The introduction to this article is a great cut-n-paste “case for Clojure in bioinformatics.”

Functional programming is a programming style that treats computation as the evaluation of mathematical functions (Hudak, 1989). In its purest form, functional programming removes the need for variable assignment by using immutable data structures that eliminate the use of state and side effects (Backus, 1978). This ensures that functions will always return the same value given the same input. This greatly simplifies debugging and testing, as individual functions can be assessed in isolation regardless of a global state. Immutability also greatly simplifies concurrency and facilitates leveraging of multi-core computing facilities with little or no modifications to functionally written code. Accordingly, as a programming style, functional programming offers advantages for software development, including (i) brevity, (ii) simple handling of concurrency and (iii) seamless integration of lazy evaluation, simplifying the handling of large datasets. Clojure is a Lisp variant that encourages a functional style of programming by providing immutable data structures, functions as first-class objects and uses recursive iteration as opposed to state-based looping (Hickey, 2008). Clojure is built on the Java virtual machine (JVM), and thus, applications developed using BioClojure can be compiled into Java byte code and ran on any platform that runs the JVM. Moreover, libraries constructed using Clojure can be called in Java programs and, conversely, Java classes and methods can be called from Clojure programs, making available a large number of third-party Java libraries. BioClojure aims to leverage the tools provided by Clojure to provide a functional interface with biological sequence data and associated programs. BioClojure is similar in intent to other bioinformatics packages such as BioPerl (Stajich et al., 2002), BioPython (Cock et al., 2009), Bio++ (Dutheil et al., 2006) and BioJava (Prlić et al., 2012) but differs from these bioinformatics software libraries in its embrace of the functional style. With the decreasing cost of biological analyses, for example, next-generation sequencing, biologists are dealing with greater amounts of data, and BioClojure is an attempt to provide tools, emphasizing concurrency and lazy evaluation, for manipulating these data.

I like the introduction as a form of evangelism but use of Clojure and Bioclojure in bioinformatics to demonstrate its advantages is the better form of promotion.

Evangelism works best when results are untestable, not so well when results can be counted and measured.

December 27, 2014

Software Foundations

Filed under: Coq,Functional Programming,Programming,Proof Theory,Software Engineering,Types — Patrick Durusau @ 4:49 pm

Software Foundations by Benjamin Pierce and others.

From the preface:

This electronic book is a course on Software Foundations, the mathematical underpinnings of reliable software. Topics include basic concepts of logic, computer-assisted theorem proving and the Coq proof assistant, functional programming, operational semantics, Hoare logic, and static type systems. The exposition is intended for a broad range of readers, from advanced undergraduates to PhD students and researchers. No specific background in logic or programming languages is assumed, though a degree of mathematical maturity will be helpful.

One novelty of the course is that it is one hundred per cent formalized and machine-checked: the entire text is literally a script for Coq. It is intended to be read alongside an interactive session with Coq. All the details in the text are fully formalized in Coq, and the exercises are designed to be worked using Coq.

The files are organized into a sequence of core chapters, covering about one semester’s worth of material and organized into a coherent linear narrative, plus a number of “appendices” covering additional topics. All the core chapters are suitable for both graduate and upper-level undergraduate students.

This looks like a real treat!

Imagine security in a world where buggy software (by error and design) wasn’t patched by more buggy software (by error and design) and protected by security software, which is also buggy (by error and design). Would that change the complexion of current security issues?

I first saw this in a tweet by onepaperperday.

PS: Sony got hacked, again. Rumor is that this latest Sony hack was an extra credit exercise for a 6th grade programming class.

December 23, 2014

Sam Aaron – Cognicast Episode 069

Filed under: Functional Programming,Music,Programming,Sound — Patrick Durusau @ 5:04 pm

067-sam-aaron

From the webpage:

In this episode, we talk to Sam Aaron, programmer, educator and musician.

Our Guest, Sam Aaron

Music

Sam is sharing original music he composed using Sonic Pi. To start the show, he chose “Time Machine”. To end the show, he chose “Goodbyes”.

Topics

Subscribing to The Cognicast

The show is available on iTunes! You can also subscribe to the podcast using our podcast feed.

A great perspective on getting people interested in coding, which should be transferable to topic maps. Yes?

Although, I must admit I almost raised my hand when Aaron asked “…who has had fun with sorting?” Well, some people have different interests. 😉

A very enjoyable podcast! I will have to look at prior episodes to see what else I have missed!

PS: What would it take to make the topic map equivalent of Sonic Pi? Taking note of Aaron’s comments on “friction.”

December 17, 2014

Learn Physics by Programming in Haskell

Filed under: Functional Programming,Haskell,Physics,Programming,Science — Patrick Durusau @ 7:55 pm

Learn Physics by Programming in Haskell by Scott N. Walck.

Abstract:

We describe a method for deepening a student’s understanding of basic physics by asking the student to express physical ideas in a functional programming language. The method is implemented in a second-year course in computational physics at Lebanon Valley College. We argue that the structure of Newtonian mechanics is clarified by its expression in a language (Haskell) that supports higher-order functions, types, and type classes. In electromagnetic theory, the type signatures of functions that calculate electric and magnetic fields clearly express the functional dependency on the charge and current distributions that produce the fields. Many of the ideas in basic physics are well-captured by a type or a function.

A nice combination of two subjects of academic importance!

Anyone working on the use of the NLTK to teach David Copperfield or Great Expectations? 😉

I first saw this in a tweet by José A. Alonso.

December 13, 2014

Scala eXchange 2014 (videos)

Filed under: Conferences,Functional Programming,Scala — Patrick Durusau @ 5:32 pm

Scala eXchange 2014 Videos are online! Thanks to the super cool folks at Skills Matter for making them available!

As usual, I have sorted the videos by author. I am not sure about using “scala” as a keyword at a Scala conference but suspect it was to permit searching in a database with videos from other conferences.

If you watch these with ear buds while others are watching sporting events, remember to keep the sound down enough that you can hear curses or cheers from others in the room. Mimic their sentiments and no one will be any wiser, except you for having watched these videos. 😉

PS: I could have used a web scraper to obtain the data but found manual extraction to be a good way to practice regexes in Emacs.

December 12, 2014

Clojure eXchange 2014

Filed under: Clojure,Functional Programming,Programming — Patrick Durusau @ 10:59 am

Clojure eXchange 2014 Videos.

The short version, sorted by author:

Resource management in clojure by Rob Ashton

Super Charging Cyanite by Tom Coupland

Pathogens & Parentheses: How we use Clojure in the molecular surveillance of infectious disease by Russell Dunphy

Journey through the looking glass by Chris Ford

Flow – learnings from writing a ClojureScript DSL by James Henderson

Tesser: Another Level of Indirection by Kyle Kingsbury

More Open-Source systems, please by Thomas Kristensen

Reactive GUI Implemented in Clojure by Denys Lebedev

Ephemeral-first data structures by Michal Marczyk

My Componentised Clojure Crusade by Adrian Mowat

BirdWatch / Building a System in Clojure by Matthias Nehlsen

Dragonmark: distributed core.async by David Pollak

Clojure in the service of Her Majesty’s Government by Philip Potter and Rachel Newstead

DataScript for web development by Nikita Prokopov

Herding cattle with Clojure at MixRadio by Neil Prosser

Trojan Horsing Clojure with Javascript by Robert Rees

Automation, Animation, Art and Dance by Nick Rothwell

Pragmatic Clojure Performance Testing by Korny Sietsma

The Future of Clojure by Bodil Stokke

Developing Clojure in the cloud by Martin Trojer

Just in case those marathon holiday movies start early this year. At least you can retreat to your computer or suitable mobile device.

Enjoy!

November 24, 2014

Clojure is still not for geniuses

Filed under: Clojure,Functional Programming,Programming — Patrick Durusau @ 4:32 pm

Clojure is still not for geniuses (You — yes, you, dummy — could be productive in Clojure today.) by Adam Bard.

From the post:

The inspiration for the article I wrote last week entitled Clojure is not for geniuses was inspired by Tommy Hall‘s talk at Euroclojure 2014, wherein he made an offhand joke about preferring Clojure for its minimal syntax, as he possesses a small brain (both his blog and his head suggest this assertion is false). I had intended to bring this up with the original article, but got sidetracked talking about immutable things and never got back around to it. Here I’d like to address that, along with some discussion that arose in various forums after the first article.

This article is not about how Clojure is great. I mean, it is, but I’d like to focus on the points that make it an accessible and practical language, without any faffing about with homoiconicity and macros and DSLs and all that.

Today’s all about illustrating some more ways in which I believe our good comrade Clojure can appeal to and empower the proletariat in ways that certain other languages can’t, through the power of simplicity.

This is a great post but I would like to add something to:

So why isn’t everyone using it?

That’s the big question. Clojure has grown immensely in popularity, but it’s still not a household name. There are a lot of reasons for that – mainstreamn languages have been around a lot longer, naturally, and obviously people are still producing software in them.

That’s not a big question. Think about the years people have invested in C, COBOL, Fortran, C++ and ask yourself: Do I prefer programming where I am comfortable or do I prefer something new and not familiar. Be honest now.

The other thing to consider is the ongoing investment in programs written in C/C++, COBOL, etc. Funders don’t find risk of transition all that attractive, even if a new language has “cool” features. They are interested in results, not how you got them.

The universe of programs needs to expand to create space for Clojure to gain marketshare. The demand for concurrency is a distinct possibility. The old software markets will remain glutted with C/C++, etc., for the foreseeable future. But that’s ok, older programmers need something to fall back on.

Pressing forward on Clojure’s strengths, such as simplicity and concurrency and producing results that other current languages can’t match is the best way to increase Clojure’s share of an expanding market. (Or to put it in the negative, who wants to worry about a non-concurrent and slowly dying market?)

November 22, 2014

Compojure Address Book

Filed under: Clojure,Functional Programming,PostgreSQL — Patrick Durusau @ 9:04 pm

Jarrod C. Taylor writes in part 1:

Introduction

Clojure is a great language that is continuing to improve itself and expand its user base year over year. The Clojure ecosystem has many great libraries focused on being highly composable. This composability allows developers to easily build impressive applications from seemingly simple parts. Once you have a solid understanding of how Clojure libraries fit together, integration between them can become very intuitive. However, if you have not reached this level of understanding, knowing how all of the parts fit together can be daunting. Fear not, this series will walk you through start to finish, building a tested compojure web app backed by a Postgres Database.

Where We Are Going

The project we will build and test over the course of this blog series is an address book application. We will build the app using ring and Compojure and persist the data in a Postgres Database. The app will be a traditional client server app with no JavaScript. Here is a teaser of the final product.

Not that I need another address book but as an exercise in onboarding, this rocks!

Compojure Address Book Part 1 by

(see above)

Compojure Address Book Part 2

Recap and Restructure

So far we have modified the default Compojure template to include a basic POST route and used Midje and Ring-Mock to write a test to confirm that it works. Before we get started with templates and creating our address book we should provide some additional structure to our application in an effort to keep things organized as the project grows.

Compojure Address Book Part 3

Introduction

In this installment of the address book series we are finally ready to start building the actual application. We have laid all of the ground work required to finally get to work.

Compojure Address Book Part 4

Persisting Data in Postgres

At this point we have an address book that will allow us to add new contacts. However, we are not persisting our new additions. It’s time to change that. You will need to have Postgres installed. If you are using a Mac, postgresapp is a very simple way of installing. If you are on another OS you will need to follow the install instructions from the Postgres website.

Once you have Postgres installed and running we are going to create a test user and two databases.

Compojure Address Book Part 5

The Finish Line

Our address book application has finally taken shape and we are in a position to put the finishing touches on it. All that remains is to allow the user the ability to edit and delete existing contacts.

One clever thing Jarrod has done is post all five (5) parts to this series on one day. You can go as fast or as slow as you choose to go.

Another clever thing is that testing is part of the development process.

How many programmers actually incorporate testing day to day? Given the prevalence of security bugs (to say nothing at all of other bugs), I would say less than one hundred percent (100%).

You?

How much less than 100% I won’t hazard a guess.

Clojure 1.3-1.6 Cheat Sheet (v13)

Filed under: Clojure,Functional Programming — Patrick Durusau @ 3:40 pm

Clojure 1.3-1.6 Cheat Sheet (v13)

The Clojure CheatSheet has been updated to Clojure 1.6.

Available in PDF, the cheatsheet for an entire language only runs two (2) pages. Some sources would stretch that to at least twenty (20) or more and make it far less useful.

Do you know of a legend to the colors used in the PDF? I can see that Documentation, Zippers, Macros, Loading and Other are all some shade of green but I’m not sure what binds them together? Pointers anyone?

November 21, 2014

Building an AirPair Dashboard Using Apache Spark and Clojure

Filed under: Clojure,Functional Programming,Spark — Patrick Durusau @ 8:19 pm

Building an AirPair Dashboard Using Apache Spark and Clojure by Sébastien Arnaud.

From the post:

Have you ever wondered how much you should charge per hour for your skills as an expert on AirPair.com? How many opportunities are available on this platform? Which skills are in high demand? My name is Sébastien Arnaud and I am going to introduce you to the basics of how to gather, refine and analyze publicly available data using Apache Spark with Clojure, while attempting to generate basic insights about the AirPair platform.

1.1 Objectives

Here are some of the basic questions we will be trying to answer through this tutorial:

  • What is the lowest and the highest hourly rate?
  • What is the average hourly rate?
  • What is the most sought out skill?
  • What is the skill that pays the most on average?

1.2 Chosen tools

In order to make this journey a lot more interesting, we are going to step out of the usual comfort zone of using a standard iPython notebook using pandas with matplotlib. Instead we are going to explore one of the hottest data technologies of the year: Apache Spark, along with one of the up and coming functional languages of the moment: Clojure.

As it turns out, these two technologies can work relatively well together thanks to Flambo, a library developed and maintained by YieldBot's engineers who have improved upon clj-spark (an earlier attempt from the Climate Corporation). Finally, in order to share the results, we will attempt to build a small dashboard using DucksBoard, which makes pushing data to a public dashboard easy.

In addition to illustrating the use of Apache Spark and Clojure, Sébastien also covers harvesting data from Twitter and processing it into a useful format.

Definitely worth some time over a weekend!

November 17, 2014

My Way Into Clojure: Building a Card Game with OM – Part 1

Filed under: Clojure,Functional Programming,Programming — Patrick Durusau @ 6:03 pm

My Way Into Clojure: Building a Card Game with OM – Part 1

From the introduction:

This two-part blog post tells the story of my venturing into Clojure. To get a better grasp of the language, I wanted to move beyond solving programming puzzles and build something tangible in the browser. Omingard is a Solitaire-like HTML5 card game built with Om, a ClojureScript interface to Facebook’s React.

In this first part, “My Way into Clojure”, I’ll provide some background on why I built Omingard and introduce the concepts behind Clojure. What’s so fascinating about functional programming in general, and Clojure in particular, and why was the appearance of Om a game changer for me?

In the upcoming second part, “Building a Card Game with Om”, we’ll look at how I built Omingard. What are the rules of the game, and what role do React, ClojureScript, Om, Leiningen, Garden, and Google Closure Tools play in its implementation? We’ll also take a detailed look at the concepts behind Om, and how it achieves even faster performance than React.

This is a very cool exercise in learning Clojure.

Do try the game. The version I know, has slightly different rules than the ones I observe here.

Functional and Reactive Domain Modeling

Functional and Reactive Domain Modeling by Debasish Ghosh.

From the post:

Manning has launched the MEAP of my upcoming book on Domain Modeling.

functional-reactive programming cover

The first time I was formally introduced to the topic was way back when I played around with Erik Evans’ awesome text on the subject of Domain Driven Design. In the book he discusses various object lifecycle patterns like the Factory, Aggregate or Repository that help separation of concerns when you are implementing the various interactions between the elements of the domain model. Entities are artifacts with identities, value objects are pure values while services model the coarse level use cases of the model components.

In Functional and Reactive Domain Modeling I look at the problem with a different lens. The primary focus of the book is to encourage building domain models using the principles of functional programming. It’s a completely orthogonal approach than OO and focuses on verbs first (as opposed to nouns first in OO), algebra first (as opposed to objects in OO), function composition first (as opposed to object composition in OO), lightweight objects as ADTs (instead of rich class models).

The book starts with the basics of functional programming principles and discusses the virtues of purity and the advantages of keeping side-effects decoupled from the core business logic. The book uses Scala as the programming language and does an extensive discussion on why the OO and functional features of Scala are a perfect fit for modelling complex domains. Chapter 3 starts the core subject of functional domain modeling with real world examples illustrating how we can make good use of patterns like smart constructors, monads and monoids in implementing your domain model. The main virtue that these patterns bring to your model is genericity – they help you extract generic algebra from domain specific logic into parametric functions which are far more reusable and less error prone. Chapter 4 focuses on advanced usages like typeclass based design and patterns like monad transformers, kleislis and other forms of compositional idioms of functional programming. One of the primary focus of the book is an emphasis on algebraic API design and to develop an appreciation towards ability to reason about your model.

An easy choice for your holiday wish list! Being a MEAP, it will continue to be “new” for quite some time.

Enjoy!

November 8, 2014

Transducers – java, js, python, ruby

Filed under: Clojure,Functional Programming,Java,Javascript,Python,Ruby — Patrick Durusau @ 10:59 am

Transducers – java, js, python, ruby

Struggling with transducers?

Learn better by example?

Cognitect Labs has released transducers for Java, JavaScript, Ruby, and Python.

Clojure recently added support for transducers – composable algorithmic transformations. These projects bring the benefits of transducers to other languages:

BTW, take a look at Rich Hickey’s latest (as of Nov. 2014) video on Transducers.

Please forward to language specific forums.

November 5, 2014

Category: The Essence of Composition

Filed under: Category Theory,Functional Programming — Patrick Durusau @ 3:57 pm

Category: The Essence of Composition by Bartosz Milewski.

From the post:

I was overwhelmed by the positive response to my previous post, the Preface to Category Theory for Programmers. At the same time, it scared the heck out of me because I realized what high expectations people were placing in me. I’m afraid that no matter what I’ll write, a lot of readers will be disappointed. Some readers would like the book to be more practical, others more abstract. Some hate C++ and would like all examples in Haskell, others hate Haskell and demand examples in Java. And I know that the pace of exposition will be too slow for some and too fast for others. This will not be the perfect book. It will be a compromise. All I can hope is that I’ll be able to share some of my aha! moments with my readers. Let’s start with the basics.

Bartosz’s post includes pigs, examples in C and Haskell, and ends with:

Challenges

  1. Implement, as best as you can, the identity function in your favorite language (or the second favorite, if your favorite language happens to be Haskell).
  2. Implement the composition function in your favorite language. It takes two functions as arguments and returns a function that is their composition.
  3. Write a program that tries to test that your composition function respects identity.
  4. Is the world-wide web a category in any sense? Are links morphisms?
  5. Is Facebook a category, with people as objects and friendships as morphisms?
  6. When is a directed graph a category?

My suggestion is that you follow Bartosz’s posts and after mastering them, try less well explained treatments of category theory.

Category Theory & Programming

Filed under: Category Theory,Functional Programming,Haskell — Patrick Durusau @ 3:42 pm

Category Theory & Programming by Yann Esposito. (slides)

Great slides on category theory with this quote on slide 6:

One of the goal of Category Theory is to create a homogeneous vocabulary between different disciplines.

Is the creation of a homogeneous vocabulary responsible for the complexity of category theory or is the proof of equivalence between different disciplines?

As you know, topic maps retains the vocabularies of different disciplines as opposed to replacing them with a homogeneous one. Nor do topic maps require proof of equivalence in the sense of category theory.

I first saw this in a tweet by Sam Ritchie.

Category Theory Applied to Functional Programming

Filed under: Category Theory,Functional Programming,Haskell,Programming — Patrick Durusau @ 2:20 pm

Category Theory Applied to Functional Programming by Juan Pedro Villa Isaza.

Abstract:

We study some of the applications of category theory to functional programming, particularly in the context of the Haskell functional programming language, and the Agda dependently typed functional programming language and proof assistant. More specifically, we describe and explain the concepts of category theory needed for conceptualizing and better understanding algebraic data types and folds, functors, monads, and parametrically polymorphic functions. With this purpose, we give a detailed account of categories, functors and endofunctors, natural transformations, monads and Kleisli triples, algebras and initial algebras over endofunctors, among others. In addition, we explore all of these concepts from the standpoints of categories and programming in Haskell, and, in some cases, Agda. In other words, we examine functional programming through category theory.

Impressive senior project along with Haskell source code.

I first saw this in a tweet by Computer Science.

« Newer PostsOlder Posts »

Powered by WordPress