Sunday, 27 March 2016

Parsing METAR with FParsec

The F# Journal just published an article about parsing:
"The parser combinator libray FParsec is a very useful tool available for the F# language. It encapsulates a very common and useful computing pattern - the parser monad - and allows us to use it effortlessly in everyday programming tasks. We'll be using it to process METAR code, which is an international semi-standard used to report weather information in aviation..."
To read this article and more, subscribe to The F# Journal today!

Saturday, 26 March 2016

F# vs Rust: Dictionary and HashSet

The F# Journal just published an article about the Rust programming language:
"Garbage collection has been the most common way for programming languages to provide memory safety for the past 20 years but it does not come without its disadvantages. All known garbage collection algorithms offer either good throughput or good latency but never both at the same time. Rust is a new programming language that departs from this tradition of using garbage collection to provide memory safety. By tracking memory management in the type system, Rust makes it possible to achieve memory safety without garbage collection. This approach promises to combine speed and safety. In this article we take a look at some simple programs written in both F# and Rust in order to compare their performance characteristics..."
To read this article and more, subscribe to The F# Journal today!

Sunday, 13 March 2016

Going retro: Bresenham's line and circle algorithms

The F# Journal just published an article about computer graphics:
"This is the first article in our "Going Retro" series that takes a look at some old algorithms that were crucially important in the 1980s but disappeared in the 1990s with the emergence of ubiquitous floating point units and consumer-level graphics hardware. This article looks at Bresenham's line and circle algorithms that were widely used in computer graphics..."
To read this article and more, subscribe to The F# Journal today!

Porting OCaml code to F#: Delaunay triangulation

The F# Journal just published an article about computer graphics:
"Daniel Sleator wrote a great little OCaml program implementing the Delaunay triangulation algorithm in quadratic time. This is an important algorithm in many fields including computer graphics and numerical methods. This article walks through the process of translating this program first into working F#, then into idiomatic F# and finally into efficient F#..."
To read this article and more, subscribe to The F# Journal today!

Sum columns

The F# Journal just published an article about a programming challenge:
"The challenge of a summing the columns of data in a CSV file was posed and solved in a variety of programming languages including F#. Several interesting solutions were presented but the space of solutions is remarkably large for this problem. This article looks at a variety of different solutions and highlights the relative advantages and disadvantages of different approaches..."
To read this article and more, subscribe to The F# Journal today!

Saturday, 23 January 2016

Stoer-Wagner Min Cut algorithm

The F# Journal just published an article about graph theory:
"Many practical problems require the ability to find or approximate the set of edges with the smallest total weight that join a graph into two separate subgraphs. This article walks through the design and implementation of a simple F# program to compute the exact min cut of an undirected weighted graph using the Stoer-Wagner algorithm..."
To read this article and more, subscribe to The F# Journal today!

Sunday, 17 January 2016

Lexing floating-point numbers efficiently

The F# Journal just published an article about lexing:
"The .NET Framework provides functions to parse primitive types including floating point numbers. These functions all adhere to the same API: the string being parsed must hold only the number. This simple API is fine for prototyping and production when performance does not matter but practical applications often lex streams of input containing numbers and, therefore, benefit from the ability to parse a number that is a substring in a given string with a specific starting index and length. This article looks at the design and implementation of a function to lex a sequence of floating point numbers from a string and compares the performance with a version that uses the built-in parsing functions..."
To read this article and more, subscribe to The F# Journal today!