Steinar H. Gunderson

Love 😍 such articles that cover a topic in depth:

“Modern Perfect Hashing For Strings” [2023], Wojciech Muła (http://0x80.pl/notesen/2023-04-30-lookup-in-strings.html).

On HN: https://news.ycombinator.com/item?id=35764176

#Hashing #PerfectHashing #Lexing #LexicalAnalysis #Programming #Algorithms #Trie #gperf #Tokenization

Modern perfect hashing for strings

See Also:

“Chapter 6: Lexical Analysis”, from “lcc, A Retargetable Compiler For ANSI C”, by Christopher Fraser & David Hanson (https://drh.github.io/lcc/documents/06lexical-analysis.pdf).

#Books #Compilers #Lexers #Programming #PLDI #LexicalAnalysis #Tokenization #Excerpts

Strategies for very fast Lexers

Making compilation pipelines fast, starting with the tokenizer

@foone

Bison is like weird flex but okay.

#parsing #LexicalAnalysis

Neat, but (a) this is lexical analysis, not parsing (b) it’s likely to be slow & a memory hog:

“Incremental Parsing In Go”, Will Daly (https://dev-nonsense.com/posts/incremental-parsing-in-go/).

Via HN: https://news.ycombinator.com/item?id=33298253

#LexicalAnalysis #SyntaxHighlighting #Go #GoLang #TextEditor

incremental parsing in go | dev-nonsense

This post is an attempt to explain the incremental parsing algorithm aretext uses for syntax highlighting. Like the rest of aretext, parsers are implemented in Go for portability and performance. Most people do not consider Go a functional programming language; nonetheless, aretext’s parsers rely on functional programming patterns. In this post, we’ll see how to implement these patterns in pure Go to build parsers that are fast and expressive. Problem Syntax highlighting is a special case of parsing.

Building Your Own Programming Language From Scratch: Part VI - Loops | HackerNoon

In this part of creating your programming language, we'll implement For, While and For-each loops. We'll implement and test the bubble sort algorithm