genType
lwt
genType | lwt | |
---|---|---|
5 | 6 | |
759 | 722 | |
- | 1.8% | |
0.0 | 8.6 | |
about 1 year ago | 21 days ago | |
OCaml | OCaml | |
MIT License | MIT License |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
genType
-
ts-belt - Fast, modern, and practical utility library for FP in TypeScript / Flow / JavaScript. (Faster than ramda, rambda, remeda and lodash/fp.)
I don't really use ts-belt to be certain, but by looking at the source, it seems that it's using genType, which can generate TS types from ReScript values, and that makes interop work really well.
-
ReScript 10.0
They discuss this in their docs.
https://rescript-lang.org/docs/manual/latest/introduction#di...
Seems like a type system for Javascript, built with a differing set of opinions than Typescript.
Looks like they also offer some form of TS interop:
https://rescript-lang.org/docs/gentype/latest/introduction
- From TypeScript to ReScript
-
TS Belt - fast, modern, and practical utility library for FP in TypeScript
TS Belt has been built with ReScript (and its Belt stdlib). ReScript generates highly performant JavaScript code, and with genType it also automatically generates TypeScript types. Moreover, I've added a few codemods to the building process to provide even more code optimizations and cleaner TypeScript signatures.
-
How I Switched from TypeScript to ReScript
To interoperate with TypeScript with proper type information you’ll use third-party genType. Add it as a devDependency and annotate the module export you want to generate with @genType (in previous versions you’d surround annotations with square brackets).
lwt
-
Go is my hammer, and everything is a nail
> Also, didn't OCaml have weak support for concurrency? Has that changed recently?
OCaml has had Lwt for concurrent IO for long enough that it is now being deprecated in favor of Eio[1]:
https://github.com/ocsigen/lwt
[1] https://github.com/ocaml-multicore/eio
- Por que aprender OCaml?
-
Ocaml for web development
Here is link number 1 - Previous text "Lwt"
-
From TypeScript to ReScript
I have to admit I don't know much about ReScript and only have very basic exposure to OCAML, here is how you do await in it:
https://github.com/ocsigen/lwt
The `let* in` is a generic syntax for monads, it doesn't need a special one just for promise. This was in fact a debate back when async/await was in consideration for ECMAScript, but special syntax is hip so now we have `async/await` for Promise, `.?` for optionals and `flatMap` for arrays, basically the same thing.
-
Dream – Tidy Web Framework for OCaml and ReasonML
Dream doesn't have much of a system call dependency footprint itself. It's basically just a convention for plugging request -> response functions into a web server. Some of its native dependencies will have to be replaced by Node equivalents. Soon after that, it would be portable to Node.
There is already work underway to port Dream to Mirage, to run in unikernels: https://github.com/aantron/dream/pull/22
Lwt, Dream's promise library, is itself getting ported to run on top of libuv: https://github.com/ocsigen/lwt/issues/813
libuv is, of course, the I/O library that powers Node, so it might be practical to run Dream as a native node module very soon after doing this.
(As an aside, I'm supposed to work on that libuv project, but instead I've been working on Dream :P)
What are some alternatives?
Idris2 - A purely functional programming language with first class types
async - Jane Street Capital's asynchronous execution library
melange - A mixture of tooling combined to produce JavaScript from OCaml & Reason
dream - Tidy, feature-complete Web framework
from-typescript-to-rescript - Frontend of https://Inhyped.com written in TypeScript and rewritten in ReScript
sihl - A modular functional web framework
zod - TypeScript-first schema validation with static type inference
ocaml-cohttp - An OCaml library for HTTP clients and servers using Lwt or Async
bolt - Bolt is a language with in-built data-race freedom!
ocurl - OCaml bindings to libcurl
ts-belt - 🔧 Fast, modern, and practical utility library for FP in TypeScript.