indie game developer | generative art | functional programming
see my other account @chococo for more technical stuff related to functional programming
indie game developer | generative art | functional programming
see my other account @chococo for more technical stuff related to functional programming
Well, I am gonna make the the same wish again and again, until I make it 🥳
Hope I can finish a game demo in 2025 😁
Didn't make it for the last year's wish, but will wish again for this year:
In the new year, I hope to finish a wonderful demo for my game 😁
I've customized LLVM for my language, but it's my first time looking at this part of LLVM
Yeah, I think something like this could work for file type classification
I'm aware that instruction selection is one of the slowest passes in LLVM, and maybe now I know why 😂 It's expensive pattern matching done by interpreted bytecode programs
One way to improve is to compile the rules to native executable binaries, instead of interpreting them (Think of the rules like a kind of program)
I am feeling sorry that I made inadequate suggestions. I should have recognized that this is not a problem really familiar to me
Actually, after a little more thought, I think introducing regular expressions into solving the high level classification problem doesn't really make sense. Much of the power of regular expressions really lies in expressing repeating string patterns (e.g. "a*" "a+"), but the rules of libmagic are not repeating
It's basically a decision tree, that needs to be somehow optimized. You are right that Maranget's algorithm could be a good inspiration source
As for regular expressions, there can be various ways to extend them, at varying performance costs. For example you could have a special matching token for a constant offset in the string
With this approach, it feels inefficient to feed the whole file content into the underlying DFA, and you would need to think of ways to optimize