MoonBit平台最新动态速递 Vol.10
-- 更新目录 --
1/ Int64支持位运算
2/ Int64与Float数据类型支持reinterpret
3/ MoonBit gallery增加俄罗斯方块游戏
4/ 创建 Awesome-MoonBit 项目
MoonBit 更新
1. Int64支持位运算
MoonBit支持Int64类型的数字继续位运算,当前支持的运算符如下:
println(0x7fL.land(-1L)) // bitwise and
println(0x7fL.lor(-1L)) // bitwise or
println(0x7fL.lxor(-1L)) // bitwise xor
println(0x7fL.asr(2L)) // arithmetic shift right
println(0x7fL.lsl(2L)) // logic shift left
println(0x7fL.lsr(2L)) // logic shift right
println(0x7fL.clz()) // count leading zero
println(0x7fL.ctz()) // count trailing zero
println(0x7fL.popcnt()) // count the amount of 1s
2. Int64与Float数据类型支持reinterpret
MoonBit的64位整数和64位浮点数之间的 reinterpret,这意味着我们可以通过对每个 bit 进行逐位复制的方式从一个64位整数得到一个64位浮点数,反之亦然。
println(3.14.reinterpret_as_i64()) // output: 4614253070214989087
print_float(4614253070214989087L.reinterpret_as_f64()) // output: 3.14
MoonBit Gallery
1. 用MoonBit开发的俄罗斯方块游戏
本周MoonBit gallery增加俄罗斯方块游戏,我们可以在IDE上实时修改代码查看运行效果,比如修改背景颜色、方块下落速度等。欢迎体验
https://www.moonbitlang.cn/gallery/tetris/
2. Awesome-MoonBit
MoonBit正式进入Alpha测试至今的1个多月时间里面,出现了一些用MoonBit实现的有意思的项目,为此,我们创建了Awesome-MoonBit这个项目帮助大家更好地学习MoonBit以及了解当前用MoonBit开发的项目。
Awesome-MoonBit link:
最近我们有幸接受了CSDN近匠栏目的专访,与大家分享关于 MoonBit 和编程未来的精彩对话!
🎙️采访嘉宾:张宏波
🌟IDEA基础软件中心讲席科学家
🌟MoonBit平台负责人
🎙️精彩内容包括:
MoonBit团队负责人张宏波在编程语言开发方面的经历
MoonBit有哪些创新点,具体如何实现?
MoonBit的未来发展规划和长期愿景是什么?
编程语言的未来之路该如何走……
官方平台账号,欢迎扫码关注
MoonBit
知乎|@张宏波 / @MoonBit
Twitter丨@Moonbitlang
Bilibili丨MoonBit月兔
MoonBit用户交流群|添加小助手rael_helper