560 blogs tracked4,950 posts indexed

#parsers

8 posts · 1 company · newest first

1

A Fast Bytecode VM for Arithmetic: The Parser (opens on the source site)

In this series of posts, we write a fast bytecode compiler and a virtual machine for arithmetic in Haskell. We explore the following topics: Parsing arithmetic expressions to Abstract Syntax Trees (ASTs). Unit testing for our parser. Interpreting ASTs. Compiling ASTs to bytecode. Disassembling and decompiling bytecode. Unit testing for our compiler. Property-based testing for our compiler. Efficiently executing bytecode in a virtual machine (VM). Unit testing and property-based testing for our VM. Benchmarking our code to see how the different passes perform. All the while keeping an eye on…

parsersinterpretersexcerpt only · body stays at the source
From the web
5

Implementing Co, a Small Language With Coroutines #1: The Parser (opens on the source site)

Many major programming languages these days support some lightweight concurrency primitives. The most recent popular ones are Goroutines in Go, Coroutines in Kotlin and Async in Rust. Let’s explore some of these concepts in detail by implementing a programming language with support for coroutines and Go-style channels.

programming-languagesparsersexcerpt only · body stays at the source
From the web
6

JSON Parsing from Scratch in Haskell: Error Reporting—Part 2 (opens on the source site)

In the previous post, we set out to rewrite the JSON parser we wrote in Haskell in an earlier post, to add support for error reporting. The parser was written very naively: if it failed, it returned nothing. You couldn’t tell what the failure was or where it happened. That’s OK for a toy parser but error reporting is an absolute must requirement for all good parsers. In the previous post, we finished writing the basic framework for the same. In this post, we’ll finish adding simple but useful error reporting capability to our JSON parser.

parsersjsonexcerpt only · body stays at the source
From the web
7

JSON Parsing from Scratch in Haskell: Error Reporting—Part 1 (opens on the source site)

In the previous post we wrote a simple but correct JSON parser in Haskell. The parser was written very naively: if it failed, it returned nothing. You couldn’t tell what the failure was or where it happened. That’s OK for a toy parser but error reporting is an absolute must requirement for all good parsers. So in this post and next post, we’ll add simple but useful error reporting capability to our JSON parser.

parsersjsonexcerpt only · body stays at the source
From the web
8

JSON Parsing from Scratch in Haskell (opens on the source site)

JSON is probably the most used standard file format for storing and transmitting data on the Internet in recent times. Though it was historically derived from JavaScript, it is a programming language independent format and is now supported by almost all languages. JSON has a simple syntax specification with only four scalar data types and two composite data types. So, writing a parser for JSON is a great exercise for learning the basics of parsing. Let’s write one from scratch in Haskell.

parsersjsonexcerpt only · body stays at the source
From the web
8 shown

Privacy choices

Reading never requires analytics. These choices last 90 days on this browser.

Essential sign-in and security storage always stays on. Read the privacy notice.