ccanassa
an hour ago
Beni creator here.
This is a language/research project. I want to explore what a combination of a purely functional language and a very advanced compiler is capable of generating in terms of JS.
One novel idea (AFAIK) is adding a borrow checker. Other languages targeting the browser have added borrow checkers, but that's been driven by WASM. In Beni, lists are immutable, but instead of being implemented using tries, they use regular JS arrays with in-place mutations. The borrow checker guarantees that ownership isn't shared and that it's safe to update them. One concern I have is that this could cause DX issues due to borrow checker errors. I don't think that's going to be an issue given that the language is functional, but it's still an open question.
The "Platforms" concept is an idea I borrowed from Roc, which also inspired many of Beni's design decisions. In Beni, you can't call JS directly, just like in Elm. Platforms wrap the JS ecosystem in a safe way so that it can be consumed by Beni. There's currently no way to install third-party JS libraries. I believe the NPM ecosystem is broken: even small libraries pull in hundreds of indirect dependencies. With AI, new CVEs are being found every week, and keeping `npm audit` clean has become a daily struggle.
The irony is that updating dependencies to fix these mostly harmless CVEs just increases the risk of supply chain attacks. My idea for Beni is to make it "batteries included" so that people need fewer third-party dependencies. For everything else, I think the correct approach is to vendor the code you need.