moov-io / bai2

BAI2 file format is a cash management balance reporting standard
Apache License 2.0
15 stars 9 forks source link

feat: add generated code for alternate parser #111

Closed adamdecaf closed 3 months ago

adamdecaf commented 4 months ago

@brian-pickens @wokkaflokka

I've been trying out ChatGPT more and gave it the bai2 specification to have it generate code, which I think is a lot cleaner. Do you have sample files you could parse against this? If v2 is better we could just replace it as the current code is much less performant and harder to debug.

adamdecaf commented 4 months ago

Code is way off. I'll keep working on it to improve, but wanted to share an alternative.

wokkaflokka commented 4 months ago

@adamdecaf I think it's a great idea to try this. I would agree that although adequate, there is room to improve the internal implementation of the bai2 library and that improvement could pay dividends for maintainability (and perhaps also performance, etc).

In terms of test cases, it seems to me like the existing test suite in this project would be a valid harness for testing an alternative parser implementation. This file would certainly be a usable test case.

While I was working on this library, I came across a recent Rust bai2 implementation that I thought had a nice implementation technique and thought was worthy of evaluation. Sharing in case this is a valuable reference point here.