Hacker News new | ask | show | jobs
by IgorPartola 4663 days ago
Off topic: in what context do so many people on here need parsers? Do you actually use them for your jobs or are all of these use case for pet languages? When reading comments for threads like this I cannot help but feel that every day a half a dozen new programming languages get released that I never hear about.
4 comments

Not every parser is for a programming language. Often you need something to parse a specific file format you need to handle or made up. Although back at university my job was working on a large-ish modelling and simulation framework, and we had all kinds of parsers because each simulator needed some way of storing its initial state or the model configuration. Simply shoe-horning all of those things somehow into XML, JSON, YAML or CSV doesn't always work.
We use three DSLs to construct our application, all of which have custom hand-written parsers for performance reasons. One for extending UI, one for extending the core domain model and one for defining business workflows and events. We have 65,000 separate customisations at the moment so this is a big win for us.

You throw all these into a our metadata store and point the software at it and at runtime it throws out a desktop (WPF), mobile (web) and web version of our app which are all tightly integrated.

We built this because everyone of our clients needs heavy process level customisation yet we want to maintain a SaaS model.

Not toy languages here although you'll never see them on github.

Well, for a personal project I've written a parser for email (https://github.com/spc476/LPeg-Parsers/blob/master/email.lua) but I've also used LPeg for work to parse the logging output of some of our components (as part of the regression test) since they have a set structure (a mixture of "var=333" (example), "var=1/5/22" (minimum, average, maximum) and "time=33/55/88ms" (now with time units!).

Yes, it's nothing that a regex couldn't do, but I find the LPeg code easier to read and modify than a regex, and I don't have to do two passes over the data (one to break the input into multiple strings, then convert the appropriate strings into numerical values).

We use a custom SQL-like language to allow customers to query our domain objects.