V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
• 请不要在回答技术问题时复制粘贴 AI 生成的内容
Moonbit
V2EX  ›  程序员

MoonBit 平台最新动态速递 Vol.16

  •  
  •   Moonbit · Nov 13, 2023 · 828 views
    This topic created in 899 days ago, the information mentioned may be changed or developed.

    MoonBit 更新

    1.性能提升

    • Tokenization 的性能提高了大约 25%。

    • 内置比较操作在早期阶段被内联,这可能对热循环( hotloop )产生较大影响。

    2. 语法改进

    根据用户反馈,不鼓励使用 x := expr 的形式,而推荐统一使用 let x = expr。未来可能会移除前者这种语法。

    3. 整数上的方法调用现在必须加括号

    修改前:1.to_string()

    修改后:(1).to_string()

    4. 基础类型支持 hash 方法

    基础类型 BoolCharIntInt64DoubleString支持 hash 方法。

    fn init {  
    println("test".hash())
    }
    // 输出:1042293711
    

    5. 移除内置类型 Result 、print_float64

    • 移除内置类型Result,后续我们将在标准库中提供此类型。

    • 移除print_float64FFI ,此函数已经被println函数取代。

    IDE 更新

    1. IDE 支持用户使用 JavaScript 定制运行时

    使用样例请参考 https://try.moonbitlang.cn 中的 ffi 文件夹 。

    2. IDE 中添加运行按钮

    IDE 中添加运行按钮,并且将打印内容的显示从调试控制台(DEBUG CONSOLE)更改到输出通道(OUTPUT)中。

    3. 改进 IDE 对包的支持

    之前用户只有在一个包中的 moon.pkg.json 文件上才能运行该包。现在,在包内的任意一个 .mbt 文件上都可以运行该包。

    4. IDE 中添加直接编译到 Wasm 的选项

    构建系统更新

    1. 添加 moon build --debug 选项

    添加moon build --debug选项,用于添加调试信息到编译产物中。

    2. 调整 moon build 的输出目录

    现在根据编译目标以及是否启用调试模式--debug,将编译产物的输出路径调整为target/<arch>/<mode>

    命令 输出目录
    moon build target/wasm/release
    moon build --debug target/wasm/debug
    moon build --target wasm-gc target/wasm-gc/release
    moon build --target wasm-gc --debug target/wasm-gc/debug

    完整文章内容可点击查看: https://mp.weixin.qq.com/s/_hUx4s5TT-WPBknGYOrj3A

    2 replies    2023-11-14 09:53:13 +08:00
    block0
        1
    block0  
       Nov 14, 2023 via Android
    这是 web 版的 vs code?
    Moonbit
        2
    Moonbit  
    OP
       Nov 14, 2023
    @block0 是的
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   2467 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 35ms · UTC 09:58 · PVG 17:58 · LAX 02:58 · JFK 05:58
    ♥ Do have faith in what you're doing.