September 24 Re: Examples of DFA | ||||
---|---|---|---|---|
| ||||
Posted in reply to Dennis | On 24/09/2025 11:48 AM, Dennis wrote:
> My general approach is to make it work first, not worrying too much
> about algorithms.
>
> (...)
>
> It paid off to not be too pre-judgmental about what time it would take.
>
> Which is why it puzzles me:
>
> There's a simple, classic algorithm that runs in linear time, which is pre-judged to be slow because there's array concatenation in it.
When the problem space has a known finite lifetime, like the case for dmd's AST, to its global object.
There is a solution to this particular problem: inlined linked lists.
I use them heavily for any compiler type problems that I do. They work great, even if they cost a tiny bit more ram.
They work out to be very cheap, and basically non-existant in terms of cost during iteration.
At least when applied to stuff like the algorithms me and Dennis presented wrt. deferred logic.
|
Copyright © 1999-2021 by the D Language Foundation