rescript-lang.org icon indicating copy to clipboard operation
rescript-lang.org copied to clipboard

Guide ideas

Open fhammerschmidt opened this issue 7 months ago • 17 comments

We need more guides for people to get an idea what one can do with the language.

Some examples:

  • Fullstack examples with API type-sharing thanks to JSON schema and Sury
    • Rust Actix Web
    • Java Spring
    • ...
  • A simple server with Deno
  • A vanilla JS project with the new experimental web bindings
  • Something with rescript-relay
  • Something with EdgeDB

Please add your ideas here!

fhammerschmidt avatar May 07 '25 11:05 fhammerschmidt

High and low here (we should probably consolidate these after we have a large pool):

  • Ecosystem
    • Using Postgres with ReScript
    • Building GraphQL servers
    • Using Bun
    • Using Node
    • Using DOM with webapi
    • Using Gel (EdgeDB)
    • ReScript and OpenAPI
    • JSON serialization/deserialization with Spice
  • Language
    • Decoding strings typesafely
    • JSON serialization/deserialization with raw ReScript
    • Abstract types
    • Error handling with polymorphic variants

zth avatar May 07 '25 11:05 zth

React Native! 🙂

cknitt avatar May 07 '25 11:05 cknitt

I believe that every example involving bindings should focus on creating minimal bindings from scratch. While this might discourage some users due to the absence of a large library like TypeScript, it serves as a helpful reality check. Utilizing bindings that aren't maintained by the core team feels risky, and I would not recommend it. Therefore, I suggest including the creation of bindings in the recipe whenever needed. We do have a short list of exceptions for well-maintained options.

nojaf avatar May 07 '25 11:05 nojaf

To me bindings is a separate thing that we should have guides for as well. But I think it's a bad idea to focus on it in every single guide that deals with the outside world. To me it'd be like recapping every language feature used in every guide as well - also doesn't make sense and just becomes repetitive. But, we can certainly do guides on bindings and then link to them wherever it makes sense.

Using community bindings is totally fine and I'd happily recommend it. I use a ton of them in production already. Not sure why it wouldn't be?

zth avatar May 07 '25 12:05 zth

Using community bindings is totally fine and I'd happily recommend it.

That is not my experience at all. As a v12-only user, I've encountered issues with older bindings. If something is missing, you need to submit a PR, which can feel like shouting into the void. A guide or link to patching is essential. I wouldn't describe it as recapping; it feels more like a necessary step.

nojaf avatar May 07 '25 12:05 nojaf

V12 is in alpha still. That the community hasn't caught up is expected.

zth avatar May 07 '25 16:05 zth