ReScript

ReScript

@rescript-lang.org

https://rescript-lang.org/ Ship great products!

366 followers31 following72 posts

Pinned

ReScript 12 is here! A major step toward a leaner, faster, simpler toolchain. This release refines the language and embraces ReScript’s own identity. Blog: rescript-lang.org/blog/release... Notes: github.com/rescript-lan... Huge thanks to everyone who helped move ReScript forward.

rescript-lang.orgAnnouncing ReScript 12 | ReScript BlogReScript 12 arrives with a redesigned build toolchain, a modular runtime, and a wave of ergonomic language features.

Development of ReScript V13 is going well. We now have ways to make sense of a PR diff much quicker. We call it "semantic diff". Example attached.

Amazing work by @hyeseong.kim !

Hyeseong Kim@hyeseong.kim

Upcoming ReScript (@rescript-lang.org) v12 move platform binaries into optional dependencies (e.g. rescript/linux-x64) To shrink the download & install size significantly! Download & Install size change: - Before: 67 MB | 197 MB - After: 15 MB | 48 MB (on a Linux x64 machine)

We just landed a new (experimental) feature for v12 - nested record definitions! Records is a corner stone in ReScript. However, they can't be nested without explicit definitions. Until now! Will be especially useful for deeply nested records (like options objects) not intended to be reused.

Go read this amazing blog post from @vlkpack.com to learn more about all the tools that work great with #rescript!

Josh Vlk@vlkpack.com

I wrote a post for the @rescript-lang.org blog! ReScript is awesome because you can drop it into any JavaScript project and use any JavaScript runtime. I'm currently working on a project using Deno and it works great!

@z-th.bsky.social has made an amazing job introducing #ReScript, go watch this deeply interesting video!

Kris Jenkins@krisajenkins.bsky.social

Much as I like #TypeScript, I think there's still plenty of room for competition. We need something that feels broadly like #JavaScript, but shaves away the corner cases, compiles faster, and just…flows…better. Could that be #ReScript? Let's find out… youtu.be/yKl2fSdnw7w

Records are powerful, but you need explicit definitions for them. We're experimenting with allowing inline record definitions nested inside a record type definition. This will make some of the common use cases for records more ergonomic.

It also has the added benefit of making more TypeScript code copy/pasteable to ReScript without requiring breaking each type shape out into its own type definition.

The new dot completion also works for objects. Objects are structurally typed, doesn't need a type definition, and are quite useful in some scenarios. Completion for object fields will be more ergonomic and get better discoverability with this addition.

With the new dot completion enhancements in our editor tooling you'll now get completions from the Option module when autocompleting on a record field that's an optional value, instead of just no completions like before.

Happy new year! We're almost ready to release an exciting editor feature - dot completion everywhere! "." will now trigger completions for more than just record fields. Example: you'll get completions for pipeable functions from the module of that type. Examples and videos ⬇️

View full thread

You'll now also get pipe completions when you do dot completion on any type, not just records. And additionally, you can even configure per type to have the editor give completions from additional modules, not just the module it belongs to.

Together, these features helps both newcomers and established ReScript devs, while increasing the discoverability and usability of essential patterns like using and providing pipeable functions for your various types. We're excited to release this and hope it'll give you value!

Happy new year! We're almost ready to release an exciting editor feature - dot completion everywhere! "." will now trigger completions for more than just record fields. Example: you'll get completions for pipeable functions from the module of that type. Examples and videos ⬇️

For newcomers, one of the differences to JS is using pipes where you'd normally use method chaining. This takes a bit of time to learn. To fix this, you now get pipe completions from dots as well. So the experience is like in JS, but an actual pipe is inserted on completion.

ReScript reposted

I've been playing around with @rescript-lang.org for a React project I'm working on and I'm super impressed with how far it's come since I last checked it out! Also between ReScript and @gleam.run I'm absolutely spoiled when it comes to error messages

Type inference is simple but powerful. The compiler will infer each type that's unknown by usage. A consequence of this is that prop drilling is really simple, because you rarely have to annotate props. Just using the prop in the component defining it is usually enough.

In ReScript, pipes are normally used for chaining fn calls instead of method chaining with dots like in JS. This is a common gotcha for JS/TS devs who come to ReScript. To ease the transition we're experimenting with letting the editor tooling complete pipes also via dots.

A pipe is of course still inserted in the code. We think this is going to make it much easier as a new comer to ReScript to connect the dots (no pun intended) of the JS/TS way (using dots for method chaining) and the ReScript way (using pipes to chain any function).

In ReScript you can put expressions almost anywhere. Assign expressions to variables, put them anywhere in JSX, put them directly into function arguments, etc. Massive readability and productivity boosters, and you'll love it if you haven't written in a language with it before.

Co-locating logic to where it's used, and not having to precompute it in a variable or use an IIFE to co-locate, is usually something new comers appreciate the most in ReScript. Co-location makes code easier to read, maintain and reason about.