You don’t get to belittle my tone, my work, and turn a thread that ended on a high note into one that ends with a bad note, when you yourself write things like:
I am disappointed. I thought you had bigger goals for ReScript than toy projects and small bespoke applications. In big multi-layered projects such as the one I work on your resulting code is completely unacceptable.
And you clearly came in with a preference set in stone and selectively ignored what I said. But for the sake of clarifying misconceptions one last time, because most folks check the first few and last few messages only, here’s what I said, re-re-re-summarized:
This to me sounds like throwing away significant benefits the type system can provide for some misguided sense of convenience
Please reread this thread. The types are more correct. That correctness happened to provide some simplicity, which resulted in convenience. The previous types accepted illegal states. Those ended up with the direct impact that downstream usage of those also ended up handling the illegal states in a wrong way. The usages, and even UX, suffered because of it. If you still don’t believe me, start from before my commit, and go through the refactoring yourself. Please try it.
An open Js.t
document object that lacks a list of available methods and won’t even trigger a compiler error from a typo is not something I will ever ask developers to interact with
I’m not advocating for this. Did you read my commits messages? That was for iteration clarity purpose, one step before solidifying the bindings into proper, more type-safe bindings catered to the codebase’s need. How else am I supposed to show intermediate work? Are you gonna start telling me some of my local branches don’t type check?
the codebases I work on are so large and so deeply tied to the DOM that such assumptions can (and have) bitten us through weird edge cases customers find when the null/undefined case actually comes up
Same as above. Those assumptions are meant to be tightly encapsulated in a single module, likely with a few dedicated abstract types for specific dom node or usages. We’ve even discussed on stream about this before; your nulls came from bad unsafe casts and assumptions that got carried from one point to another transitively, instead of (again, like I said on stream) encapsulated and closely guarded in a single location. The unsafe casts gave you no safety. Adding an option type in your base library because of one callsite (instead of making a dedicated helper for said callsite which avoids dragging down all the other existing usages) does work, except it’s super unclear for all the existing callsites why they started handling extra states (that never exist). Of course, if you end up having 3+ exceptional callsites, then you backtrack and revisit that specialization, rinse and repeat.
The more time that goes by the more I’m convinced I will end up rewriting/forking bs-webapi
to build a pipe-first version of it that is more approachable, leveraging records-as-objects and poly-variants-as-strings.
You can do that, but this situation isn’t about pipes, and you’ll find very few relevant records (in terms of real-world usage, not in terms of api coverage). For example, you can go type things like event target. When you end up with the equivalent of an any
, you’ll end up getting no editor completion. Whereas what I tried to advocate above will give the userland of that specific codebase proper IDE-driven help.
Do I want a generalized library that can provide good type-driven IDE help? Yes. Have we/I been writing such libraries for the past four years? Yes. Did we succeed in doing this with DOM? No we didn’t (bs-webapi):

The impression I get from @chenglou’s tone (on many threads, not just this one) is prescriptive and not at all encouraging of alternate styles
As a small community:
- The language itself stays, as much as possible, unopinionated. Like bob once said, we don’t try to be a dumbed down “big agenda” language, but we also don’t try to be a bloated language. Walking this fine line means conflicts are inevitable (but the results, worthwhile). That’s why I personally can’t and don’t mind conflicts; however, I greatly care about how people solve conflicts. Rageposting and belittling other’s work isn’t one of them. Whenever I want to modify someone else’s work as a showcase, I reach out, in public and in private, to ensure I have the permission.
There are lots of things you posted here and elsewhere that I strongly disagree with, but dare I say I never publicly attacked your work. Why can’t you do the same? Has this been worth it?
- I do have opinions, but I’ve also shown that I back down when I disagree, just so that the team and the community can stay united. When disagreements can’t be solved, I’ve walked the walk, and have many times chosen the locally suboptimal route with a personal discomfort, for a hopefully globally optimal direction for the team and community (every team member has done so too). Heck, I didn’t even start the rebranding; a few key folks internally and externally advocated for it, and I understood that I was one of the only ones capable of gathering enough activation energy from different folks to implement it, so I friggin carried the load. I didn’t even complain when folks low-key subtweet me here and there saying random stuff like “Cheng Lou is breaking things up”. Just because I advocate for something for the team, newcomers, and/or community, so that we can have some recognizable face and direction, doesn’t mean I personally espouse the idea. ReScript isn’t even officially my job until a year ago; and tbh the more irreconcilable and puristic software letter tweaking I see, the less I want to make it my job.
- Crucially, when there’s a disagreement, I myself don’t directly reach for the end-all argument of “why aren’t you accepting of my alternate style?”, because there’s no good defense my teammate can summon if I straight up say that.
As a side remark, this tendency seem particularly strong in the FP community, where folks tend to overgeneralize not just the code but also the stance. Every paradigm yak shaving seems to need to show some kind of ideology or aspiration; this is suffocating and leaves less room for actual ideologies discussions. “High priests of a low cult”, like Alan Kay once said.
A small community requires curation, emphasis and unity to succeed. Every single decision can have someone reach for the kind of argument along the line of “you’re not respecting my style”. Fortunately in most circumstances, people don’t say that, and choose instead to ask why, and in the usual worst case, agree to disagree. There can be no curation, emphasis and unity if everyone constantly turns a small technicality into a freedom-related issue.
Since the thread already got derailed, and the “vibe” here turned bad, I’m gonna make an exception and lock a thread for the first time. Apologies.