Better HN
topnewbestaskshowjobs
Log inSign up

niclas-ahden

49 karma · joined Aug 21, 2018 (8y ago) · 10 submissions

Submissions

comment 5d ago · link · parent

>It also seems to say purely functional languages can't do much without a none functional layer.

Well, you could write your platform in a functional language :) What it is saying is that separating pure vs. effectful/impure comes with some nice benefits, and we're seeing that in the platforms concept. I think if you try it you may see it differently :)

>If you're the guy that created the joy web framework (platform?) for roc, then I watched and enjoyed your talk about it.

Yeah, that's me! Thank you so much! PS. I call it a "framework" just because it spans more than one platform. Not really an important :P

comment 5d ago · link · parent

>I think my main point is that to use roc for anything I need to know roc and a second language

You could just pick up Roc, pick a platform, and start writing Roc right away without knowing any other language :) There are already a number of platforms to use for CLI apps, web servers, web apps, native GUIs etc.

However, if you want to write your own platform you can. That's a great power to be able to reach for if you want to but it's not typical.

Going back to the JavaScript example: most JS developers just pick a platform, like Bun, and start writing JS. In the same way, you'd pick a Roc platform and start writing Roc.

Sure, if Bun wasn't good enough the JS dev may write their own platform (Bum? :P), and then they'd need a second language. That's the same thing you could do in Roc if you wanted a custom platform :)

comment 6d ago · link · parent

Yeah, I mean, that's just factually true! No harm in that :)

Roc needs a platform written in another language, but you as a Roc author don't have to read or write that language. You don't even need to know which language a platform is written in.

Someone else (like me!) writes a platform, shares it, and you use it. That means you get whatever platform you want: maybe with the concurrency of Go? Or the performance of Zig? Or the memory safety of Rust? And the platform can give you access to their entire ecosystem. All that with no effort on your part, and you get to read and write only Roc. Sweet deal, right? ;D

comment 6d ago · link · parent

Yes, and it's been a journey! I've built billing systems, business systems, marketing automation etc. for businesses I'd already worked with for a long time and who trust me to deliver. I've maintained these systems for 1–2 years now, and have extracted as many packages as I can from what I've built, so we now have a bunch of useful Roc packages for "serious business use" :)

I'm not saying everyone should be doing this, but it was an opportunity for me to be able to use Roc while contributing a lot to the community. It did take a lot of work, but seeing where we are now, I'm thrilled with how it has turned out :)

Heh, I almost posted a link to a public-facing Roc app here, but that's not a great idea :P DM me on Zulip (https://roc.zulipchat.com/) if you want to see an example of an actual business running full-stack web apps in Roc!

comment 6d ago · link · parent

I was an avid Elm user, used it in several projects, and even recruited a great Elm developer to work with me. I was sad about the situation that ensued and had to move on to other languages. Now that Roc is here, I'm just so thoroughly happy. It's hard to put into words, but I was on the brink of quitting programming due to burnout (for different reasons), and Roc reinvigorated my joy of programming. Perhaps you can relate in some way? I can't say Roc will make the sun shine brighter, but I've really enjoyed writing Roc and being part of the community over the past years :) You're very welcome if you'd want to try it out!

comment 6d ago · link · parent

Platforms are what give you all of the effectful functions you need. It could be a "webserver platform" which lets you answer web requests and talk to a database, or it could be a "TUI platform" which lets you read keyboard input etc. Without a platform you'd just have pure functions, because unlike many other languages, Roc doesn't offer any effectful functions in its std lib. My mind was blown when I realized that! :'D

Another way to look at it is a practical comparison: JavaScript is a language, but it needs to run on something. If you run it in the browser, you get access to browser APIs. If you run it on the server with Node/Deno/Bun you get different APIs that are useful for web servers. In that scenario, the browser or Node/Deno/Bun is the platform.

The example above isn't apples-to-apples, but it's a good way to visualize the difference!

Does that help? :)

comment 6d ago · link · parent

Glad you like it, I do too :)

If it's any help, I've been writing "serious business apps" in Roc for the past two years, so you can already do quite a bit! I write mostly web apps and had to write my own web framework (https://github.com/niclas-ahden/joy) since it was such early days. I've been extracting and releasing as many packages as I can to help build out the ecosystem for people like you. I hope you'll have a great time when you decide to try it :)

If there's anything specific you need or are unsure about, post on https://roc.zulipchat.com/ and we'll help you!

comment 6d ago · link · parent

I've been using Roc for the past two years and it's been a blast! The compilation speed is great, hot-reloading gives you a really nice development experience, and the error-handling is sweet :)

If you're into web apps and The Elm Architecture, then check out https://github.com/niclas-ahden/joy I built Joy so that I could use Roc on a daily basis for client work, and it's been awesome! Now it's growing into a full-stack web framework with full type-safety from the database to the browser. Hope you'll like it too! :D

If you're curious about Roc, then join us on the Zulip (https://roc.zulipchat.com/). Welcome in!

comment 4mo ago · link · parent

Good move! I'm porting it to the new compiler now and that'll enable nicer APIs and fewer workarounds. Roc v0.1 (later this year probably?) will be a great time to jump in!

comment 4mo ago · link · parent

>Another use case I've heard from it is as a more app-level language (i.e. a really small Roc platform). Do you see it competing with Gleam for server side http code? Do you see it competing with Elm for client side code?

For sure! I've been using Roc for work exclusively for the past year and a half, writing mostly full-stack web apps, and it's been great. I wrote a small framework/platform (https://github.com/niclas-ahden/joy) which is similar to Elm or Lustre from Gleam.

Previously I used mainly Rust/Haskell/Elm/Ruby/Python and each language has its pros/cons, but for web apps Roc really hits the sweet spot of: runtime performance, compilation speed, strong type system, error handling, and ergonomics. It's definitely worth a try!