writing.exchange is one of the many independent Mastodon servers you can use to participate in the fediverse.
A small, intentional community for poets, authors, and every kind of writer.

Administered by:

Server stats:

334
active users

#parsing

0 posts0 participants0 posts today

Does anyone have experience with #parsing partially overlapping text regions? For example if we have #markdown we could have something like `**only bold _italic and bold** only italic_`. Only that in #orgmode one has 6 or more different inline markups. I would like to parse this stuff, but it seems impossible to describe with some grammar, because the grammar usually represents a tree and branches don't overlap. Starting to wonder, if a grammar is possible at all. Does Emacs use a custom parser?

Replied in thread

@notgull

Maybe these resources are interesting to you as well 🤓

Introduction to Compilers and Language Design - by Douglas Thain (haven't read yet)

compilerbook.org/

Strumenta (<-- an absolute gem!)

tomassetti.me/

e.g. these articles

A #Guide to #Parsing: #Algorithms and Terminology:

tomassetti.me/guide-parsing-al

A #tutorial on how to write a #compiler using #LLVM:

tomassetti.me/a-tutorial-on-ho

Weeknote! #SwiftUI, #parsing, progress on the async chapter of The #Rust Programming Language book, a second pass on a bit of orchestra #music, StaffPlusNY talk drafting, going on @changelog, and @robinsloan’s Moonbound!

v5.chriskrycho.com/journal/wee

Trying something new with this—I’ll give it a month or so and see if it sticks.

Why? Well, it seems good to show some *progress* for the things I am working on—since I don’t have the usual jobby-job folks to share that work with!

v5.chriskrycho.com · Weeknote: June 17–21, 2024 — Sympolymathesy, by Chris KrychoSwiftUI, parsing, progress on the async chapter of TRPL, a second pass on a bit of orchestra music, StaffPlus drafting, The Changelog, and Moonbound!

Context free grammars (CFG) are better than parsing expression grammars (PEG), because CFGs represent how we think.

Parser combinators are similar to PEGs, so they are worse than CFGs, too.

So, don't use Rust libraries nom, combine. Use lalrpop.

Don't use Haskell libraries parsec, gigaparsec, attoparsec, megaparsec, trifecta. Use Earley, happy.

See more detailed story in my new article safinaskar.writeas.com/this-is .

The story also includes some cases, where PEG and parser combinators may still be useful. Also, the article gives links to my Haskell parsing libraries.

Askar Safin · This is why you should never use parser combinators and PEGLet me tell you why you should (nearly) never use PEG (parsing expression grammars). Nearly everything I will say applies to parser combi...
#haskell#rust#parsing

I have some machine generated dsp-like pseudo code in a text file with a lot of superfluous brackets and coefficients that can be combined. In order to make it more readable I’d like to simplify it so I need to build an abstract syntax tree and some tree modifiers. Parsing the file is the first step; I think I’ll use ANTLR/C++for that, or should I use #Python? #development #parsing #cpp

Replied in thread

@shuttle

Parsing crates:

chumsky | A #parser library for humans with powerful error recovery

crates.io/crates/chumsky

winnow | making #parsing a breeze

crates.io/crates/winnow

---------------------------------------

Crates in the #async ecosystem:

pollster | an incredibly minimal async executor for #Rust that lets you block a thread until a future completes

crates.io/crates/pollster

smol | A small and fast async runtime

crates.io/crates/smol

crates.iocrates.io: Rust Package Registry

I'll actually just make my recursive descent parser module a whole new project. I think it deserves that. Perhaps other people need to parse config files and want to use my kick-ass grammar for it. The code is found here:
github.com/akyuute/mybar/blob/

GitHubmybar/mybar/parse_conf.py at dev · akyuute/mybarCraft highly customizable status bars with ease. Contribute to akyuute/mybar development by creating an account on GitHub.