Friday, 22 September 2017

Struct tuples

The F# Journal just published an article:
"Almost 10 years ago our own HLVM project demonstrated the potential of struct tuples, showcasing huge performance improvements mainly by alleviating stress on the garbage collector. The latest version of F# in Visual Studio 2017 introduces a new feature called struct tuples that allows tuples to be unboxed. This article takes a look at the characteristics of struct tuples in all of the contexts where one might expect observable differences: generic functions, keys in dictionaries, generation survivors, write barriers and multicore paralellism..."
If you subscribe to the F# Journal then can read this article here otherwise subscribe to the The F# Journal today to read this article and many more!

Thursday, 21 September 2017

Automating a human compiler: part 2

The F# Journal just published an article:
"This series of articles describe our most successful F# project to date. Years later, the solution we implemented in F# still has billions of dollars worth of trade going through it every year and continues to save our client around a million dollars per month. This article describes the first stage of our project: the rapid development of a demo version of our graphical domain-specific language, a business rules engine..."
If you subscribe to the F# Journal then can read this article here otherwise subscribe to the The F# Journal today to read this article and many more!

Wednesday, 20 September 2017

Automating a human compiler: part 1

The F# Journal just published an article:
"This series of articles describe our most successful F# project to date. Years later, the solution we implemented in F# still has billions of dollars worth of trade going through it every year and continues to save our client around a million dollars per month. This article provides an overview of the problem we found and the characteristics of our solution that made it so successful..."
If you subscribe to the F# Journal then can read this article here otherwise subscribe to the The F# Journal today to read this article and many more!

Thursday, 18 May 2017

Random access lists

The F# Journal just published an article:

"Ordinary F# lists are singly-linked immutable lists that permit constant-time prepend and decapitate but counting the length and random access are linear time. This article looks at an alternative data structure, a form of random access list, that is based upon a tree rather than a list in order to provide logarithmic complexity for many operations..."

If you subscribe to the F# Journal then can read this article here otherwise subscribe to the The F# Journal today to read this article and many more!

Monday, 1 May 2017

F# vs OCaml performance: the Boyer benchmark

The F# Journal just published an article:

"The OCaml compiler contains a benchmark suite that includes several different heavily-symbolic benchmarks. Symbolic programs are the one use case that OCaml was designed for and has been optimised at for over two decades. This article ports OCaml's Boyer benchmark to F#, looks at optimisations and concludes that the parallelized F# solution is 3x faster than the original OCaml..."

If you subscribe to the F# Journal then can read this article here otherwise subscribe to the The F# Journal today to read this article and many more!

Thursday, 30 March 2017

Balanced search trees: weight-balanced trees

The F# Journal just published an article:

"This article continues our series about balanced search trees by covering weight balanced trees. This data structure can be remarkably simple and performance is good enough for many applications, making it an ideal pedagogical example that can be used to teach general tree-based techniques. Furthermore, this data structure allows some operations to be implemented asymptotically more efficiently than most other search trees including the AVL trees used inside the F# `Set` and `Map` modules..."

If you subscribe to the F# Journal then can read this article here otherwise subscribe to the The F# Journal today to read this article and many more!

Monday, 27 March 2017

Balanced search trees: AA trees

The F# Journal just published an article:

"This is the second article in a series about balanced search trees. This article takes a look at a purely functional implementation of the AA tree data structure as described by Arne Andersson in the paper "Balanced Search Trees Made Simple". In particular, the brevity of our implementation is compared to that of the full red-black tree detailed in the previous article. In this case we test not only the externally-visible effects of the collection but also its invariants..."

If you subscribe to the F# Journal then can read this article here otherwise subscribe to the The F# Journal today to read this article and many more!

Friday, 24 March 2017

Balanced search trees: red-black trees

The F# Journal just published an article:

"This is the first article in a series about balanced search trees. There are many different kinds of balanced trees. This article takes a look at a very popular data structure called red-black trees. In particular, we go further than many other texts on purely functional red-black trees by including a delete operation that removes an element from a tree..."

If you subscribe to the F# Journal then can read this article here otherwise subscribe to the The F# Journal today to read this article and many more!

Wednesday, 15 March 2017

Playing with polynomials: part 1

The F# Journal just published an article:

"This series of articles look at the design and implementation of a simple library that allows polynomials to be represented and manipulated using arithmetic operators. Various internal representations are examined including their performance. Interestingly, impure internal representations prove to have competitive performance even though they do not support incremental operations. The implications of this observation for purely functional data structures are discussed..."

If you subscribe to the F# Journal then can read this article here otherwise subscribe to the The F# Journal today to read this article and many more!

Wednesday, 8 March 2017

Investigating GC pause times

The F# Journal just published an article:

"Garbage collection pauses can be irritating and in some cases even a show-stopping problem. This article uses a little F# script to measure the pause times caused by the .NET GC and then visualize them using our F# for Visualization library. This allows the profile to be examined interactively quickly and easily. The results for a variety of circumstances are charted and discussed in detail..."

If you subscribe to the F# Journal then can read this article here otherwise subscribe to the The F# Journal today to read this article and many more!

Monday, 6 March 2017

Going retro: Star field demo

The F# Journal just published an article:

"This article takes a look at the challenge of creating a 3D star field, a task that was bleeding edge in the 1980s but had become a standard screensaver by the 1990s. The old school approach was to carefully precalculate as much as possible, blit pixels into a buffer and use integer arithmetic rather than the prohibitively-expensive floating point arithmetic. In this case we rise to the challenge using modern technology, specifically WPF for hardware-accelerated rendering with extensive use of expensive floating point operations to simplify our solution..."

If you subscribe to the F# Journal then can read this article here otherwise subscribe to the The F# Journal today to read this article and many more!

Wednesday, 1 March 2017

A fast purely functional extensible array

The F# Journal just published an article:

"See-and-say sequences have been going around the blogosphere lately with implementations in many different languages. Some websites are even collating implementations in dozens of different languages. Functional languages, particularly those of the ML family including F#, are doing relatively badly on this challenge. This article takes a look at the issues involved and, in particular, describes the design and implementation of a purely functional resize array in the process..."

If you subscribe to the F# Journal then can read this article here otherwise subscribe to the The F# Journal today to read this article and many more!

Simulating Galton's box

The F# Journal just published an article:

"Sir Francis Galton (1822-1911) was an English Victorian statistician, progressive, polymath, sociologist, psychologist, anthropologist, eugenicist, tropical explorer, geographer, inventor, meteorologist, proto-geneticist and psychometrician also famous for inventing the "bean machine" otherwise known as Galton's box, a device to demonstrate the central limit theorem. This article walks through the design and implementation of a simple graphical simulation of Galton's box using WPF..."

If you subscribe to the F# Journal then can read this article here otherwise subscribe to the The F# Journal today to read this article and many more!

Using the F# compiler service to format code

The F# Journal just published an article:

"The F# compiler service offers programmatic access to the F# compiler suite including F# interactive. This functionality can be used to decorate F# scripts as if they had been entered into F# Interactive which is useful when writing articles about F#. This article describes the design and implementation of a simple tool we use to format F# code in our articles, a precursor to full-blown literate programming with a notebook interface..."

If you subscribe to the F# Journal then can read this article here otherwise subscribe to the The F# Journal today to read this article and many more!

Friday, 24 February 2017

A Brownian tree

The F# Journal just published an article:

"Brownian motion is the seemingly-random motion of small particles in air as they are bombarded by much smaller molecules. A Brownian tree is a graphical demonstration obtained by "sticking" particles in Brownian motion together starting with a single seed particle. This article solves this problem, visualizing the result using WPF..."

If you subscribe to the F# Journal then can read this article here otherwise subscribe to the The F# Journal today to read this article and many more!

Thursday, 23 February 2017

MicroKanren

The F# Journal just published an article:

"MiniKanren is a family of logic programming languages of varying sophistication. MicroKanren is a minimal functional core of a relational language that was described in a 2013 paper. The original MicroKanren implementation weighs in at just 50 lines of Scheme. This article takes a look at the MicroKanren program and translates it into F# along with some advancements that make it more capable and worked examples that are more interesting..."

If you subscribe to the F# Journal then can read this article here otherwise subscribe to the The F# Journal today to read this article and many more!

Friday, 3 February 2017

A modular SNUSP interpreter

The F# Journal just published an article:

"SNUSP is a simple programming language that navigates a two-dimensional code space using an instruction pointer that is a 2D vector. This article describes how a simple SNUSP interpreter can be written in F#..."

If you subscribe to the F# Journal then can read this article here otherwise subscribe to the The F# Journal today to read this article and many more!

Saturday, 28 January 2017

A generic interpreter: part 3

The F# Journal just published an article:

"This article, the third and final part of our series about the generic interpreter, takes a look at solutions that use only concepts from functional programming. Although impracticably puritanical, the solutions convey some insight into the underlying problem that was not immediately apparent..."

If you subscribe to the F# Journal then can read this article here otherwise subscribe to the The F# Journal today to read this article and many more!

Friday, 27 January 2017

A generic interpreter: part 2

The F# Journal just published an article:

"The previous article in this series demonstrated how a generic interpreter can be written in F# using both union types and objects. This article investigates the characteristics of the same program written in a fully object oriented style..."

If you subscribe to the F# Journal then can read this article here otherwise subscribe to the The F# Journal today to read this article and many more!

Thursday, 26 January 2017

A generic interpreter: part 1

The F# Journal just published an article:

"Martin Odersky (the creator of the Scala programming language) was asked about the usefulness of object-oriented programming back in 2009 and responded with an interesting anecdote about a programming competition. The challenge is to write a generic interpreter that can be easily extended in different ways. This article is the first in a series taking a look at this generic interpreter and some of its many implementations in F#..."

If you subscribe to the F# Journal then can read this article here otherwise subscribe to the The F# Journal today to read this article and many more!

Wednesday, 25 January 2017

Using the new Twitter API

The F# Journal just published an article:

"When F# was originally released there was a beautiful sample showing how easily Twitter could be accessed. Sadly this old example no longer works because Twitter changed their authentication method. This article looks at modern Twitter authentication and demonstrates programmatically downloading tweets in a small WPF application..."

If you subscribe to the F# Journal then can read this article here otherwise subscribe to the The F# Journal today to read this article and many more!

Converting Word, HTML, PowerPoint and PDF documents to text

The F# Journal just published an article:

"The first challenge in Natural Language Processing (NLP) is usually converting available documents into text ready for processing. This article looks at functions that convert Word, HTML, PowerPoint and PDF documents into text using the Microsoft.Office.Interop.Word, HtmlAgilityPack, Spire.Presentation and iTextSharp Nuget packages, respectively..."

If you subscribe to the F# Journal then can read this article here otherwise subscribe to the The F# Journal today to read this article and many more!

Tuesday, 24 January 2017

John Conway's Game of Life

The F# Journal just published an article:

"John Conway's Game of Life is a famous example of a simple cellular automaton that produces remarkably diverse results. The game can be implemented in only 32 lines of F# including real-time visualization using Windows Presentation Foundation (WPF)..."

If you subscribe to the F# Journal then can read this article here otherwise subscribe to the The F# Journal today to read this article and many more!

Compiling regular expressions with Antimorov derivatives

The F# Journal just published an article:

"Regular expressions are a popular and powerful tool for string manipulation. In 1964, Brzozowski introduced the concept of derivatives to the study of regular expressions. Although academically interesting such derivatives were of little practice use until Antimorov introduced the concept of partial derivatives of regular expressions. This article demonstrates how partial derivatives can be used to compile regular expressions to deterministic finite automata (DFA)..."

If you subscribe to the F# Journal then can read this article here otherwise subscribe to the The F# Journal today to read this article and many more!

Sunday, 22 January 2017

Scraping websites part 1: simple examples

The F# Journal just published an article:

"Gathering information from the internet by hand can be tedious. Many modern websites are database driven and that underlying database is often the thing of interest. This article is the first in a series looking at simple ways to extract data from websites in a more automated way. In this case we scrape two different websites, the first from a single page and the second from a sequence of pages..."

If you subscribe to the F# Journal then can read this article here otherwise subscribe to the The F# Journal today to read this article and many more!

Scraping websites to make a torrent search tool

The F# Journal just published an article:

"Torrent search websites can be notoriously difficult to navigate and accidents can lead to malware. This article takes a look at the challenge of building a WPF application that scrapes a popular torrent site in order to download torrents more quickly and safely..."

If you subscribe to the F# Journal then can read this article here otherwise subscribe to the The F# Journal today to read this article and many more!