Unofficial Hacker News companion — get notified on comment replies, and more.

Roc version 0.1.0, eight years in the making (opens external site)

485 points by DrDeadCrash 3 days ago | rtfeldman.com | 134 comments on HN | Vote on HN (opens Hacker News) |

View full thread · View on Hacker News

Comment thread (1)

  1. Platforms serve roughly the same role as a framework in another language with the difference being that a Roc platform must provide all side effects and therefore tends to include things that would be standard library elsewhere. In one of his talks, Richard mentioned that a starting point for the language design was typed, functional Lua and that motivation shows up in the platform concept.

    The main advantage it provides is restrictions. Roc cannot perform any side effects outside the ones provided by the platform and has no provision for unsafe behavior. This allows for very aggressive inlining at the language level which winds up being pretty close to what I've done with macros and compile time programming in other languages. In terms of system design, you can know that the app code can't break the abstraction boundary and design accordingly. I made an experimental web platform that had full and automatic cache invalidation which worked off a combination of sqlx-style compile time inspection of queries combined with SQLite's security hook callbacks and I never would have done the design without having to deal with platform design. Neither of these are doable if the entire thing is in Rust.