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

July 27, 2014

Clojure Destructuring Tutorial….

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

Clojure Destructuring Tutorial and Cheat Sheet by John Louis Del Rosario.

From the post:

When I try to write or read some Clojure code, every now and then I get stuck on some destructuring forms. It’s like a broken record. One moment I’m in the zone, then this thing hits me and I have to stop what I’m doing to try and grok what I’m looking at.

So I decided I’d write a little tutorial/cheatsheet for Clojure destructuring, both as an attempt to really grok it (I absorb stuff more quickly if I write it down), and as future reference for myself and others.

Below is the whole thing, copied from the original gist. I’m planning on adding more (elaborate) examples and a section for compojure’s own destructuring forms. If you want to bookmark the cheat sheet, I recommend the gist since it has proper syntax highlighting and will be updated first.

John’s right, the gist version is easier to read.

As of 27 July 2014, the sections on “More Examples” and “Compojure” are blank if you feel like contributing.

I first saw this in a tweet by Daniel Higginbotham.

The Simplicity of Clojure

Filed under: Clojure,Functional Programming,Programming — Patrick Durusau @ 1:47 pm

The Simplicity of Clojure by Bridget Hillyer and Clinton N. Dreisbach. OSCON 2014.

A great overview of Clojure that covers:

  • Clojure Overview
  • Collections
  • Sequences
  • Modeling
  • Functions
  • Flow Control
  • Polymorphism
  • State
  • Coljure Libraries

Granted they are slides so you need to fill in with other sources of content, such as Clojure for the Brave and True, but they do provide an outline for learning more.

I first saw this in a tweet by Christophe Lalanne.

July 23, 2014

Improving RRB-Tree Performance through Transience

Filed under: Functional Programming,Parallel Programming — Patrick Durusau @ 6:49 pm

Improving RRB-Tree Performance through Transience by Jean Niklas L’orange.

Abstract:

The RRB-tree is a confluently persistent data structure based on the persistent vector, with efficient concatenation and slicing, and effectively constant time indexing, updates and iteration. Although efficient appends have been discussed, they have not been properly studied.

This thesis formally describes the persistent vector and the RRB-tree, and presents three optimisations for the RRB-tree which have been successfully used in the persistent vector. The differences between the implementations are discussed, and the performance is measured. To measure the performance, the C library librrb is implemented with the proposed optimisations.

Results shows that the optimisations improves the append performance of the RRB-tree considerably, and suggests that its performance is comparable to mutable array lists in certain situations.

Jean’s thesis is available at: http://hypirion.com/thesis.pdf

Although immutable data structures are obviously better suited for parallel programming, years of hacks on mutable data structures have set a high bar for performance. Unreasonably, parallel programmers want the same level of performance from immutable data structures as from their current mutable ones. 😉

Research such as Jean’s moves functional languages one step closer to being the default for parallel processing.

July 22, 2014

Why Functional Programming Matters

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

Why Functional Programming Matters by John Hughes.

Abstract:

As software becomes more and more complex, it is more and more important to structure it well. Well-structured software is easy to write and to debug, and provides a collection of modules that can be reused to reduce future programming costs. In this paper we show that two features of functional languages in particular, higher-order functions and lazy evaluation, can contribute significantly to modularity. As examples, we manipulate lists and trees, program several numerical algorithms, and implement the alpha-beta heuristic (an algorithm from Artificial Intelligence used in game-playing programs). We conclude that since modularity is the key to successful programming, functional programming offers important advantages for software development.

There’s a bottom line issue you can raise with your project leader or manager. “[R]educe future programming costs.” That it is also true isn’t the relevant point. Management isn’t capable of tracking programming costs well enough to know. It is the rhetoric of cheaper, faster, better that moves money down the management colon.

The same is very likely true for semantic integration tasks.

Many people have pointed out that topic maps can make the work that goes into semantic integration efforts re-usable. Which is true and would be a money saver to boot, but none of that really matters to management. Budgets and their share of a budget for a project are management motivators.

Perhaps the better way to sell the re-usable semantics of topic maps is to say the builders of integration systems can re-use the semantics of a topic map. Customers/users, on the other hand, just get the typical semantically opaque results. Just like now.

So the future cost for semantic integration experts to extend or refresh a current semantic integration solution goes down. The have re-usable semantics that they can re-apply to the customer’s situation. Either script it or even have interns do the heavy lifting. Which helps their bottom line.

Thinking about it that way, creating disclosed semantics for popular information resources would have the same impact. Something to think about.

I first saw this in a tweet by Computer Science.

July 20, 2014

Learn Haskell

Filed under: Functional Programming,Haskell,Programming — Patrick Durusau @ 4:12 pm

Learn Haskell by Chris Allen.

Chris has created a GitHub repository on his recommended path for learning Haskell.

Quite a list of resources but if he has missed anything, please file a pull request.

I first saw this in a tweet by Debasish Ghosh.

July 12, 2014

Grimoire

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

Grimoire

From the description in Clojure Weekly, July 9th, 2014:

Grimoire is a new documentation service and community contributed example repo similar to ClojureDocs.org. ClojureDocs.org still comes up high in google searches despite it is documenting Clojure 1.3, by providing examples that are not easy to find elsewhere. Grimoire is instead up to date and also gives access to all the examples in clojuredocs. Grimoire is open to community contribution over git pull requests and will likely be improved in the future to make contributions easier.

For more on Grimoire see: Of Mages and Grimoires.

Use, contribute and enjoy!

July 11, 2014

Oleg Kiselyov’s Homepage

Filed under: Functional Programming,Haskell,Programming,Scheme — Patrick Durusau @ 6:27 pm

Oleg Kiselyov’s Homepage

A very nearly plain text homepage that covers:

Algorithms and Data Structures Computation
Continuations Essays
Haskell Image Processing
Lambda-calculus Linguistics
Logic Meta-programming
ML Non-determinism
Numerical Math OS
Probabilistic Programming Programming Languages
Scheme Types
XML

Impressive!

Should be near the top of any seed list for searching on functional programming, Haskell, Scheme, etc.

Generic Zipper: the context of a traversal

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

Generic Zipper: the context of a traversal by Oleg Kiselyov.

From the webpage:

Zipper: a derivative of a data structure or of its mapping

Zipper is a functional cursor into a data structure. It lets us navigate to and change, without mutation, an item deeply buried in a tree or a nested record. The result is a new data structure, sharing much of its components with the old one. The latter remains available permitting the instant rollback of the changes. Zippers thus implement copy-on-write updates to data structures.

Zipper, the functional cursor into a data structure, is itself a data structure, derived from the original one. The derived data type D’ for the recursive data type D is D with exactly one hole. Filling-in the hole — integrating over all positions of the hole — gives the data type D back. Zipper is the derivative, pretty much in the calculus sense, of a data type. The zipper-as-datatype view was the original presentation, described by Huet (JFP, 1997) and Hinze and Jeuring (JFP 2001); the data structure derivative was expounded by McBride.

We advocate a different view, emphasizing not the result of navigating through a data structure to a desired item and extracting it, but the process of navigation. Each data structure comes with a method to enumerate its components, representing the data structure as a stream of the nodes visited during the enumeration. To let the user focus on a item and submit an update, the enumeration process should yield control to the user once it reached an item. Co-routines provide exactly the right yielding mechanism. As Chung-chieh Shan aptly put it, “zipper is a suspended walk.’

A page of short abstracts (part of the first one I quote above) followed by references and often code on zippers.

My Top Clojure Articles

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

My Top Clojure Articles by Adam Bard.

From the post:

For the past few years, most of my posts have been beginner-intermediate essays on various clojure features and coding techniques. Since a lot of people have told me that they like my blog as a genre piece, I decided to pull some of my favorites into one place, and order them by difficulty, from Clojure beginner on up so that folks don’t have to root around.

I really hope to see Clojure become a widely-used general-purpose language, because, although much has been made of its general elegance and its propensity to be written by extremely clever people, I think it has a lot to offer mediocre programmers (like yours truly) with its practical feature-set, strong encouragement of good practices (immutability, pure functions) and useful tools like Leiningen and the excellent lisp REPL.

With that in mind, and because I’m really not past the intermediate level yet, I try to write articles targeted at people who are new to Clojure. And now I have enough such articles that I think it’s worthwhile to assemble them in once place. I’ll try to keep them up to date as I write more in the future.

Just a few of the titles to tempt you into reading the full post:

Clojure in 15 minutes

Five Mistakes Clojure Newbies Make

Acceptable Error Handling in Clojure

There are more where those came from!

Enjoy!

July 7, 2014

An Advanced Clojure Workflow

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

An Advanced Clojure Workflow

From the post:

This is my workflow. There are many like it, but this one is mine.” –Anon.

This is the first in a sequence of posts about my current workflow for developing in Clojure. I call this workflow “advanced” because it takes time to learn the various tools involved, but also because it allows me to tackle harder problems than I otherwise could.

The basic ingredients of this workflow are:

  • Lisp-related editor enhancements, including parenthesis magic, and, especially, in-editor REPL integration.
  • Continuous testing with instant display of results
  • Notebook-style semi-literate programming with continuous updating of documentation, display of math symbols, and in-page plots.

My setup has evolved over time and I expect it will be different by the time most people read this. I have found, though, that the right combination of tools allows me not only to manipulate Clojure code and see results quickly, but also to think more clearly about the problem at hand. In my experience, this leads to simpler, more elegant, more maintainable code.

These tools and techniques provide a sort of “sweet-spot” – they help me be productive in the language, and I find them fun to use together. Your mileage may vary – I have seen people be productive with vastly different workflows and toolsets.

In the first post in this series (Emacs Customization for Clojure) we learn:

I have been using Emacs since the 1990s, though I still consider myself a novice (Emacs is that way). Though good alternatives exist, over half of the Clojure community has adopted Emacs despite its lack of polish and its Himalayan learning curve. Emacs is massively customizable, with hundreds of plugins available, and can be extended to just about any degree using its own flavor of Lisp.

Could over half of the Clojure community be wrong?

It’s possible, but highly unlikely. 😉

I first saw this in a tweet by Christophe Lalanne.

July 6, 2014

SICP Distilled

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

SICP Distilled

From the webpage:

An idiosyncratic tour of the best of SICP in Clojure.

Have you always wanted to read SICP but either didn’t start or gave up mid-way?

Take a few days to experience a distillation of its most important lessons.

Followed by a sign-up form.

Don’t know any more than that but it is an interesting concept.

If and when I get more details, I will post that information.

July 1, 2014

(Functional) Reactive Programming (FRP) [tutorial]

The introduction to Reactive Programming you’ve been missing by Andre Staltz.

From the post:

So you’re curious in learning this new thing called (Functional) Reactive Programming (FRP).

Learning it is hard, even harder by the lack of good material. When I started, I tried looking for tutorials. I found only a handful of practical guides, but they just scratched the surface and never tackled the challenge of building the whole architecture around it. Library documentations often don’t help when you’re trying to understand some function. I mean, honestly, look at this:

Rx.Observable.prototype.flatMapLatest(selector, [thisArg])

Projects each element of an observable sequence into a new sequence of observable sequences by incorporating the element’s index and then transforms an observable sequence of observable sequences into an observable sequence producing values only from the most recent observable sequence.

Holy cow.

I’ve read two books, one just painted the big picture, while the other dived into how to use the FRP library. I ended up learning Reactive Programming the hard way: figuring it out while building with it. At my work in Futurice I got to use it in a real project, and had the support of some colleagues when I ran into troubles.

The hardest part of the learning journey is thinking in FRP. It’s a lot about letting go of old imperative and stateful habits of typical programming, and forcing your brain to work in a different paradigm. I haven’t found any guide on the internet in this aspect, and I think the world deserves a practical tutorial on how to think in FRP, so that you can get started. Library documentation can light your way after that. I hope this helps you.

Andre is moving in the right direction when he announces:

FRP is programming with asynchronous data streams.

Data streams. I have been hearing that a lot lately. 😉

The view that data is static, file based, etc., was an artifact of our storage and processing technology. Not that data “streams” is a truer view of data but it is a different one.

The semantic/subject identity issues associated with data don’t change whether you have a static or stream view of data.

Although, with data streams, the processing requirements for subject identity become different. For example, with static data a change (read merger) can propagate throughout a topic map.

With data streams, there may be no retrospective application of a new merging rule, it may only impact data streams going forward. Your view of the topic map becomes a time-based snapshot of the current state of a merged data stream.

If you are looking for ways to explore such issues, FRP and this tutorial are a good place to start.

June 21, 2014

Structure and Interpretation of Computer Programs (SICP)

Filed under: Functional Programming,Scheme — Patrick Durusau @ 7:04 pm

Structure and Interpretation of Computer Programs (SICP) by Abelson & Sussman.

Already available from MIT Press for free, SICP is available here with newly typeset mathematics and figures.

You will find Kindle versions as well.

A truly remarkable addition to e-texts in computer science would be TAOCP. Somehow I don’t think that is going to happen anytime soon.

I first saw this in a tweet by thattommyhall.

June 15, 2014

Applicative Parser [Clojure]

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

Applicative Parser by Jim Duey.

In the next couple of posts, I’m going to show how to build a parser library based on the Free Applicative Functor and what you can do with it. To follow along, clone (or update) this repo. Then ‘lein repl’ and you should be able to copy the code to see what it does.

This post runs long (again). The code is really not that long and it’s mostly very small functions. But the amount of details hidden by the abstractions takes a lot of prose to explain. Which is actually one of the very real benefits of using these abstractions. They let you implement an enormous amount of functionality in very few lines of code with fewer bugs.

If you want to see what the point of all this prose is, skip to the “Other Interpretations” section at the bottom and then come back to see how it was done.

Warning: Heavy sledding!

You may want to start with: The basics of applicative functors, put to practical work [Haskell] by Bryan O’Sullivan, which parses “[an] application/x-www-form-urlencoded string.”

On the other hand, if you want the full explanation, consider Applicative Programming with Effects by Conor McBride and Ross Paterson. in Journal of Functional Programming 18:1 (2008), pages 1-13.

Abstract:

In this paper, we introduce Applicative functors–an abstract characterisation of an applicative style of effectful programming, weaker than Monads and hence more widespread. Indeed, it is the ubiquity of this programming pattern that drew us to the abstraction. We retrace our steps in this paper, introducing the applicative pattern by diverse examples, then abstracting it to define the Applicative type class and introducing a bracket notation which interprets the normal application syntax in the idiom of an Applicative functor. Further, we develop the properties of applicative functors and the generic operations they support. We close by identifying the categorical structure of applicative functors and examining their relationship both with Monads and with Arrows.

The page for McBride and Patterson’s paper points to later resources as well.

Enjoy!

June 7, 2014

Enhanced Clojure Cheatsheet

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

Enhanced Clojure Cheatsheet

Clojure Weekly, June 3rd, 2014 reports:

An enhanced version of the official clojure.org/cheatsheet with added popup tooltip and search box! The cheatsheet is quite useful to have a glance of the standard library functions grouped by functionality type. With this one you just hover over a function to see the docs and typing in the search box will filter down the list. Thanks Andy Fingerhut for posting this in the group list.

I like the pop-ups but wish they contained embedded links.

Enjoy!

June 4, 2014

Introduction to Functional Programming

Filed under: Functional Programming,Haskell — Patrick Durusau @ 4:21 pm

Introduction to Functional Programming

October 2014 8 weeks

From the description:

Broadly speaking, functional programming is a style of programming in which the primary method of computation is the application of functions to arguments. Among other features, functional languages offer a compact notation for writing programs, powerful abstraction methods for structuring programs, and a simple mathematical basis that supports reasoning about programs.

Functional languages represent the leading edge of programming language design, and the primary setting in which new programming concepts are introduced and studied. All contemporary programming languages such as Hack/PHP, C#, Visual Basic, F#, C++, JavaScript, Python, Ruby, Java, Scala, Clojure, Groovy, Racket, … support higher-order programming via the concept of closures or lambda expressions.

This course will use Haskell as the medium for understanding the basic principles of functional programming. While the specific language isn’t all that important, Haskell is a pure functional language so it is entirely appropriate for learning the essential ingredients of programming using mathematical functions. It is also a relatively small language, and hence it should be easy for you to get up to speed with Haskell.

Once you understand the Why, What and How that underlies pure functional programming and learned to “think like a fundamentalist”, we will apply the concepts of functional programming to “code like a hacker” in mainstream programming languages, using Facebook’s novel Hack language as our main example.

This course assumes no prior knowledge of functional programming, but assumes you have at least one year of programming experience in a regular programming language such as Java, .NET, Javascript or PHP.

Or, I could have just said:

Erik Meijer is teaching this course. Enough said. 😉

June 2, 2014

Light Table 0.6.6

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

Light Table 0.6.6 by Chris Granger.

From the post:

Happy to announce a new, and fairly big, release of Light Table today! The highlight of this release comes from moving LT to CodeMirror 4, which gives us multiple cursors, tons of performance improvements, and a few other little editing niceties. Here's a list of the new multiple cursors commands:

  • Editor: Set selection to top most cursor
  • Editor: Clear multiple cursors
  • Editor: Insert line after
  • Editor: Insert line before
  • Editor: Select next occurrence of word
  • Editor: Select between brackets
  • Editor: Select scope
  • Editor: Go to bracket
  • Editor: Swap line up
  • Editor: Swap line down
  • Editor: Join lines
  • Editor: Duplicate line
  • Editor: Sort lines
  • Editor: Sort lines insensitive
  • Editor: Select lines upward with multiple cursors
  • Editor: Select lines downward with multiple cursors
  • Editor: Split selection into cursors per line

If you aren’t already wedded to an editor or IDE, now would be a good time to take a look at Light Table.

May 30, 2014

Functional Geekery

Filed under: Clojure,Erlang,Functional Programming,Scala — Patrick Durusau @ 4:26 pm

Functional Geekery by Steve Proctor.

I stumbled across episode 9 of Functional Geekery (a podcast) in Clojure Weekly, May 29th, 2014 and was interested to hear the earlier podcasts.

It’s only nine other episodes and not a deep blog history but still, I thought it would be nice to have a single listing of all the episodes.

Do be aware that each episode has a rich set of links to materials mentioned/discussed in each podcast.

If you enjoy these podcasts, do be sure to encourage others to listen to them and encourage Steve to continue with his excellent work.

  • Episode 1 – Robert C. Martin

    In this episode I talk with Robert C. Martin, better known as Uncle Bob. We run the gamut from Structure and Interpretation of Computer Programs, introducing children to programming, TDD and the REPL, compatibility of Functional Programming and Object Oriented Programming

  • Episode 2 – Craig Andera

    In this episode I talk with fellow podcaster Craig Andera. We talk about working in Clojure, ClojureScript and Datomic, as well as making the transition to functional programming from C#, and working in Clojure on Windows. I also get him to give some recommendations on things he learned from guests on his podcast, The Cognicast.

  • Episode 3 – Fogus

    In this episode I talk with Fogus, author of The Joy of Clojure and Functional JavaScript. We cover his history with functional languages, working with JavaScript in a functional style, and digging into the history of software development.

  • Episode 4 – Zach Kessin

    In this episode I talk with fellow podcaster Zach Kessin. We cover his background in software development and podcasting, the background of Erlang, process recovery, testing tools, as well as profiling live running systems in Erlang.

  • Episode 5 – Colin Jones

    In this episode I talk with Colin Jones, software craftsman at 8th Light. We cover Colin’s work on the Clojure Koans, making the transition from Ruby to Clojure, how functional programming affects the way he does object oriented design now, and his venture into learning Haskell.

  • Episode 6 – Reid Draper

    In this episode I talk with Reid Draper. We cover Reid’s intro to functional programming through Haskell, working in Erlang, distributed systems, and property testing; including his property testing tool simple-check, which has since made it into a Clojure contrib project as test.check.

  • Episode 7 – Angela Harms and Jason Felice on avi

    In this episode I talk with Angela Harms and Jason Felice about avi. We talk about the motivation of a vi implementation written in Clojure, the road map of where avi might used, and expressivity of code.

  • Functional Geekery Episode 08 – Jessica Kerr

    In this episode I talk with Jessica Kerr. In this episode we talk bringing functional programming concepts to object oriented languages; her experience in Scala, using the actor model, and property testing; and much more!

  • Functional Geekery Episode 9 – William E. Byrd

    In this episode I talk with William Byrd. We talk about miniKanren and the differences between functional, logic and relational programming. We also cover the idea of thinking at higher levels of abstractions, and comparisons of relational programming to topics such as SQL, property testing, and code contracts.

  • Functional Geekery Episode 10 – Paul Holser

    In this episode I talk with Paul Holser. We start out by talking about his junit-quickcheck project, being a life long learner and exploring ideas about computation from other languages, and what Java 8 is looking like in with the support of closures and lambdas.

Enjoy!

May 29, 2014

Emacs Settings for Clojure

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

My Optimal GNU Emacs Settings for Developing Clojure (so far) by Frédérick Giasson.

From the post:

In the coming months, I will start to publish a series of blog posts that will explain how RDF data can be serialized in Clojure code and more importantly what are the benefits of doing this. At Structured Dynamics, we started to invest resources into this research project and we believe that it will become a game changer regarding how people will consume, use and produce RDF data.

But I want to take a humble first step into this journey just by explaining how I ended up configuring Emacs for working with Clojure. I want to take the time to do this since this is a trials and errors process, and that it may be somewhat time-consuming for the new comers.

In an interesting twist for an article on Emacs, Frédérick recommends strongly that the reader consider Light Table as an IDE for Clojure over Emacs, especially if they are not already Emacs users.

What follows is a detailed description of changes for your .emacs file should you want to follow the Emacs route, including a LightTable theme for Emacs.

A very useful post and I am looking forward the the Clojure/RDF post to follow.

May 28, 2014

Functional programming with Clojure

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

Functional programming with Clojure

A MOOC being lead by: Juhana Laurinharju, Jani Rahkola, and Ilmari Vacklin.

From the homepage:

Functional programming is a programming paradigm where pure functions are the basic building blocks of programs. A pure function is like a function in the mathematical sense. The outputs of the function are fully determined by its inputs. The idea is that this restriction makes your programs easier to understand. This course shows how you can code meaningful programs with mainly pure functions. Pure functional programming differs from object-oriented programming in that e.g. it does not make use of variables or loops.

The course is an introduction to functional programming with a dynamically typed language Clojure. We start with an introduction to Clojure; its syntax and development environment. Clojure has a good selection of data structures and we cover most of them. We also go through the basics of recursion and higher-order functions. The course material is in English.

Clojure is a young Lispish functional programming language on the Java virtual machine (JVM) platform, suitable for small and large programs. Because it runs on the JVM, all Clojure programs can use all the standard and third-party Java libraries freely. It offers tools for many tasks that are harder with other languages and has a special focus on concurrent programming.

The only registration is a GitHub account.

Now that’s a friendly registration process!

Enjoy!

I first saw this in Christophe Lalanne’s A bag of tweets / May 2014.

May 27, 2014

Data as Code. Code as Data:…

Filed under: Clojure,Data,Functional Programming,Semantic Web — Patrick Durusau @ 7:06 pm

Data as Code. Code as Data: Tighther Semantic Web Development Using Clojure by Frédérick Giasson.

From the post:

I have been professionally working in the field of the Semantic Web for more than 7 years now. I have been developing all kind of Ontologies. I have been integrating all kind of datasets from various sources. I have been working with all kind of tools and technologies using all kind of technologies stacks. I have been developing services and user interfaces of all kinds. I have been developing a set of 27 web services packaged as the Open Semantic Framework and re-implemented the core Drupal modules to work with RDF data has I wanted it to. I did write hundred of thousands of line of codes with one goal in mind: leveraging the ideas and concepts of the Semantic Web to make me, other developers, ontologists and data-scientists working more accurately and efficiently with any kind data.

However, even after doing all that, I was still feeling a void: a disconnection between how I was think about data and how I was manipulating it using the programming languages I was using, the libraries I was leveraging and the web services that I was developing. Everything is working, and is working really well; I did gain a lot of productivity in all these years. However, I was still feeling that void, that disconnection between the data and the programming language.

Frédérick promises to walk us through serializing RDF data into Clojure code.

Doesn’t that sound interesting?

Hmmm, will we find that data has semantics? And subjects that the data represents?

Can’t say, don’t know. But I am very interested in finding out how far Frédérick will go with “Data as Code. Code as Data.”

May 25, 2014

Verified Networking using Dependent Types

Filed under: Dependency,Functional Programming,Programming,Types — Patrick Durusau @ 4:30 pm

Verified Networking using Dependent Types by Simon Fowler.

Abstract:

Strongly, statically typed functional programming languages have found a strong grounding in academia and industry for a variety of reasons: they are concise, their type systems provide additional static correctness guarantees, and the structured management of side effects aids easier reasoning about the operation of programs, to name but a few.

Dependently-typed languages take these concepts a step further: by allowing types to be predicated on values, it is possible to impose arbitrarily specific type constraints on functions, resulting in increased confidence about their runtime behaviour.

This work demonstrates how dependent types may be used to increase confidence in network applications. We show how dependent types may be used to enforce resource usage protocols inherent in C socket programming, providing safety guarantees, and examine how a dependently- typed embedded domain-specific language may be used to enforce the conformance of packets to a given structure. These concepts are explored using two larger case studies: packets within the Domain Name System (DNS) and a networked game.

The use of statically typed functional programming languages is spreading. Fowler’s dissertation is yet another illustration of that fact.

When you read:

…examine how a dependently- typed embedded domain-specific language may be used to enforce the conformance of packets to a given structure.

Do you also hear:

…examine how a dependently- typed embedded domain-specific language may be used to enforce the conformance of proxies to a given structure.

??

Real Time Robot Dance Party

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

From the description:

From the 2014 Solid Conference: In this day and age, we usually consider robots to be utilitarian, problem solvers. But there is another use for robots, that is for artistic expression.

In this fun, energetic talk, we will explore controlling multiple robots in real time. Roombas sway to gentle computer generated music, while Sphero balls roll with flashing lights. This robot jam will culminate in spectacular finale when the AR Drones fly in to join the dance.

Using Emacs, Overture, Clojure, a live robot dance by Carin Meier and Peter Shanley.

A very impressive demonstration but of what I am not exactly sure. Which is of course, a perfect demonstration!

Enjoy!

I first saw this in a tweet by Michael Klishin

May 24, 2014

Morph

Filed under: Clojure,Functional Programming,Haskell,Monads — Patrick Durusau @ 4:40 pm

Morph – A Library of Morphisms: Monoids, Functors, and Monads by Armando Blancas.

From the webpage:

Morph

Morph is a library of Haskell-style morphisms: monoids, functors, and monads. These constructs are helpful for designing programs that are purely functional and that encapsulate the boilerplate employed by many programming techniques.

Features

  • Implementation based on protocols and data types.
  • Predefined monoids and functors; with support for Clojure collections.
  • Monads: Identity, Maybe, Either, Reader, Writer, State, Imperative.
  • Monad Transformers: MaybeT, EitherT, ReaderT, WriterT, StateT.
  • Support for curried functions.
  • Library of generic functions for the above constructs.
  • Sample code in src/main/resources.

These constructs have a reputation of being hard to explain and even harder to understand and to apply in everyday programming. I’ve made every effort to present them as regular techniques and idioms with practical benefits. Behind their strange or fancy names, these are just functions that work on data types.

An intuition of their behavior is all that’s needed to take advantage of these functions; you may never need or want to write your own. I’m pleased with the power and simplicity these techniques have to offer and I hope you may find them useful as well.

Lowering the learning curve for using functional programming languages? Is that a bit like being able to use a compiler but not write one? Whatever drives adoption is a good thing.

May 23, 2014

Scala eXchange 2013 (screencasts)

Filed under: Functional Programming,Scala — Patrick Durusau @ 7:29 pm

Scala eXchange 2013

From the webpage:

Join us at the third Annual Scala eXchange 2013 for 2 days of learning Scala skills! Meet the amazing Bill Venners and gain an understanding of the trade-offs between implicit conversions and parameters and how to take advantage of implicit parameters in your own designs. Or join Viktor Klang’s talk to learn strategies for the recovery and healing of your systems, when things go FUBAR. Find out about Lift from David Pollak, or find out about Adept, the new dependency management system for Scala in Fredrik Ekholdt’s talk. Find out about the road to Akka Cluster, and beyond in Jonas Boner’s keynote or about the new design of theMacro-based Scala Parallel Collections with Alex Prokopec! Featuring 2 days of talks over 3 tracks, The Scala eXchange will bring the world’s top Scala experts and many of the creators of Scala stack technologies together with Europe’s Scala community to learn and share skills, exchange ideas and meet like minded people. Don’t miss it!

There are forty-eight (48) screencasts from Scala eXchange 2013 posted for your viewing pleasure.

I can’t think of a better selling point for Scala eXchange 2014 than the screencasts from 2013.

May 21, 2014

Getting functional with Erlang

Filed under: Erlang,Functional Programming — Patrick Durusau @ 6:56 pm

Getting functional with Erlang by Mark Nijhof.

From the webpage:

This book will get you started writing Erlang applications right from the get go. After some initial chapters introducing the language syntax and basic language features we will dive straight into building Erlang applications. While writing actual code you will discover and learn more about the different Erlang and OTP features. Each application we create is geared towards a different use-case, exposing the different mechanics of Erlang. 

I want this to become the book I would have read myself, simple and to the point. Something to help you get functional with Erlang quickly. I imagine you; with one hand holding your e-reader while typing code with the other hand.

I have made a broad assumption: Because only smart people would want to learn Erlang (that is you), that you are then also smart enough to find your way to all the language specifics when needed. So this book is not meant as a complete reference guide for Erlang. But it will teach you enough to give you a running start.

When you have reached the end of this book you will be able to build a full blown Erlang application and release it into production. You will understand the core Erlang features like; pattern matching, message passing, working with processes, and hot code swapping.

I haven’t bought a copy, but that is a reflection on my book budget and not Mark’s book.

Take a look and pass this along to others. Mark is using a publishing model that merits encouragement.

May 13, 2014

Functional Pearl:…

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

Functional Pearl: Kleisli arrows of outrageous fortune by Conor McBride.

Abstract:

When we program to interact with a turbulent world, we are to some extent at its mercy. To achieve safety, we must ensure that programs act in accordance with what is known about the state of the world, as determined dynamically. Is there any hope to enforce safety policies for dynamic interaction by static typing? This paper answers with a cautious ‘yes’.

Monads provide a type discipline for effectful programming, mapping value types to computation types. If we index our types by data approximating the ‘state of the world’, we refine our values to witnesses for some condition of the world. Ordinary monads for indexed types give a discipline for effectful programming contingent on state, modelling the whims of fortune in way that Atkey’s indexed monads for ordinary types do not (Atkey, 2009). Arrows in the corresponding Kleisli category represent computations which a reach a given postcondition from a given precondition: their types are just specifications in a Hoare logic!

By way of an elementary introduction to this approach, I present the example of a monad for interacting with a file handle which is either ‘open’ or ‘closed’, constructed from a command interface
specfied Hoare-style. An attempt to open a file results in a state which is statically unpredictable but dynamically detectable. Well typed programs behave accordingly in either case. Haskell’s dependent type system, as exposed by the Strathclyde Haskell Enhancement preprocessor, provides a suitable basis for this simple experiment.

Even without a weakness for posts/articles/books about category theory, invoking the Bard is enough to merit a pointer.

Rest easy, the author does not attempt to render any of the sonnets using category theory notation.

I first saw this in a tweet by Computer Science.

May 9, 2014

Tips for Clojure Beginners

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

Tips for Clojure Beginners by Ben Orenstein.

Ben has seven (7) practical tips for learning Clojure.

No one knows if Clojure will be the breakthrough functional programming language but when you realize that mutable data structures are artifacts of limited storage, any functional programming experience is going to be worthwhile.

Clojure’s Persistent Data Structures

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

Clojure’s Persistent Data Structures by Craig Andera.

From the description:

A typical experience with Clojure is, “Come for the concurrency, stay for the data structures.” Clojure’s data structures are persistent, immutable, and performant. In this talk, we’ll discuss what they give you, how they work, and what you can do with them.

Craig Andera is a developer at Cognitect, where he builds large-scale web-based systems, primarily in Clojure. He is also the host of The Cognicast, Cognitect’s podcast. Craig can be found on Twitter @craigandera. The Cognicast is available at http://cognitect.com/podcast.

Best watched before this coming Sunday (Mother’s Day).

I first saw this at: Recommended Viewing : Clojure’s Persistent Data Structures by Charles Ditzel.

May 8, 2014

Functional Programming in the Cloud:…

Filed under: Cloud Computing,Functional Programming,Haskell,OpenShift,Red Hat — Patrick Durusau @ 1:07 pm

Functional Programming in the Cloud: How to Run Haskell on OpenShift by Katie Miller.

From the post:

One of the benefits of Platform as a Service (PaaS) is that it makes it trivial to try out alternative technology stacks. The OpenShift PaaS is a polyglot platform at the heart of a thriving open-source community, the contributions of which make it easy to experiment with applications written in a host of different programming languages. This includes the purely functional Haskell language.

Although it is not one of the Red Hat-supported languages for OpenShift, Haskell web applications run on the platform with the aid of the community-created Haskell cartridge project. This is great news for functional programming (FP) enthusiasts such as myself and those who want to learn more about the paradigm; Haskell is a popular choice for learning FP principles. In this blog post, I will discuss how to create a Haskell web application on OpenShift.

Prerequisites

If you do not have an OpenShift account yet, sign up for OpenShift Online for free. You’ll receive three gears (containers) in which to run applications. At the time of writing, each of these free gears come with 512MB of RAM and 1GB of disk space.

To help you communicate with the OpenShift platform, you should install the RHC client tools on your machine. There are instructions on how to do that for a variety of operating systems at the OpenShift Dev Center. Once the RHC tools are installed, run the command rhc setup on the command line to configure RHC ready for use.

Katie’s post is a great way to get started with OpenShift!

However, it also reminds me of why I dislike Daylight Savings Time. It is getting dark later in the Eastern United States but there are still only twenty-four (24) hours in a day! An extra eight (8) hours a day and the stamina to stay awake for them would be better. 😉

Unlikely to happen so enjoy Katie’s post during the usual twenty-four (24) hour day.

« Newer PostsOlder Posts »

Powered by WordPress