News for hackers. Stuff that matters.

danidiaz

"ponderous pensées on human frailty by an apologetic autocrat"

From this article about a different emperor: https://www.lrb.co.uk/the-paper/v41/n04/christopher-kelly/a-...

Re:The Closing of the Bulgarian Frontier on Thursday December 21, 2023 @02:13AM (#38717898)
The memoir "Street without a Name: Childhood and Other Misadventures in Bulgaria" by Kapka Kassabova (2008) covers similar ground. https://www.goodreads.com/book/show/3808716-street-without-a...
Re:New Wave Sci-Fi: 75 Best Novels of 1964–1983 on Saturday November 25, 2023 @01:45PM (#38415511)
I would also recommend the site "Science Fiction Ruminations": https://sciencefictionruminations.com/

Lots of thoughtful sf book reviews with a heavy (but not exclusive) focus on the New Wave.

Re:RZK: Experimental proof assistant for synthetic ∞-categories on Thursday September 28, 2023 @02:27PM (#37693632)
I'm not a mathematician, but I feel the "syntethic"/"analythic" distinction in mathematics is an interesting and useful concept.

"In modern mathematics, an analytic theory is one whose basic objects are defined in some other theory, whereas a synthetic theory is one whose basic objects are undefined terms given meaning by rules and axioms"—Michael Shulman

In programming terms, I guess "synthetic" mathematics feels a bit like programming to an abstract interface.

https://ncatlab.org/nlab/show/synthetic+mathematics

In the first part of this video Cédric Villani gives (in French) a nice explanation of the distinction: https://youtu.be/xzVk56EKBUI?t=258

Edit: an English explanation, also by Villani: https://www.youtube.com/watch?v=AIrLXbwyYXQ

Re:91% of ML Models Degrade over Time on Friday April 14, 2023 @02:44AM (#35566284)
https://qntm.org/mmacevedo

> However, even for these tasks, its performance has dropped measurably since the early 2060s and is now considered subpar compared to more recent uploads. This is primarily attributed to MMAcevedo's lack of understanding of the technological, social and political changes which have occurred in modern society since its creation in 2031. This phenomenon has also been observed in other uploads created after MMAcevedo, and is now referred to as context drift.

Re:Pedagogical Downsides of Haskell on Thursday April 13, 2023 @01:10PM (#35558672)
> Purifying an (unnecessarily-) IO function into an ordinary function is a good exercise.

Agree! And I would add that you can "purify" a monadic function without having to rewrite it in non-monadic style. You can make it polymorphic over all monads and relegate the "impurity" to monadic functions that you pass as arguments/dependencies. A trivial example:

  twice :: IO ()
  twice = do
      putStrLn "foo"
      putStrLn "foo"
  
  twice' :: forall m. m () -> m ()
  twice' action = do 
      action
      action
This is not that different to having a Spring bean that doesn't perform any effect directly—say, a direct invocation to "Instant.now()"—but instead receives a "Clock" object through dependency injection.

Haskell lets you express the idea of "program logic that only has effects through its dependencies" by being polymorphic over all monads.

Re:A Lost World: On Travis Zadeh’s “Wonders and Rarities” on Wednesday February 15, 2023 @02:34AM (#34801079)
> Consequently, while al-Qazwīnī was wont to include tales about islands at the end of the world where women grew on trees and other dubious mirabilia, his purpose was lofty indeed.

Collections of marvels and extraordinary things were their own genre called ‘aǧā’ib. Here is an open-access example, "The Marvels Found in the Great Cities and in the Seas and on the Islands" https://library.oapen.org/handle/20.500.12657/46307

The classical world had a similar genre, paradoxography: https://en.wikipedia.org/wiki/Paradoxography

Re:SQL and M4 = Composable SQL on Wednesday December 28, 2022 @09:07AM (#34161060)
There's also jOOQ for Java. https://www.jooq.org/
Adult Swim's "Lords of Synth" comedy short contains a homage to Wendy Carlos in the form of a certain "Carla Wendos" https://www.youtube.com/watch?v=WXgNo5Smino

There's also the documentary "Sisters with transistors" about women pioneers of electronic music https://www.youtube.com/watch?v=7r-3hlzpV7M

Re:Domain Driven Design Reference (2015) [pdf] on Tuesday April 26, 2022 @02:35AM (#31164640)
> My own solution was to keep no entity state in memory and translate everything into DB updates immediately

Did you encounter some part of the domain which was difficult to "push down" into SQL?

Also, how would this compare with encoding your domain code in a bunch of stored procedures, largely skipping a "conventional" programming language?

Re:Two Vexing Problems in Functional Programming on Friday April 01, 2022 @12:47PM (#30880324)
> Consis­tent with my loyalty to the func­tional-program­ming idiom, I designed my initial bf imple­men­ta­tion so that each instruc­tion would copy the existing bytes into a new array, change the byte of interest, return this new byte array, and abandon the old array (which would even­tu­ally be garbage-collected).

This would be a fun task to attempt with the new linear features of Haskell https://hackage.haskell.org/package/linear-base-0.1.0/docs/D...

Re:Types versus sets (and what about categories?) on Thursday March 17, 2022 @03:25PM (#30714947)
A related answer in the CS Stack Exchange: https://cs.stackexchange.com/a/91345/5296

> type theory is not about syntax. It is a mathematical theory of constructions, just like set theory is a mathematical theory of collections. It just so happens that the usual presentations of type theory emphasize syntax, and consequently people end up thinking type theory is syntax. This is not the case.

Re:Failing in Haskell on Saturday February 26, 2022 @09:59AM (#30478035)
> If we need to compose these errors in a larger program we can simply wrap previous errors in a bigger sumtype

This approach is being adopted in GHC itself to compose errors happening at different stages of the compilation pipeline: each stage has its own error type which later becomes a branch of the global error type.

Another interesting post about errors-as-values in Haskell is "The Trouble with Typed Errors": https://www.parsonsmatt.org/2018/11/03/trouble_with_typed_er...

Re:Why are mathematicians so bad at arithmetic? (2017) on Friday February 04, 2022 @08:45AM (#30206680)
Maybe Grothendieck, like Avicenna's conception of God, only knew particulars "in as much as they are universal".

Grothendieck once flunked an exam due to—in his own words— "une erreur idiote de calcul numérique".

Re:My Elm Experience on Saturday January 22, 2022 @06:28AM (#30035767)
A recent video about -fdefer-type-errors: https://www.youtube.com/watch?v=hPVjA3TO9OI
Re:Jodd – The Unbearable Lightness of Java on Tuesday January 18, 2022 @02:18AM (#29976103)
Another useful feature of Spring is aspect-oriented-programming (like when we manage transactions boundaries with @Transactional).

Spring takes care of that, but doing it manually (and without dynamic proxies) would add to the verbosity.

Re:IETF: The HTTP Query Method ( Draft) on Tuesday January 04, 2022 @11:34AM (#29796665)
I think that, when talking about idempotency, there's the implicit assumption that the "rest of the world" stays the same while the sequence of operations is performed.

rfc2616 says:

> Methods can also have the property of "idempotence" in that (aside from error or expiration issues) the side-effects of N > 0 identical requests is the same as for a single request.

https://datatracker.ietf.org/doc/html/rfc2616#page-51

Perhaps changes in the underlying data could be considered "expiration issues". Otherwise not even GET could be considered idempotent in many cases.

Re:IETF: The HTTP Query Method ( Draft) on Tuesday January 04, 2022 @10:53AM (#29796114)
So that means that, without a cache, repeating a QUERY might create two response resources but, with a cache, only one will be created. I find that odd. My understanding of HTTP idempotency is that it's more of a "whole-server" concept (excepting perhaps things like creation of log entries and metrics). Always creating a new resource for each request seems contrary to that.

A way to square creation of response resources with idempotency could be: the second identical QUERY that arrives should always reuse the result resource created by the first QUERY.

Re:IETF: The HTTP Query Method ( Draft) on Tuesday January 04, 2022 @10:39AM (#29795896)
> QUERY requests are both safe and idempotent with regards to the resource identified by the request URI. That is, QUERY requests do not alter the state of the targeted resource. However, while processing a QUERY request, a server can be expected to allocate computing and memory resources or even create additional HTTP resources through which the response can be retrieved.

The possible creation of extra HTTP resources (response resorces?) seems to me contrary to idempotency. That seems more like the territory of POST.

If two identical QUERY requests might produce different response resources, how to square that with the the fact that QUERY will be cacheable?

Re:Parser Combinators in Haskell on Wednesday December 22, 2021 @01:08PM (#29652933)
This "Design Patterns for Parser Combinators" https://www.youtube.com/watch?v=RwzX1XltOGY video (an the associated pdf https://dl.acm.org/doi/abs/10.1145/3471874.3472984) explains some techniques that are good to know—how to deal with left recursion, for example.

It's also notable for being a continuous integration-driven talk!

Re:Wingman for Haskell on Sunday December 19, 2021 @03:17AM (#29612320)
A video about Wingman with detailed examples https://www.youtube.com/watch?v=S0HvfXq3454 including custom tactics https://www.youtube.com/watch?v=S0HvfXq3454&t=2139s
Re:Printf(“%s %s”, dependency, injection) on Tuesday October 19, 2021 @05:52AM (#28916457)
Once the graph of dependencies between components gets complex, passing all those beans as positional arguments might get tiresome, and type-directed autowiring begins to seem more appealing. Most of the information required for constructing the graph resides in the types themselves, after all.

DI frameworks also provide aspect-oriented-programming services (transactionality, logging...). Doing that with plain functions in an arity-polymorphic way is possible, but not completely trivial, in my (Haskell) experience. http://web.cecs.pdx.edu/~ntc2/haskell-decorator-paper.pdf

Re:An Introduction to Type Level Programming in Haskell on Friday September 10, 2021 @02:25AM (#28478398)
I once coded red-black-trees in Haskell at the type level and yes, I had to write some type-level tests.

In a real dependently-typed language the friction would be lower, because it's easier to put "normal code" at the type level.

Perhaps I could have skipped some type-level tests by introducing more kind-safety...

Older »