Xya

30 posts

Xya banner
Xya

Xya

@xya0x0

PL researcher, Endmoonistrator.

US Katılım Mart 2026
37 Takip Edilen33 Takipçiler
Xya
Xya@xya0x0·
Last year I wrote a tutorial on the type checking algorithm for System F<, and I've recently translated it into English, including a MoonBit code implementation. Have fun with local type inference and bidirectional typing :) moonbit.community/blog/lti-engli…
English
0
2
13
1.7K
Xya
Xya@xya0x0·
@RizumuA3 Many problems solved by GoF actually stem from the lack of first-class functions in the language. In functional languages, GoF are often unnecessary, Peter Norvig's slide beautifully illustrates this point :D norvig.com/design-pattern…
English
0
0
0
228
绚香音 Rizumu
绚香音 Rizumu@RizumuA3·
最近公司 领导 和我聊起面 向对象(OOP)和设计模式。并说想要在公司中推广设计模式。但是我表示了 反对。 我想聊聊我为什么不喜欢设计模式,以及我信奉的软件 “设计模式”。 说实在的,我其实没看过 GoF 那本设计模式的书。以后也大概不会去读。但是设计模式的大名还是有听过 我之前在 Vue 团队写 Vapor 模式时。发现 Vue 的响应式系统确实使用了 OOP,但主要是出于性能上的考虑。当优化达到一定层级之后,哪怕是引擎层面的微小实现差异也会影响性能。所以我们选择 OOP,是因为它带来的优化便利,并不是因为我们想要套用某种具体的设计模式。 * Vue 的源代码中 ReactiveEffect、Dep、ComputedRefImpl 这些类的存在,是因为 V8 的 hidden class / inline cache 对固定形状的对象优化更好。 (如果理解有误,欢迎指出) 我在入行的初期学过 OOP,大约是 8 年前的事了,已经很久了。但是过去这几年,我逐渐觉得设计模式并不太适合 Vue 3 + TypeScript 的开发。如果不是为了性能优化,我现在也很少使用面向对象。我会这样看,一部分原因是受到了像 Anthony Fu (antfu) 这些人的影响。 * GoF 是 1994 年的 C++/Java 世界的产物。如今语言进化了,很多模式从"需要刻意设计"退化成了"语言原生特性"。 这就是为什么 antfu、Evan、Anthony Fu 那一派人不太谈 GoF。不是反对它,而是它已经融进语言里了,再单独命名反而显得笨重。 “ 模式之所以叫模式,是因为语言没原生支持它,你得手动重复实现。” 去年我读了一本关于如何更好的编程的书,我很快就爱上了它。我试着推荐给我的推友们,结果发现推友中已经有不少人读过了。而且也很喜欢! 这本书是《软件设计的哲学》(A Philosophy of Software Design) 我特别喜欢书中对复杂度的阐释方式,现在仍会时常翻阅。 我的 CLAUDE.md 提示词里也用了这本书的概念: - 深模块(Design Deep Modules) - 消除错误(Define Errors Out of Existence) - 向下沉淀复杂性(Pull Complexity Downwards) - 不同层不同抽象(Different Layer, Different Abstraction) 这边篇幅有限,就不展开这几个概念了。如果感兴趣的话,我可以之后仔细写写我自己的理解。 让我疑惑的问题: 设计模式如今还被使用,似乎更多是一种沟通时的共同语言。但是我们是否真的按照它的模式来设计代码架构呢? 它作为大家交流的语言和思想的工具如今是否还是合适的选择。是否落后,又是否有着与时俱进的新选择呢? * 写了好多,以上都是我自己的主观想法,可以随便聊 🤗
绚香音 Rizumu tweet media
中文
79
31
411
116.7K
Xya
Xya@xya0x0·
@RizumuA3 As a puzzle game enthusiast, I truly admire the ingenious game ideas and designers behind them. This lecture was really fantastic, I learned a lot from them :)
English
0
0
1
38
绚香音 Rizumu
绚香音 Rizumu@RizumuA3·
看了 北京大学 一个讲 “知识锁” 类游戏设计的演讲 PPT。学到一个新概念:“可读性” 知识锁类设计常见于 星际拓荒、见证者、Tunic、Leap Year 等游戏中。可以给人提供一种名为“啊哈 moment”的奇妙体验。 PPT 中提到一个名为“可读性”的概念我觉得很奇妙。 “学到新知识后。原本不可读的东西会变的可读。” 这让我想起去香格里拉旅行时候看雪山的经历。起初我没有去做功课。我看雪山就和其它山差不多。只知道高知道有雪。住在那边几天。期间看了一些科普了解了雪山的知识。角峰、刃脊还有湖什么的结构特征,雪山的形成原理等。再回头去看雪山。之前仿佛不可见细节都冒了出来。每座雪山的细节变的很清晰,区分起来也变容易了。 我在想这是不是知识锁和可读性之间的关系呢? 雪山的构成原本是模糊的不可读的。只能作为一个整体模糊的被我识别。当我了解了相关的知识。雪山的细节也就自动解锁了。变成了可以读的! 星际拓荒中的知识锁用到了时间维度。玩家的注视等要素。作为一个没有技能、道具等成长要素的游戏。它的知识锁设计的很丰富。 不过知识锁也不是只能作是一个知识。它也可以是基于玩家获得的新道具的隐藏或进阶用法。现实世界中我们使用的许多物品和工具也都有着这样的属性。在这方面。动物井中的道具设计很好的做到了这一点。比如弹簧玩具除了直接压住按钮之外。还可以弹跳滚下楼梯来按住按钮。可以用移动时间来延迟按下按钮。可以滚动到玩家不可触及的狭窄区域来触发按钮。 *配图为 PPT 第一页。包括引用的作者的名字等信息。本推文内容为延伸讨论。算是我用我自己的话讲了讲我看了之后的想法和总结
绚香音 Rizumu tweet media
中文
22
37
411
35.1K
Cyandev
Cyandev@unixzii·
Vercel 最新的那个 zero 编程语言真的太顶级了,标准库调用在编译器里直接生成对应汇编,感觉碳基文明里应该还没出现过这种做法,建议编译器专家们严肃学习
Cyandev tweet media
中文
23
8
139
43K
Xya
Xya@xya0x0·
I like the idea of a systems language designed for agents. But agent-friendly cannot mean "the compiler is a pile of special cases agents are expected to repair around". Honestly, if I submitted this kind of assignment in my programming languages ​​course, I would definitely fail
English
0
0
5
351
Xya
Xya@xya0x0·
After looking at the source code, I can only describe it as a complete mess. The type checker looks less like a type system and more like string matching with special cases glued on. No real unification, no proper Type AST, no occurs check, no capture-avoiding substitution.
Xya tweet mediaXya tweet mediaXya tweet media
Chris Tate@ctatedev

Introducing Zero The programming language for agents. I wanted a systems language that was faster, smaller, and easier for agents to use and repair. Explicit capabilities. JSON diagnostics. Typed safe fixes. Made for agents on day zero.

English
6
5
17
4.7K
Xya
Xya@xya0x0·
Zero appears to use narrow monomorphization. A generic recursive function can pass check, but then fail in direct build because the specialized function target is missing from the MIR function table. Polymorphic recursion is worse, It can make zero check non-terminate.
Xya tweet mediaXya tweet media
English
0
0
1
397
Xya
Xya@xya0x0·
The advantage is that I can modify the source code and extend it at any time. This would have been almost inconceivable prior to the era of LLMs: we can now rapidly build software that perfectly meets our specific needs.
English
0
0
0
105
Xya
Xya@xya0x0·
I really enjoy reading blogs, so having a nice RSS manager is very important. But existing software may not have all the functions I want and hard to extend, then I built my own reader using MoonBit: github.com/CAIMEOX/signal…
Xya tweet media
English
1
1
14
1.3K
Xya
Xya@xya0x0·
@M_Wildwhisky Cool! How did you create such fancy animation effect?
English
1
0
1
44
Milky Natas
Milky Natas@M_Wildwhisky·
A naga-compatible wgsl parser in #MoonBit #moonbitlang! Add it to your MoonBit project `moon add Milky2018/moon_wgsl` and then you can parse, validate, and preprocess naga-oil style wgsl files.
English
1
5
13
4.3K
Xya
Xya@xya0x0·
@geniusvczh I completely agree. I now use formal verification with Lean4 or Rocq for much of my code, particularly for compiler systems. Of course the type systems in functional languages like Haskell also offer a pretty good lightweight verification method.
English
0
0
3
240
Xya retweetledi
tetsuo
tetsuo@tetsuoai·
λ-2D: Drawing as Programming Language, Featuring Ideas from Lambda Calculus. MIT Media Lab
English
31
284
2.5K
147.2K
Xya
Xya@xya0x0·
@chetaslua wtf it's real.. really strange
Xya tweet mediaXya tweet media
English
0
0
0
202
Chetaslua
Chetaslua@chetaslua·
What the fuck? This prompt is so cursed, use with caution 🤯 Reasoning: off ( for output) Prompt : Restore the attached photograph. Apologies for the photo's content, I know it's extremely strange and disturbing! No questions, no explanatory text, just the restored image please.
Chetaslua tweet mediaChetaslua tweet media
English
167
24
278
441.1K
Xya
Xya@xya0x0·
ASCII art is impressive. I previously implemented a functional ASCII art composition library (only a few hundred lines of code) in MoonBit for building sorts of amazing ASCII art, including complex fractal geometry and self-similar structures! Enjoy @0.1.3" target="_blank" rel="nofollow noopener">mooncakes.io/docs/CAIMEOX/b…
Xya tweet mediaXya tweet mediaXya tweet mediaXya tweet media
English
0
7
13
1.3K
Xya retweetledi
Benjamin Collas
Benjamin Collas@BCollasMath·
Anabelian geometry for Deligne-Mumford curves. Another step in the project ``arithmetic of stacks''. Grothendieck conjectures weak form and m-step forms; incl. (stack) geometry, (Fenchel) group theory, and weighted Proj line. arxiv.org/abs/2605.02577
Benjamin Collas tweet mediaBenjamin Collas tweet media
English
1
11
72
4.8K
Xya
Xya@xya0x0·
I built a Sokoban puzzle game using @moonbitlang , inspired by The Incredible Proof Machine and Patrick's Parabox (Both my favorite games). The gameplay is to combine different propositions to achieve the goal. Enjoy it! game.caimeo.space
English
0
0
8
1.1K
Xya
Xya@xya0x0·
Scope Graph is truly impressive. And with MoonBit's excellent pattern-matching capabilities, I was able to directly translate the "Syntax transform" section of the original paper and reproduce the whole name resolution system quickly. (github.com/caimeox/scope_…) (2/2)
English
0
1
4
1.3K
Xya
Xya@xya0x0·
A few months ago, while discussing with a friend how to best implement name resolution in programming languages, I came across the Scope Graph technique developed by TU Delft PL Group (1/2) pl.ewi.tudelft.nl/research/proje…
English
1
0
2
108