logoalt Hacker News

esafak • yesterday at 3:35 PM • 1 reply • view on HN

1. Do LLMs write it well?

2. What are the suggested substitutes for OOP idioms like interfaces?


Replies

grayrest • yesterday at 5:50 PM

> Do LLMs write it well?

Yes. Most if not all the examples in the community section of the post are LLM authored. A large part of the reason is because there's been breaking changes most weeks for months. This comes with the territory for a pre-0.1 language and the Roc team says they've put in all the breaking changes they had on the roadmap so hopefully with the increased stability of a numbered release we'll see more non-LLM projects.

The only thing I've particularly needed to kick the LLM on is error handling idioms. It reaches for `match` when something shorter would suffice.

> What are the suggested substitutes for OOP idioms like interfaces?

This is beyond the scope of a comment post but interfaces play an outsized role in most OOP system designs due to the need to nominally type everything in hierarchies. The closest mechanism would be using a `where` clause[1].

[1] https://roc-lang.org/docs/main/langref/static-dispatch/#wher...