mas.to is one of the many independent Mastodon servers you can use to participate in the fediverse.
Hello! mas.to is a fast, up-to-date and fun Mastodon server.

Administered by:

Server stats:

12K
active users

#ReScript

0 posts0 participants0 posts today

As much as I like #TypeScript, I think there's still plenty of innovation left in the world of compiles-to-JavaScript languages. We need something that feels broadly like JavaScript, but shaves away the corner cases, makes everything immutable by default, and just...flows...better. And #ReScript might well be that language. Let's find out...

youtu.be/yKl2fSdnw7w

youtu.be- YouTubeEnjoy the videos and music you love, upload original content, and share it all with friends, family, and the world on YouTube.

thank you async await for saving me from #JavaScript callback hell

thank you #ReScript for saving me from typeless no-trail-of-what's-returning-what hell

I just followed a bunch of type errors and ended up with a beautiful chain of async calls that execute in the proper order it's so cute

Replied in thread

So basically, it looks like the best way would be to:
1. Declare DTO types with *all* the fields (maybe using combining types if you use Rescript)
2. From these combined types, manually construct "entity" types. If needed, you can use composition (through records, tuples, etc) to combine multiple entities together.

Continued thread

What I think about it after some digging and poking around Melange and Rescript playgrounds:

1. Rescript can "combine" both object types and record types. If you have `type t1` and `type t2`, a `type t = {...t1, ...t2}` will have fields from both t1 and t2. But you can't put a variable of `type t` where a `t1` or `t2` is expected. At least this doesn't work: tinyurl.com/yv7j24mj

{cont}
#reasonml #Rescript #OCaml

ReScript DocumentationReScript PlaygroundTry ReScript in the browser

A question about ReasonML/Rescript/OCaml on JS.
How do you deal with the lack of structure inheritance?

I'm mainly a backend dev with OOP background so I'm probably not seeing something.

But at work, our frontend has a lot of types (TS) like this:

```
type Client = BaseClient & {
assignees: Actor[]
}
```

We use these for types that we get from API (a base type + some additional fields).

How would you model something like that in Reason/Rescript/OCaml?

Hey, #Nix friends! I am working on making my first contribution to #nixpkgs, and I have a question:

The package I'm working on adding is an executable npm package, specifically the #ReScript language server.

I wouldn't mind taking on some responsibility for making sure that package is up to date, but it seems like the whole "maintainer" bit described here:

github.com/NixOS/nixpkgs/blob/

...isn't actually applicable to npm packages b/c they're handled automatically. Do I have that right?

GitHubnixpkgs/maintainers/README.md at master · NixOS/nixpkgsNix Packages collection & NixOS. Contribute to NixOS/nixpkgs development by creating an account on GitHub.

Of late, there have been numerous good-hearted attempts at creating #webdev #DSL, both internal and external varieties. But just about every one of them get tripped up by the disjointed nature of the current web technologies and, soon, they degenerate into JavaScript mayhem.

When a #programming language obliges the #programmer to handcraft asynchronous communication, thread management, code-download splitting, server-side pre-rendering, session management, authentication, authorisation, transport encryption, data caching, data format conversion, content validation, message queues, storage optimisation, and myriad other system-level facilities, this language, by definition, is not a DSL.

At present, the only webdev DSL that I admire is #Elm, which is a Webskell. And I like #ReScript, not because it's in anyway a DSL, but because it's OCaml.

A different, but related, problem is this: modern business programmers confuse enterprise application implementation with systems programming. And modern business executives confuse enterprise application user interface with marketing material. This is ineffective and unproductive.