wini (@caramelows) header
wini (@caramelows) profile picture

consciences lie unguarded, foolishness is in demand

Joined August 2015
Photo by wini (@caramelows)Photo by wini (@caramelows)Photo by wini (@caramelows)Photo by wini (@caramelows)Photo by wini (@caramelows)Photo by wini (@caramelows)Photo by wini (@caramelows)Photo by wini (@caramelows)Photo by wini (@caramelows)Photo by wini (@caramelows)
oi eu vou usar essa conta pra postar coisas sobre programação e tal e ninguém se interessa por isso então se somos amigos siga @redstarstheory obrigado
1
2
2,467
Implicit state machines can be made unrepresentable by using mutually exclusive state variants and one-way transitions that consume the old state And there are only three usable programming languages for which this is possible: Rust, Haskell, and Swift
good prompt "find all of the implicit state machines in my app"
15
14
2
442
22,725
函数式的精髓不是函数,而在于类型系统。 map/filter/reduce 作为技术细节是次要的,换成 for-loop 也行。Local Mutation 也 Ok,甚至有 FBIP(Functional but In-Place)技术,进一步模糊了传统命令式/函数式的代码。 原博用同事秒看懂的案例,在 Agentic Coding 时代已经弱化了,不仅难以构成对函数式代码的攻击,甚至是反过来启示着—— 如果代码不需要被人类开发者秒看懂,甚至不是他们来写,函数式编程是否可以通过 AI Coding 普及? 找 null 案例很棒,但一来现在 AI 排障,报错日志对人的理解复杂度,不一定影响 AI 表现。 二来,函数式的精髓是通过类型建模,让一定区域(特别是 Core 区域)的代码,从类型检查上就拒绝 null,强迫 null 的代码位置从 core 外推到 shell。 这是一种根本上的解决问题的思路,如果一个问题反复发生,则将它外推,远离核心,最好是边界上的薄适配(Adapter),出错就被抓住,且影响范围小。 这个模式叫 Functional Core, Imperative Shell。 它几乎在所有软件层次中都存在。 在编程语言设计与实现层面, Purely functional programming language(如 Haskell)的 Purely 体现在代码里的 IO type 其实是 data,最外层有个 system wrapper 在反复解释 IO type 为外部副作用,并将副作用结果提纯后恢复/重跑程序(Agent Harness 也是这样哦)。 在宏观的软件架构层面,六边形架构/整洁架构,也呈现同样的模式。 掌握函数式编程的精髓,理解它背后的思想,在 Agent 时代也能发挥重要作用。 不要轻视函数式编程,在 AI 时代,它是更重要了。
很多刚刚掌握现代语言特性的年轻开发者,极度热衷于把业务逻辑压缩成一行极具美感的流式管道: 三层 map、接一个 flatMap、穿插两个三元运算符,最后用一个复杂的 reduce 收尾。 写完之后心满意足,觉得自己深得函数式编程精髓。 直到半年后的某天凌晨三点,线上突然抛出空指针异常,报警电话把你从睡梦中惊醒。 打开那一行凝聚了你全部智慧的优雅代码时,你会痛苦地发现: 你根本无法设置断点知道到底是哪一层 map 里的数据为 null; 堆栈跟踪里只留下一串毫无意义的匿名函数行号。 在现代工业软件开发里,代码被阅读、被排查、被修改的次数,远远超过它最初被写下的那一次。 老练的一线工程师在度过炫技期后,往往会极其自觉地回归到最朴素的风格: 写显式的 if err != nil、把复杂的长表达式拆解为带有明确语义的中间变量、提前做防御性 return。 这种代码看起来甚至有些枯燥乏味,但它能让半年后接手的同事在 30 秒内看懂逻辑,能在深夜排查故障时一眼看清每一个变量的状态。 在软件工程里,克制地使用智商,比放纵地炫耀语法高级得多。
9
26
4
209
23,501
LULA DA SILVA
2
54
i really don’t understand this idea that there is some concept of “good code” or “clean code” that existed totally independently of code that works correctly, performs well, and is easy to understand and modify. but i guess i was never a Ruby programmer.
7
9
3
264
9,664
this sent me down a bit of a rabbit whole and now I have kache installed and ported my filesystem to btrfs with zstd compression ~10x less disk usage when working with multiple worktrees significantly faster compile times amazing stuff
hot take but compile times are partially a skill issue
5
297
such a shame that apple music doesn't have a linux client
3
87
Another sneak peak: Every binary #nix #nixpkgs ever shipped, on your PATH. Nothing installed. Nothing built. 0 bytes on disk until something actually reads a file. 😈 Oh yea, and this works on any Linux distro (*cough* @OmarchyLinux ) and inside @Docker
29
10
5
199
19,780
additional funny part: llvm didn't get folded into gcc because of rms's idiosyncratic email setup lists.gnu.org/archive/html/e…
The funny part is that programming languages explosion happened because Apple invested in llvm and made it a success.
6
21
6
370
61,586
i hate computers
2
10
572
new pc!!
5
1
17
1,961
let's talk about squash merge! squash merge is a great example of how interfaces affect how we think about and manage our work because pull requests are based on branches, the unit of change is 1 *or more* commits
2
2
38
4,537
> there is nothing inherently political about software > it's about freedom of choice
Replying to @Pix3l_Peeper
Linus Torvalds created Linux. And there is nothing inherently political about software. It’s about freedom of choice.
6
191
i don't understand why people need things like cargo-hakari. why not just declare the full set of features needed by all crates on the workspace Cargo.toml? is it really that important that each crate specifies it's own set of features for each dep? i don't think so
151
my pre-CI step that usually takes 40 seconds to run now hangs without any indication of something going wrong #watdatmean
6
317
Replying to @nomad421
The Fil-C vs Rust debate is OVER Steve Krabnik has spoken:
18
31
11
487
78,254
The dishonesty of Fil-C comes from its complete ignorance of this reality and instead the constant comparison against Rust, it’s not a Rust competitor, it’s exploring a different trade-off space. Its innovation is keeping you in C (usability) trading performance.
2
1
77
1,953
fala serio como essa 1 linha de codigo equivale a isso tudo n entra na minha cabeça
1
2
255
the people yearn for patch sets, they just don’t know it
5
594
downright irresponsible to use this shit in production
Fascinating to look at PRs in the Bun repo: much of it is AI reviewers talking with AI bots...! CodeRabbit and Claude review bot talking with Robobun. Screenshot from this PR: github.com/oven-sh/bun/pull/…
6
275