Hacker News new | ask | show | jobs
by LordHeini 600 days ago
I would agree with your sentiment.

This is basically a lib with some extra syntax to parse CSV Files.

A 'proper' DSL would require a very specific domain where it is applied to. Like document creation, or solving a certain problem and only that but not much else. Turing completeness is usually not required as well.

For example Matlab or LaTex are domain specific as well as SQL. Those are used to do math, create documents or do mangle tables.

Imho just renaming forEach to Map to parse CSV files does not fit the bill so the linked example is not that great.

This project basically a DSL builder thingy with a text processor demo.

As an aside:

I am missing the most important thing when it comes to CSV which is configuration of the input.

Might be because this is more of an example but it is usually a sign of a lets say more academic project.

Working with CSV, is usually a source of a lot of "good fun" where many hours can be spent.

Because your average CSV is often a SSV or TSV in some ISO that is everything but not UTF8. It usually contains line breaks which have been renamed to funny icons by some combo of tool and operating system. Also there are weird escape character in orders which are not consistent on every row. Also sometimes you have titles sometimes not. Dates make no sense, are language depended and in a weird format the intern made up 10 years ago. And even numbers are weird too, like 12e^-25 or '0.00' or '10.000,0'. Then you get columns which really should be 2 or more, or there are lines which span multiple rows.

Ihmo it is way better for robust CSV parsing to have a really low level approach where you rigorously check for everything (and return everything to sender that does not fit).

1 comments

> I am missing the most important thing when it comes to CSV which is configuration of the input.

1. Given that their stated use-case for this tool is generation of data for testing purposes, why would input configuration be relevant?

2. It doesn't have any CSV-associated features to begin with. If for some reason you wanted to use this for that, you would interact with your own bound Go functions to facilitate working with CSV, just as demonstrated in the article. Within those functions, you can setup any configuration your heart desires.