A year or so ago, I posted about an intriguing, new #programming language called #MoonBit, which I discovered on the #wasm site. MoonBit is designed expressly for edge, cloud, and IoT. It has all the much-adored OCamlisms. And despite my dislike of ALGOLish blocky syntax, I say without reservation that MoonBit’s syntax is tastefully designed. In other words, MoonBit is #ReasonML done right.

Of late, this language has matured rather quickly. Its toolchain is refined. Documentation is comprehensive—a rarity amongst new languages. Yet, the website conservatively claims to be not yet production-ready. Humble—good on them.

But despite this refreshing humility, the examples include an implementation of the λ-calculus and the graph reduction G-machine. 💪

Anyone who likes #OCaml but wants an “on the edge”, lightweight, wasmy language should give MoonBit a try.

https://www.moonbitlang.com

MoonBit

anyone know how string interpolation works in #reasonml ? docs and github seem to indicate maybe we are supposed to jam strings and things converted to strings together in printf like it's 1987? that can't be it...

flake_env: *experimental* direnv plugin for nix flakes

"ported the nix-direnv use_flake function to ReasonML. Implementing most things by hand in #ReasonML is pretty simple and (more importantly) portable. This removes most of the dependencies besides bash and nix. The bash that exists is pretty portable between versions, since it only does environment manipulation."
#nix
https://sr.ht/~bryan_bennett/flake_env/#:~:text=ported%20the%20nix,does%20environment%20manipulation.

🌗 GitHub - hazelgrove/hazel:Hazel,一個即時功能程式設計環境,具有型別洞
➤ 開發者專注的即時功能程式設計環境
https://github.com/hazelgrove/hazel
Hazel 是一個基於類型理論原理的即時功能程式設計環境。它使用 ReasonML 撰寫,並提供線上試用版本。使用者可以透過 Git 複製專案,並使用 `make` 指令建置和執行 Hazel。文件提供了詳細的安裝說明,以及 VS Code 和 NeoVim 的建議設定,以提升開發效率。Hazel 透過 js_of_ocaml 編譯器將程式碼轉換為 JavaScript,以便在網頁瀏覽器中執行。
+ 這個工具看起來很有潛力!即時功能程式設計的概念很吸引人,特別是對於需要快速迭代和實驗的專案。
+ 雖然對 ReasonML 和 OCaml 不熟悉,但安裝指南看起來很完善,應該可以協助入門。對 VS Code 和 NeoVim 的支援也很貼心。
#開發工具 #功能程式設計 #Hazel #ReasonML #OCaml
GitHub - hazelgrove/hazel: Hazel, a live functional programming environment with typed holes

Hazel, a live functional programming environment with typed holes - hazelgrove/hazel

GitHub
Okay, so I've got a new codebase as well. I'm switching over to #ReasonML for my backend development. This will make it super easy to prop up a website along with my backend interface (on #nodejs) to my database. Then I can run experiments and testing using the backend interface before launching the mobile app. Learning a lot!

@rauschma What is your opinion of #ReScript (https://rescript-lang.org/)? It has somewhat an #OCaml heritage via #ReasonML

Edit: Just looked at the source for Grain; it’s mostly ReasonML!

The ReScript Programming Language

Fast, Simple, Fully Typed JavaScript from the Future

ReScript Documentation

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.

#reasonml #Rescript #OCaml

2. OCaml has proper OOP, with inheritance, method overrides, all that stuff. But, unlike records, it's not easy to bind to JS objects, I think.
3. Somewhere on Rescript forum I saw something like "prefer explicitness to DRY". Which I guess makes sense?

#reasonml #Rescript #OCaml

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: https://tinyurl.com/yv7j24mj

{cont}
#reasonml #Rescript #OCaml

ReScript Playground

Try ReScript in the browser

ReScript Documentation