Lurker News
I recently realized that certain kinds of knowledge allow one to be significantly more productive when solving a large class of problems.

For example,
* Regular expressions for simple text processing.
* Parser combinators for parsing.
* Parser generators (esp. packrat variety) for parsing.
* The concept of fuzzing and property testing for testing code.
* Calculus for solving all sorts of problems.
* MCMC for solving a huge class of probability problems.
* Search algorithms for solving a variety of problems (e.g. all NP-hard problems, sudoku, HTNs, scheduling, planning).
* Gradient descent for solving a variety of optimization problems.
* Vector Space embedding as a conceptual tool for a variety of complex AI problems.
* Effect composition (Haskell's IO or Scala's ZIO) as an incredibly powerful paradigm for concurrency and parallelism.
What are some examples of 10x multipliers that come to your mind? Fundamental ideas without which you would be drastically less productive.

Comments (418) 135 threads

Show all comments

Showing thread 45 of 135

SamReidHughes2 replies#
> * Regular expressions > * Parser combinators > * Parser generators

I sometimes forget how I take regexes for granted, and how some people don't know them.
I would replace the combinator/generator stuff with "how to cleanly make a hand-written parser." Developers frequently stumble through that quite badly.

ZeroCool2u1 reply#
I'm actually just about to run into making a somewhat complex parser and haven't done it since school.

Any recommendations resources you'd recommend as a refresher?

SamReidHughes1 reply#
By basics I really mean extreme basics. The level of instruction I'm thinking is: A parser is a function that looks something like "optional parse_foo(const std::string& data, size_t *pos)", which increases the value of *pos. It chews off objects from the front of the string and returns std::nullopt upon error. It's easy to recursively invoke smaller parsers this way.

Just that alone would really help people out and avoid problems I've seen encountered, where a dev needs to parse something, and just kind of spastically traipses around the string.

ZeroCool2u#
Ah, well I’ve got that bit covered at the very least :)
screye#
You don't even need to know how to use regex well. If you know what to look for, tools like regexr.com practically create the regex for you.

I have often found that the ability to identify : "hey I can use regex here", is more useful than actually knowing how to use regex.