HNHacker News
TopNewBestAskShowJobs

s-zeng

83 karma · joined December 9, 2020

submissionscomments
s-zeng··on Python 3.15
Much like humans, language models have context limits. Abstractions exist for a reason, and good abstractions simultaneously make code easier to read for humans and easier to process for language models
s-zeng··on The complement of true is true, except when it's false
In any field of characteristic 2, every element is its own negative. So on the surface this makes sense, notwithstanding the unintuitive enum corner case behaviour
s-zeng··on Differences Between `Foldl` and `Foldr`
There's a relatively popular point of view amongst Haskell programmers that explicit recursion is the goto of functional programming; a dedicated folding or traversing function provides more clarity on what exactly the function intends to do. The extreme end of this is recursion schemes and memes like zygohistomorphic prepomorphisms, which are almost certainly overkill on lists proper but might be useful when traversing bigger recursive structures. Personally, I almost always prefer to find a monoid to map the list elements into, and use `fold :: (Monoid m, Foldable t) => t m -> m`. It's essentially the equivalent of using `sum()` instead of `reduce()` in python
s-zeng··on Differences Between `Foldl` and `Foldr`
A neat fact about foldr on lists, unlike foldl, is that it actually passes control flow entirely to the accumulating function on each fold step. That means you can use foldr to implement arbitrary traversals of lists, including foldl' or list traversals that exit early. See https://github.com/quchen/articles/blob/master/useful_techni...
s-zeng··on AX – Google’s Open Agentic Orchestrator
Kubernetes but for agents :(
s-zeng··on Anecdotally, programmers dislike "reduce"
Even in the world of functional programming, there's an argument to be made that `fold` is a bit of a code smell, in a similar vein as `while` being slightly smelly in an imperative code base. There's good reasons for each to be used, but they are such low level iteration primitives that you might be better off with a higher one (e.g. for loops or iterators in imperative programs; in FP you might reach for monoidic reduces (as opposed to folds where the accumulator is a different type from the list element), monadic traverses, or recursion schemes). Even though you can implement iterators or for loops in terms of while loops, you probably shouldn't, and similar for functional traversals.

In languages like python or Java though, you don't really have access to many of the higher power functional traversals however. So that puts you into a similar kind of bind as working in a language with only while loops

s-zeng··on Age verification for social media, the beginning of the end for a free internet?
I've really enjoyed playing around with https://github.com/markqvist/nomadnet and the reticulum protocol in general as a peer-to-peer alternative to www
s-zeng··on Think Linear Algebra (2023)
Matrix multiplication introduced before vector addition... the "Linear Algebra Done Right" in me is screaming inside.

That being said, it is definitely cool to have a Jupyter-notebook based set of examples of practical linear algebra

s-zeng··on Use the Mikado Method to do safe changes in a complex codebase
It's worth noting that a feature flag mishap is what brought down Knight Capital:

https://en.wikipedia.org/wiki/Knight_Capital_Group#2012_stoc...

s-zeng··on Launch HN: Recall.ai (YC W20) – API for meeting recordings and transcripts
Hi David and Amanda! Followed you guys from the very beginning, glad to see Recall.ai get so big!
s-zeng··on What would a Kubernetes 2.0 look like
Obligatory mentions of cuelang and dhall here. I've used both for kubernetes and other large configs in multiple software teams and both are significantly more of a joy to work with than HCL or yaml
s-zeng··on Programming languages should have a tree traversal primitive
Haskell already supports deriving Functor and Foldable
s-zeng··on Review of Mullvad VPN
Monads can be thought of as arbitrary function colourings, hence the prior mention of Haskell potentially being a good fit. Of course monads are implementable in almost any other language, but few have as much syntax sugar or general library support as Haskell does, except maybe Ocaml
s-zeng··on A Functional Introduction To Computer Science
Ragde is an excellent CS prof. I really enjoyed the functional approach Waterloo takes in first year CS, especially in the optional more advanced version of the course where they go a lot deeper into the math connections and interpreters
s-zeng··on Reddit Threatens to Remove Moderators from Subreddits Continuing Blackouts
Collectively, Lemmy and kbin instances (which federate with each other) just reached over 125k users or so. I've really enjoyed my time there so far.
s-zeng··on The halting problem is decidable on a set of asymptotic probability one (2006)
I think he might be referring to Rice's Theorem, which to be fair is reducible to the halting problem
s-zeng··on My thoughts on OCaml
A significant amount of these issues are solved by sticking to Core, Dune, and avoiding imperative blocks
s-zeng··on SICP: the end of an era (2021) [video]
But there are still highly specific tasks out there that require knowing stuff like what opcodes your compiler generated out of C code. Not every job or team is building a web app with nodejs and the like.
s-zeng··on Building a Startup on Clojure
> decent type system

I'd call it a bare minimum type system, not "decent"

s-zeng··on Why Racket? Why Lisp? (2014)
A smart enough compiler will eliminate 90% of unnecessary copying and things like linear/affine types will eliminate the rest
s-zeng··on BlueJ – A Lightweight Java IDE
Consider also Racket scheme! Has a great starter IDE, an absolute barebones teaching variant that exposes the minimum amount of primitives required to do computations, a repl, as well as a typed variant. Has braces for scope, extremely clear error messages with literal arrows tracing exceptions through your code, and is quite amenable to terminal prompt assignments.
s-zeng··on Why does nobody seem to know what imperative and declarative mean?
Taking a moment to plug https://dhall-lang.org/, a truly non-imperative solution in this space
s-zeng··on The Dhall Configuration Language
Count me as another big Dhall fan -- Dhall was a huge improvement on our codebase compared to Helm for large Kubernetes deployments.

Full disclosure: I maintain the [dhall](https://pypi.org/project/dhall/) package on PyPI

s-zeng··on Calling Rust from Python using PyO3
https://pypi.org/project/dhall/ uses PyO3 to reuse Rust's implementation to allow Python to load and dump Dhall configs, since no good and performant native python implementations exist. It's been quite pleasant for this purpose.
s-zeng··on Ask HN: What Niche Language to Learn?
Haskell