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...

I have now also resurrected the other old #ocaml article and converted the code examples from #reasonml:

https://citizen428.net/blog/ocaml-module-functors/

Note that this was originally written for an audience of mostly OO programmers, not FP aficionados, so it may occasionally be a bit loose with terminology.

Module Functors in OCaml - citizen428.net

Note: A version of this article was originally written for Human Readable magazine in March 2020. That site no longer exists, so I decided to republish it on this blog. In the process I also converted the example code from ReasonML to OCaml syntax and updated the text to reflect those changes. Since functional programming’s move into the mainstream, many developers have embraced concepts like higher-order functions. OCaml take this a step further and extends the concept to the module level. This article explores module functors, a powerful feature that offers a functional approach to code sharing, dependency injection, and more.

I have another #ocaml article that is no longer available online since the magazine it was written for has shut down. However, it uses #reasonml syntax. Does anyone still use that, or should I convert the examples to OCaml and update the text?

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