Live data from Hacker News

Roc – A fast, friendly, functional language

roc-lang.org

171–180 of 180 posts

Re: Roc – A fast, friendly, functional language

#171
Since the type is inferred, why can't the module name by convention be inferred from the data type in pipe operations?

So instead of:

["a", "b", "c"] |> List.append "d" |> List.append "e" |> List.append "f"

You could have:

["a", "b", "c"] |> append "d" |> append "e" |> append "f"

Since Roc knows that the type returned from each function is a List.

Re: Roc – A fast, friendly, functional language

#172

Since the type is inferred, why can't the module name by convention be inferred from the data type in pipe operations? So instead of: ["a", "b", "c"] |> List.append "d" |> List.append "e" |> List.append "f" You could have: ["a", "b", "c"] |> append "d" |> append "e" |> append "f" Since Roc knows that the type returned from each function is a List.

Roc cares a lot about explicitness, so I don't think this would be a wanted feature. That said, it is easy to get this functionality with something like ``` append = List.append ```

An important note is that any module could expose an append function that has the same interfaces as `List.append`, so that could easily lead to confusion.

Re: Roc – A fast, friendly, functional language

#173

Has anyone else noticed that functional languages go heavy on the special keywords and operators? It feels like theres a larger cognitive load (more specific keywords to memorize) when learning languages like F# or OCaml compared to C or Python or Java

Can you clarify what you mean? I don't think Roc actually has that many keywords or operators in total. I would bet that C has more keywords that Roc.

I do agree that default convention may rely heavily on a few syntaxes that aren't as common in procedural or OO languages.

Re: Roc – A fast, friendly, functional language

#174

Roc is definitely interesting and I like the platforms idea. The error messages are clear, but calling them friendly is clearly not something they've reached yet. Just installing and trying to reach a valid hello world going just by the errors and it's actively rude within three error messages. Also it's missing the final newline

> it's actively rude within three error messages.

Can you share those error messages? I am sure that is not the intent.

Re: Roc – A fast, friendly, functional language

#175
post #152

Roc looks great, props to everyone involved in designing this language! Is there an (C) FFI planned?

Yes and No. Roc fundamentally is built on top of platforms. Platforms are communicated with through cffi. So cffi is fundamental to roc. At the same time, roc will never have general cffi where a package can wrap an arbitrary c library. Those primitives must always come through the platform.

https://www.roc-lang.org/platforms

Re: Roc – A fast, friendly, functional language

#176

0. I don't see type annotations. 1. Why another language and not a better runtime for an existing language with an install base that already exists?

0. Roc is capable of always inferring types. So type annotations are never required. That said, type annotations are used commonly and 100% supported.

Re: Roc – A fast, friendly, functional language

#177

Earlier quoted context omitted.

Well, yes, if there are no type annotations because all types are inferred, you don't see the effect "types". https://www.roc-lang.org/tutorial#tasks

Then to my limited understanding that's less "pure" than haskell isn't it, which doesn't allow side effects and thus forces monads?

Roc doesn't allow side effects. All effects are wrapped and returned from a function. So this is just as pure as haskell. Though it may not be exposed in the same way as haskell, effects still boil down to something akin to monads and callbacks.

Re: Roc – A fast, friendly, functional language

#179
I'm excited to take a look at this. I learned F# early on in my career and really enjoyed it. These days I'm into ultimate simplicity. I really like V-lang. It has the simplicity of Go but adds some ergonomics that Go has been missing. Also, it can seamlessly interact with C libraries. So, that is my current favorite language. Hopefully Roc will be my favorite functional language :-).

Re: Roc – A fast, friendly, functional language

#180

Earlier quoted context omitted.

Seriously ppl, go use a language where the creator is a paradigm of humanity. Maybe Python is a good choice? Seriously, tho, that's the comment that "made the Elm community a hostile and unwelcoming place" and is still being dredged up after 5 years? That comment can barely even be considered harsh, and is nowhere near hostile. Is it really worth tearing down someone's life, monitoring the internet for any time their…

A paragon of humanity?

(The first part appears to have been sarcasm.)
Post reply on HN