Whoa, I haven’t expected so many answers, and such discussion.
I think I have to clarify the problem I’m trying to solve. (Right now I’m heading towards some simple FFI solution, but I think the problem is more general.)
In other words: I have written some application, that consumes quite complex data. I’d like users to be able to provide data using JS only. (So far, my app requires those data in more sophisticated PureScript format, so PS compiler is needed.)
I decided to use only types with simple JS runtime representations: all the primitive types, plus records.
No ADTs, not even Maybe (it requires type constructors in JS).
ADTs can be used in my FFI functions, since they are not supposed to be exposed in my application’s API. It’s ok to use type constructors internally - it’s not ok to tell my users to use them (since they have no idea, that PureScript exists).
As for JSON… Well, it could be used. I’m not a big fan of this format, I prefer to use more native ones (like POJO). In the end, I think, I’ll use whatever is leaner.
Yet, I also try to be reasonable. My goal is to solve my problem, and not to solve it all in PureScript.
BTW, I’m going to show you the application, and share my development experience, as soon as I’ll find some spare time to do it.