News for hackers. Stuff that matters.
Re:Roc – A fast, friendly, functional language by Eji1700 on Monday November 20, 2023 @12:42PM (#38351311)
Looks interesting. I'm a huge fan of F# and think anything working in that hybridish space is the way to go. I'll have to dedicate some more time to this when I get a moment.
Re:Roc – A fast, friendly, functional language by whalesalad on Monday November 20, 2023 @01:03PM (#38351699)
I've been on the F# website for 5 minutes now looking through damn near every page and I cannot find a single page that shows me a simple example program or the syntax at all.

Everything is hidden behind some kind of "let's get started!" wizard. https://dotnet.microsoft.com/en-us/learn/languages/fsharp-he...

Re:Roc – A fast, friendly, functional language by mgomez on Monday November 20, 2023 @01:28PM (#38352139)
Here's a non-wizard tutorial that I bookmarked when I started with F# (I also had a hard time finding a simple example at first):

https://learn.microsoft.com/dotnet/fsharp/get-started/get-st...

What I like about this page is that it shows a basic project structure.

Re:Roc – A fast, friendly, functional language by evanwalsh on Monday November 20, 2023 @01:15PM (#38351921)
Re:Roc – A fast, friendly, functional language by whalesalad on Monday November 20, 2023 @01:17PM (#38351952)
this website is great - should truthfully be 50% of the index.html of every language project ever.
Re:Roc – A fast, friendly, functional language by igouy on Monday November 20, 2023 @01:28PM (#38352126)
Re:Roc – A fast, friendly, functional language by Eji1700 on Monday November 20, 2023 @02:12PM (#38352905)
Oh yeah. A key hindrance of F# is that MS treats it like a side project even though it's probably their secret weapon, and a lot of the adopters are dotnet coders who already know the basics so the on-boarding is less than ideal.

https://fsharp.org/ is the best place to actually start, although i'm guessing you did and went to the hello world which leads back to ms's nightmares.

https://fsharpforfunandprofit.com/ is the standard recommendation from there but there's finally some good youtube and other content out there.

They have a browser repl as well https://try.fsharp.org/

Re:Roc – A fast, friendly, functional language by whalesalad on Monday November 20, 2023 @03:34PM (#38354270)
fsharp.org is actually the offender. lots of links to basically nothing and quite a few of them are a dead end 404.
Re:Roc – A fast, friendly, functional language by zem on Monday November 20, 2023 @03:23PM (#38354099)
agreed, a "learn dotnet via f#" approach for people with experience in other ML languages would be excellent.
Re:Roc – A fast, friendly, functional language by ReleaseCandidat on Monday November 20, 2023 @12:52PM (#38351495)
> hybridish space

I'm sorry, but what do you mean by that? Roc is "as" pure as Haskell (or Koka), if that's your point.

Re:Roc – A fast, friendly, functional language by Eji1700 on Monday November 20, 2023 @02:36PM (#38353304)
I glanced at the example code and it looked like it allowed side effects, but maybe I was wrong. I haven't had much time to mess with it and seemed to be able to hard crash the repl doing some testing so it's something i'll have to look at later.
Re:Roc – A fast, friendly, functional language by ReleaseCandidat on Monday November 20, 2023 @02:41PM (#38353385)
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

Re:Roc – A fast, friendly, functional language by Eji1700 on Monday November 20, 2023 @03:45PM (#38354445)
Then to my limited understanding that's less "pure" than haskell isn't it, which doesn't allow side effects and thus forces monads?
Re:Roc – A fast, friendly, functional language by whizzter on Monday November 20, 2023 @04:15PM (#38354898)
Honestly it looks like basically the same as getline/putStrLen from the tutorial(1) in the link below, just not written in an intentionally obtuse language.

Considering how much more approachable this Roc documentation/naming is, I'm wondering if it isn't so that the people writing Wikipedia's math pages are probably the same people that are drawn to and writes Haskell/monad "tutorials".

1: http://learnyouahaskell.com/input-and-output