Skip to main content

10 posts tagged with "MoonBit"

View All Tags

· 9 min read


In the realm of software development, testing is an essential step to ensure quality and reliability. Therefore, testing tools play a critical role in this. The simpler and more user-friendly testing tools are, the more developers are willing to write. While manual testing has its place, the deciding and typing task can be painful enough that it actually discourages developers from writing tests.

What is an efficient testing tool then? In the blog “What if writing tests was a joyful experience?”, James Somers introduces expect tests which make printing itself easy and save you from the daunting task of writing tests by hand.

To address this need, the MoonBit standard library introduced the inspect function, which we call expect tests, aiding in rapid writing tests. MoonBit's expect testing improves testing experience even better than that of OCaml and Rust, as it operates independently without the need for any external dependencies, enabling direct testing out of the box.

· 2 min read


MoonBit is a Rust-like language (with GC support) and toolchain optimized for WebAssembly experience. Today, we're excited to open source MoonBit Core, under Apache License 2.0. Since its launch in October 2022, the MoonBit platform is iterating so fast that we have shipped a full blown Cloud IDE, compiler, build system, package manager, and documentation generator.

MoonBit is close to beta status and the language features are stabilizing. We've established the essential infrastructure to support core library development, ensuring increased stability in language features. We are happy to open source the core and make the development public so that we can have more feedback from daily users.

· 9 min read

In the realm of programming, syntax analysis, commonly referred to as parsing, plays a pivotal role during the compilation process. The parser's primary responsibility is to transform a stream of tokens into an abstract syntax tree (AST).

In this article, we will introduce Pratt parsing, a renowned algorithm for parsing, often recognized as top-down operator precedence parsing, and we will demonstrate how to implement it using MoonBit.

You can experience the Pratt parsing code in this blog at

· 7 min read

People who grew up in the '80s and '90s remember Tetris. For decades, the game has challenged our hand-eye coordination and ability to make snap decisions. Tetris hasn't gone anywhere—it's still around, playable on just about any device.

Last week, a MoonBit user named Luoxuwei shared his Tetris implementation code using MoonBit on GitHub, presenting an interesting coding exercise. Today, we'll utilize Luoxuwei's code as a practical example to illustrate how to program Tetris using MoonBit.

· 7 min read

It has been two weeks since we officially launched the Moonbit. We've witnessed numerous users eagerly diving into various projects with Moonbit over this time. Woonki, an engineer hailing from the renowned GreenLabs company, is one of them, and he excitedly shared on Twitter his latest endeavor: using Moonbit to revamp the classic Game of Life. Notably, Moonbit's outstanding compilation speed during this project has truly astounded him.