[HN Gopher] Roc Lang - Elm but for everywhere [video]
       ___________________________________________________________________
        
       Roc Lang - Elm but for everywhere [video]
        
       Author : crowdhailer
       Score  : 50 points
       Date   : 2024-08-20 16:46 UTC (6 hours ago)
        
 (HTM) web link (www.youtube.com)
 (TXT) w3m dump (www.youtube.com)
        
       | tkz1312 wrote:
       | roc is the language most rust nerds really want but don't realise
       | yet. functional, modern tooling, fast enough for almost
       | everything (~ go / swift), and without the insane complexity and
       | cognitive overhead of the borrow checker.
       | 
       | So excited to see it continue to thrive and grow.
        
         | tjoff wrote:
         | Automatic memory management seems like an antifeature if you
         | look from a systems language perspective (rust).
         | 
         | And I'd argue the borrow checker reduces the cognitive
         | overhead.
        
         | hardwaregeek wrote:
         | Does Roc have escape hatches for mutability? That's something I
         | value in Rust, good escape hatches from the borrow checker, so
         | if something gets too difficult, you can just
         | `Arc<Mutex<RefCell<T>>>` it.
        
           | eberfreitas wrote:
           | I don't think so (could be wrong), but it does perform
           | optimistic mutation on your functional code.
           | 
           | There is a talk somewhere where Richard "demos" this.
        
             | hardwaregeek wrote:
             | yeah that seems cool! I'm a little skeptical of pure
             | functional programming with no escape hatch. I rarely need
             | the escapes in Rust but when I do, I really do.
        
           | lalaithion wrote:
           | It should be possible to have a platform that has a mutable
           | reference with an API like this:                   main =
           | x = pf.NewRef!             pf.Write! x 5             y =
           | pf.Read! x
        
             | rtfeldman wrote:
             | That's right, although the Rust equivalent of that would be
             | more like `Future<Arc<Mutex<RefCell<T>>>>` than
             | `Arc<Mutex<RefCell<T>>>` - so the ergonomics would be a bit
             | different!
        
         | lkhasoidyfw wrote:
         | I'm a rust nerd and love roc, the problem is my employer won't
         | let me use either.
        
       | fire_lake wrote:
       | Can someone explain where Roc sits in terms of monads vs effects?
        
         | postepowanieadm wrote:
         | I don't have a PhD but I would say effects.
        
         | chuckadams wrote:
         | Firmly on the side of effects: Roc doesn't have higher-kinded
         | types, which makes it practically impossible to express monads.
         | It's covered somewhere in https://www.roc-lang.org/faq.html
        
           | mjaniczek wrote:
           | How do you need HKTs for monads?
        
         | fourteenminutes wrote:
         | Side effects are monadic (the main side-effectful abstraction,
         | Task, is the continuation monad). There are no algebraic
         | effects.
        
       | sharksandwich wrote:
       | I admire the consideration Richard and the rest of the Roc
       | community put into the language, but I'm curious whether the
       | absence of macros will unavoidably lead to code like
       | https://github.com/agu-z/roc-pg?tab=readme-ov-file#examples .
       | It's not obvious to me that the benefits of that constraint
       | (teachability, language tooling) outweigh the costs of writing
       | code that probably should be automated.
       | 
       | That said, I may just be showing my lisp bias, and tools like
       | Squirrel in Gleam are sufficient https://hexdocs.pm/squirrel/
        
         | Groxx wrote:
         | Since I'm not familiar with Roc and am looking at example code
         | that has an unknown amount of boilerplate added or removed
         | compared to normal code...
         | 
         | What part of that example is bad, and the lack of macros means
         | it stays bad? I can come up with some possibilities (e.g.
         | response mapping), but I have no idea if they're valid or not
         | because I don't know if that's just due to being an
         | intentionally explicit example.
        
         | giacomocava wrote:
         | Heard squirrel is well cool :P
        
       | paradox460 wrote:
       | Does anyone know if roc fell down the blessed packages issue elm
       | did? That was a major turn off to any interest I had in elm
        
         | ivanjermakov wrote:
         | Can you elaborate on what "blessed packages issue" is?
        
           | teg4n_ wrote:
           | Elm allowed only certain packages to use some restricted apis
           | as it was seen as a clique and rubbed people the wrong way.
        
         | jolt42 wrote:
         | I'd say Elm fixed packages. Only uses what is needed and
         | detects API breaks.
        
         | rtfeldman wrote:
         | This is one of the things Roc does differently from Elm. Roc
         | packages all work the same way, and you get them from URLs.
        
       | ProfessorPeanut wrote:
       | Interchangeable "platforms" seems like a fantastic idea!
       | Unfortunately there is ZERO documentation on how to develop your
       | own. For me, personally, this is the last barrier for adaptation!
       | Please asap! Love this project!
        
       ___________________________________________________________________
       (page generated 2024-08-20 23:02 UTC)