Filter
Exclude
Time range
-
Near
Replying to @SquidTakopi
yes, hiring is naturally worse since it is not as proliferated as Java. Compile times are definitely far worse for Rust, which can start annoying you for very large projects. Mature development patterns however are there, since Rust doesn't try to reinvent the wheel in this aspect, traits are just typeclasses
1
6
1,652
Replying to @o1lo01ol1o
I really think compiling to categories with typeclasses/records is a massively underrated approach here because it orthogonalizes everything and leaves categorification as the only skill needed to make it work
1
1
20
Surely you can't write good code in 2026 without generic typeclasses in the implicit scope, How else will I use my Isoprism monadic lens to invoke a setter function with extra steps? /s
1
3
74
Replying to @devabram
I thought traits try to mimic typeclasses?
2
3
332
Haskell learning update: - typeclasses are more intuitive than traits to me - this makes so much sense to me f = negate . sum . map length - When I look at this I see smiley faces :{ and :}
9
1
62
10,130
May 25
Sockets and Pipes by Type Classes is on sale on Leanpub! Its suggested price is $60.00; get it for $20.00 with this coupon: leanpub.com/sockets-and-pipe… @typeclasses #haskell
2
101
May 22
Yeah, exactly As a longtime C prog for gamedev from graphics to networking to MMO backends, I found Rust solved some easy problems in overly wordy ways, & solved nothing I really needed solving My needs are pretty niche but I still had hope Typeclasses are great though
2
13
May 19
从那个时候开始我就一直比较推崇 data functions ( typeclasses) 这样的抽象模式。 也就是整体程序组织是数据结构 算法,然后用某种通称 trait 的东西做泛型形式的代码复用。
May 19
Replying to @RizumuA3
面向对象最大的问题其实是对象是个全局上下文。这个我大概 2019 年的时候写 Apache Flink 就发现了。 所以你会遇到在方法里隐含的有个 this 指针能拖着可变上下文进来的问题。Rust 通过明确把 self 参数写出来,以及明确可变性,能够让 mental health 少受点伤害。 其他的问题跟具体语言关系较大。
1
1
25
5,823
Gallowglass also has typeclasses (as constrained-let codegen), mutual recursion (Tarjan SCC shared-pin in PLAN ISA), pattern-match exhaustiveness checking, and BLAKE3 content-addressed modules. Glass IR, the debugging language, is a strict subset of Gallowglass w/ annotations.
1
2
101
Row-polymorphic effect typing; every effect is locally visible in the signature with nothing hidden. let read_file : Path → {IO, Exn IOError | r} Bytes Effect annotation is explicit not implicit. (Full type system is Hindley-Milner plus row effects plus typeclasses.)
1
2
139
Gallowglass features include: * Row-polymorphic effect types: {IO, Exn IOError | r} Bytes * Algebraic effect handlers w/ resume * Typeclasses, mutual recursion, exhaustive matches * Pure by default; effects always in type signatures
1
2
133
May 15
Haskell 是一种纯函数式编程语言 主要控制结构是函数,它将所有计算都当作数学函数的求值(evaluation) Haskell具有“证明即程序、命题为类型”的特征 Haskell提供了一个结合了诸如类型类(typeclasses)和泛代数数据类型(generalized algebraic data types)等特征的非常现代化的类型系统 类型论既涉及编程也涉及逻辑 Haskell 是一门强类型语言 纯函数编程让Haskell程序员更好地理解程序,从而保证程序正确无误 尤其是在一个先进的类型系统的帮助下,我们能够发现更多的错误,无论是简单的还是复杂的 另外,个人觉得最重要的一点 Haskell 帮助程序员以数学的眼光来看待编程 学习使用 Haskell 建立函数式、范畴论、类型论思维模式 举例,Haskell 里应用的一个概念:范畴论 范畴论是一个极其有用的编程思想宝库 Haskell 程序员长期以来一直在利用这个资源 这些思想正在慢慢渗透到其他语言中,但过程太慢,我们需要加快速度 范畴论(Category theory)是数学的一门学科 是关于数学结构及其关系的一般理论 以抽象的方法处理数学概念,、 将这些概念形式化成一组组的“对象”及“态射” 数学中许多重要的领域可以形式化为范畴 范畴,本质上是一个简单的集合,包括三个组成元素: * 对象(objects) * 态射 (morphisms)或 映射(maps) 或 箭号(arrows) * 态射组合(morphisms composition) 有了类似范畴论的引入,Haskell 代码展示将会伴随其对应的数学定义 我们也会发现有更多的数学概念和理论引入到这门语言设计中,参考 wiki.haskell.org/index.php?t… 数学是科学的元领域 有了这种以数学为DNA的纯函数编程语言的设计 也将帮助更多科学领域与计算机科学的更好融合 计算科学、计算数学、计算物理学、计算化学 计算生物学、计算神经科学、计算语言学 ... 感兴趣的朋友可从 《Haskell函数式编程入门》了解学习 Haskell

May 15
Free Book 《Category Theory for Programmers》CC License Version 36 (98b71ac) January 30, 2023 github.com/hmemcpy/milewski-… A book about category theory that would be targeted at programmers. Mind you, not computer scientists but programmers — engineers rather than scientists. Also which is supposed to motivate the reader to learn category theory Category theory is a general theory of mathematical structures and their relations. Category theory can be used in most areas of mathematics. In particular, many constructions of new mathematical objects from previous ones that appear similarly in several contexts are conveniently expressed and unified in terms of categories. Examples include quotient spaces, direct products, completion, and duality. OCaml Edition Contains code snippets in Haskell and OCaml github.com/hmemcpy/milewski-… ReasonML Edition Contains code snippets in Haskell and ReasonML github.com/hmemcpy/milewski-… Scala Edition Contains code snippets in Haskell and Scala github.com/hmemcpy/milewski-…
12
69
7,171
Like, you can do "equational thinking" with Haskell in a much more straightforward way, and typeclasses and all the other shebangs do actually make way for "smoother" code
1
2
98
Unfortunately, I don't use Zig now. Every 1.5-5x human DX productivity boost from Zig features is eclipsed by the 100x boost from coding agents writing Rust: Allocator interface: This is my favorite Zig feature, you feel so galaxy brain using a specialized allocator to optimize a code path (e.g. arena, stack fallback etc). The problem in Rust used to be that there was no Allocator interface equivalent and if you wanted a Vec<T> that used a custom allocator you literally had to copy paste the std version and modify it to use it (this is what Bumpalo did, look at the source). For a long while now there has been an Allocator trait in nightly, and it seems to be good now. Because it is a trait it is static dispatch, vs Zig's which is based on a vtable. Unlike Zig there isn't a community-wide convention of designing data structures to be parametric based on the allocator, but AI changes the game and makes it trivially to copy paste code and change that. I find it works well enough for my use-case. Arbitrary bit width integers packed structs: Another beloved Zig feature of mine. It makes it so easy to do DOD-style CPU cache optimizations and stuff like tagged pointers, NaN boxing, etc. and even made bitflags really easy to make. You could always do this in Rust or any systems programming language but it was really ugly/unergonomic. The least worst option was using some crate like bitfield/bitflags which both rely on proc macro magic to work. Now, with coding agents I literally do not care how annoying it is to write the code by hand. Comptime: This is Zig's flashiest feature, no other programming language except maybe for obscure dependent-types langs have compile time evaluation as nice as Zig's. I thought I would miss it a lot, but I actually don't. For me, 95% of comptime usage is to create Zig's version of generic data structures with parametric types. Rust has a better designed type system IMO (see next section). In the remaining 5% of cases, not having comptime sucks. The only reliable way to reach an equivalent is through codegen. I'm making a game right now, and I have hardcoded hitbox geometry data generated from a tool that I want to bake into a data structure. Without comptime, I have to get Claude to write a script that generates the Rust file. However, I don't find myself needing compile time evaluation that much anyway. Rust's type system: I think I'd rather trade having comptime for Rust's better-designed type system, especially for bounded polymorphism (traits/typeclasses). Trying to do the equivalent in Zig is a nightmare. Also, I think that Rust's type system allows you to enforce more variants and prevent coding agents from making common mistakes. In my game I use the euclid crate which essentially allows you to not mix up coordinate spaces (very common problem in graphics programming) by creating specialized types for each coordinate space (e.g. Point<Screen> or Point<World>) Not having to deal with memory issues: With coding agents allowing 100x more code to be written, this also means you need to scrutinize 100x more Zig code for memory issues. Without formal verification, the surface area of the search space to enumerate to find bugs is just so much larger now. With the magnitude of code being generated now, Rust is even more attractive. Rust's tradeoff was always that it hinders developer productivity especially if you are unfamiliar with borrow checker, but this simply does not matter with coding agents anymore. And if you do use unsafe in Rust there's tools like miri which you can have the coding agent run the code against to make sure it doesn't cause UB or isn't violating Rust's aliasing rules when it comes to unsafe. I still miss writing Zig and find it to be a great language but I like Rust more and coding agents work with better with it.
It's not a question anymore, most of Zig's best features were designed for human ergonomics, which matters less now All of Rust's best features came at the cost of added verbosity, which applies less to agents because they have superhuman working memory and never get tired
32
72
1,093
185,120
Replying to @Aron_Adler
Yeah, I wish more languages had helpers for easy types like this Record types help quite a bit, and rusts typeclasses can make things decent
2
27
@effectfully @JustDeezGuy @renzocarbonara @onehappyfellow What are some good resources about "How to build Typeclasses", "How to uncover algebraic structures from your domain" that shows some real world uses of Typeclasses? I'm looking to understand "How to think" in TCs
3
8
156
Replying to @JustDeezGuy
TL:DR: long verbose names hide choices in identifiers nobody can grep for. Tables make every choice findable by listing. That eliminates the "I didn't know that existed" bug class structurally instead of mitigating it with documentation. I think that it is worth adding a third path: pull the disjunction out of the name and into a dispatch table: atomic_file_op(strategy, src, dest) STRATEGIES = {'replace': ..., 'rename_if_missing': ...} The function stays first-order. The abstraction is data. STRATEGIES.keys() is the full design surface, enumerable at runtime. Both paths you describe are mitigations. Long names mitigate discoverability after the fact (you find the name in docs, then you can write it). Typeclass ceilings mitigate verbosity by inference. The dispatch-table move doesn't mitigate either, because the underlying problem is gone: the disjunction that was bloating the Jai identifier is now data you can grep (or even vgrep) easily. This generalizes across my extension of Honest Code into honestframework.software. Dict-dispatch over if/elif, TypedDicts over classes, recognizers (predicates over data) over typeclasses. Doesn't scale to category theory; scales fine to applications. Every choice point is a key in a dict you can list.

1
1
3
873
GHC 2024的GADT和多参数Typeclasses比那个老旧的Haskell 2010好用多了。
2
359