サクサク読めて、アプリ限定の機能も多数!
トップへ戻る
Pixel 9
www.fpcomplete.com
This blog post was entirely inspired by reading the GATs on Nightly! Reddit post by /u/C5H5N5O. I just decided to take things a little bit too far, and thought a blog post on it would be fun. I want to be clear from the start: I’m introducing some advanced concepts in this post that rely on unstable features in Rust. I’m not advocating their usage at all. I’m just exploring what may and may not be
This blog post is a direct follow up on my previous blog post on different levels of async in Rust. You may want to check that one out before diving in here. Alright, so now we know that we can make our programs asynchronous by using non-blocking I/O calls. But last time we only saw examples that remained completely sequential, defeating the whole purpose of async. Let’s change that with something
First there was cooperative multiprocessing. Then there were processes. An operating system could run multiple processes, each performing a series of sequential, blocking actions. Then came threads. A single processes could spawn off multiple threads, each performing its own series of sequential, blocking actions. (And really, the story starts earlier, with hardware interrupts and the like, but ho
When deciding which language to use to solve challenges that require heavy concurrent algorithms, it’s hard to not consider Haskell. Its immutable and persistent data structures reduce the introduction of accidental complexity, and the GHC runtime facilitates the creation of thousands of (green) threads without having to worry as much about the memory and performance costs. The epitome of Haskell’
Before getting started: no, there is no such thing as an async exception in Rust. I’ll explain what I mean shortly. Notice the comma in the title :). GHC Haskell supports a feature called asynchronous (or async) exceptions. Normal, synchronous exceptions are generated by the currently running code from doing something like trying to read a file that doesn’t exist. Asynchronous exceptions are gener
This is a story about how some bad API design on my part caused some ugly race conditions that were very tricky to break down. I’m writing this story as a word of warning to others! The code itself was written in Haskell, but the lessons apply to anyone working with Unix-style processes. Introducing typed-process I maintain both the process library in Haskell, which is the standard way of launchin
We’re big fans of safety-focused languages at FP Complete. As our previous blog post comparing Rust and Haskell made clear, we think both of these are great languages. A recurring theme we have for both internal and client projects is: which language should we use? The general guidelines in that blog post apply: If there’s a specific requirement (e.g., hard realtime) that prefers avoiding garbage
FP Complete is known for our best-in-class DevOps automation tooling in addition to Haskell. We use industry standards like Kubernetes and Docker. We’re always looking for new developments in software that help us empower our clients. Rust is an up-and-coming programming language whose history starts in 2010. Rust has much overlap in its strengths with Haskell. We are impressed with Rust’s tooling
In the past few months, and in particular in the past two weeks, I’ve gotten a number of people asking me the question: Is Rust a functional programming language? This makes sense: I’m a big advocate of functional programming, I work at a company with FP in its name, my primary programming language is Haskell, and yet I use and enjoy Rust. So is Rust consistent with everything else in my FP-centri
Alternative title: “ResourceT considered harmful” Summary: ResourceT is a great tool, used to solve real problems when dealing with constrained resources and runtime exceptions. However, in the wild, it is often overused for situations where its full power isn’t needed. If you want more information on ResourceT, check out its README.md. How do you copy a file in Haskell? Let’s ignore the obvious a
One fantastic aspect of Haskell is that it offers various tools that allow different development workflows. In this blog post, we are going to focus on four different workflows to develop Haskell. These are techniques that the FP Complete team themselves use regularly and we wanted to share them with our readers. Auto-compile on save via stack --file-watch This workflow is the simplest one you can
Since I seem to be a one-trick pony, I decided to write yet again to compare streaming data in Haskell and Rust. This was inspired by a cool post I saw on Reddit about converting characters in the Latin alphabet into look-alikes in the Cyrilic alphabet. When reviewing the original code, I noticed that it was reading the full contents of the input into memory. Since I’m somewhat obsessed with strea
Deploying rust with Docker and Kubernetes Hello! My name is Chris Allen and I’m going to use a tiny Rust app to demonstrate deploying Rust with Docker and Kubernetes. Rust and Haskell apps are deployed in similar ways. Much of this is because the compilers for both languages generate native binary executables. Here are the technologies we’ll be using and why: The programming language will be Rust.
Concurrent programming is hard! I still remember the moment of my introduction to multi-threaded programming at the University of New Mexico, our professor grabbed his head and said: “Here be demons!”. There are all sorts of issues that arise in a concurrent setup, such as race conditions, starvation, deadlocks, data corruption, you name it. All of these are also applicable to Haskell, and in this
I’m pleased to announce the release of a Haskell library for connecting to SQL Server databases via ODBC. Features The library is very simple, but what it does support should be high quality: Correct Unicode handling. All text is handled through the Text type. The test suite randomly generates Unicode to send to the server and query back in a roundtrip. A very simple API: simply connect, execute o
This is a short and non-technical blog post demonstrating why the Haskell programming language is a good choice for building cryptocurrencies. Cryptocurrencies are not your average software Cryptocurrencies are different from other programs in one key way: One mistake in the code can result in the instantaneous loss of all value of all users. This is not often the case with other software. In conv
We launched our monthly webinar series on Wednesday, April 11th with our first webinar on How to Handle Asynchronous exceptions in Haskell. This webinar was the first in what will be a monthly series covering topics in Haskell Programming, DevOps, Cloud Computing, Cryptocurrencies, FinTech, Medical Device Software, DataOps, and all the other great things we do. Webinar series launch is a huge succ
One aspect of Haskell that many new users find difficult to get a handle on is operators. Unlike many other languages, Haskell gives a lot of flexibility to developers to define custom operators. This can lead to shorter, more elegant code in many cases. For example, compare these three equivalent pieces of code: v1 = mappend (mappend "hello " "there ") "world" v2 = "hello " `mappend` "there " `ma
Cardano enlists FP Complete for independent 3rd Party Audit of Cardano Blockchain FP Complete Development specialists will provide comprehensive review of Cardano’s code and technical documentation Zug, Switzerland,24 January 2018—Cardano Foundation, the objective organisation supporting leading blockchain Cardano, has appointed FP Complete, an IT engineering specialist, to provide an independent
I was recently doing a minor cleanup of a Haskell codebase. I started off with some code that looked like this: runConduitRes $ sourceFile fp .| someConsumer This code uses Conduit to stream the contents of a file into a consumer function, and ResourceT to ensure that the code is exception safe (the file is closed regardless of exceptions). For various reasons (not relevant to our discussion now),
In this blog post we will show an example of how we can use Docker to build Haskell applications which we then ship inside Docker images. We will observe two cases. First, we will explore the case of developing on the same Linux distro that we are using for deployment (eg. FROM ubuntu:16.04), and then we will observe the case where we are not developing on a Linux distro but are still targeting Li
Haskell is—perhaps infamously—a lazy language. The basic idea of laziness is pretty easy to sum up in one sentence: values are only computed when they’re needed. But the implications of this are more subtle. In particular, it’s important to understand some crucial topics if you want to write memory- and time-efficient code: Weak head normal form (WHNF) versus normal form (NF) How to use the seq an
For the past few years, Francesco Mazzoli and I have discussed issues around monad transformers—and the need to run their actions in IO—on a fairly regular basis. I wrote the monad-unlift library a while ago to try and address these concerns. But recent work I did in Stack on the extensible snapshots branch demonstrated some of the shortcomings Francesco had mentioned to me. This is also in line w
Streaming data is a problem domain I’ve played with a lot in Haskell. In Haskell, the closest we come to built-in streaming data support is laziness-by-default, which doesn’t fully capture streaming data. (I’m not going into those details today, but if you want to understand this better, there’s plenty of information in the conduit tutorial.) Real streaming data is handled at the library level in
This is a debugging story told completely out of order. In order to understand the ultimate bug, why it seemed to occur arbitrarily, and the ultimate resolution, there’s lots of backstory to cover. If you’re already deeply familiar with the inner workings of the monad-control package, you can probably look at a demonstration of the bad instance and move on. Otherwise, prepare for a fun ride! As us
This blog post came out of two unrelated sets of questions I received last week about usage of the resourcet library. For those unfamiliar with it, the library is often used in combination with the Conduit streaming data library; basically every conduit tutorial will quickly jump into usage of the resourcet library. Instead of just teaching you how to use the library, this post will demonstrate wh
Often times I’ll receive or read questions online about “design patterns” in Haskell. A common response is that Haskell doesn’t have them. What many languages address via patterns, in Haskell we address via language features (like built-in immutability, lambdas, laziness, etc). However, I believe there is still room for some high-level guidance on structuring programs, which I’ll loosely refer to
The exceptions package provides three typeclasses for generalizing exception handling to monads beyond IO: MonadThrow is for monads which allow reporting an exception MonadCatch is for monads which also allow catching a throw exception MonadMask is for monads which also allow safely acquiring resources in the presence of asynchronous exceptions For reference, these are defined as: class Monad m =>
Haskell is an amazing language. With its extremely powerful type system and a pure functional paradigm it prevents programmers from introducing many kinds of bugs, that are notorious in other languages. Despite those powers, code is still written by humans, and bugs are inevitable, so writing quality test suites is just as important as writing an application itself. Over the course of history bugg
次のページ
このページを最初にブックマークしてみませんか?
『Home Page - FP Complete』の新着エントリーを見る
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く