# MoonBit每周工作动态——0527

**URL:** <https://taolun.moonbitlang.com/t/topic/751>\
**Category:** MoonBit 月报\
**Tags:** moonbit-ide, moonbit-lang\
**Created:** [2024 年5 月 27 日 10:10 UTC](https://taolun.moonbitlang.com/t/topic/751 "2024-05-27T10:10:05Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

作者： ![Kuki](https://taolun.moonbitlang.com/user_avatar/taolun.moonbitlang.com/kuki/32/524_2.png) [@Kuki](https://taolun.moonbitlang.com/u/Kuki)\
发布日期： [2024 年5 月 27 日 10:10 UTC](https://taolun.moonbitlang.com/t/topic/751/1 "2024-05-27T10:10:05Z")

</div>

MoonBit 周报 Vol.42：核心库进行API整理工作、工具链持续完善

## MoonBit更新

- 【核心库 Breaking】核心库进行API整理工作

```rust

// Before

let a : @immutable_hashmap.Map[Int, Int] = @immutable_hashmap.make()

// After

let a : @immut/hashmap.Map[Int, Int] = @immut/hashmap.make()

```

- 核心库中 Option[T] 类型性能优化

- 核心库中引入了 `fn panic[T]() -> T` 函数，这个函数可以用于在测试块中，其中测试的名字需要以 `"panic"` 开头：

```bash

test "panic test ok" {

panic() // 测试通过

}

test "panic test failed" {

() // 测试失败

}

```

## IDE更新

- 【VS Code插件】增加了`test`和`for`的代码片段

`test`片段  
 ![test](https://taolun.moonbitlang.com/uploads/default/original/1X/237a49fb595888c222fabc61d4cd3e41f01f3283.gif)

`for`片段  
 ![for](https://taolun.moonbitlang.com/uploads/default/original/1X/fd39e8b434bf1aefa706e5a27ee9799e1ab11064.gif)

## 构建系统更新

- 【初始化】`moon new` 会自动对创建的项目进行版本控制初始化，目前支持 git

- 【测试】现在可以指定对多个包进行测试

```bash

moon test -p a b c

moon test -p a -p b -p c

```

## 工具链更新

- 【安装】现在可以指定版本号进行安装

```bash

# Mac与Linux用户

# 下载最新版

curl -fsSL https://cli.moonbitlang.com/install/unix.sh | bash

# 下载 bleeding 版本

curl -fsSL https://cli.moonbitlang.com/install/unix.sh | bash -s bleeding

# 下载特定版本

curl -fsSL https://cli.moonbitlang.com/install/unix.sh | bash -s 0.1.20240520+b1f30d5e1

```

```powershell

# Windows用户

# 下载最新版

irm cli.moonbitlang.cn/install/powershell.ps1 | iex

# 下载特定版本

$env:MOONBIT_INSTALL_VERSION = "0.1.20240520+b1f30d5e1"; irm cli.moonbitlang.cn/install/powershell.ps1 | iex

```

- 【安装】现在可以查找对应版本的SHA256，对下载进行校验
