Better HN
topnewbestaskshowjobs
Log inSign up

danidiaz

628 karma · joined Dec 22, 2012 (13y ago) · 278 submissions

productivedetour.blogspot.com
Submissions

1.

Machinery and English Style (1904)(theatlantic.com ↗)

9 points · by danidiaz · 9mo ago · 1 comment

2.

Hell (Haskell Shell): Year in Review(chrisdone.com ↗)

3 points · by danidiaz · 1y ago · 2 comments

3.

PenroseKiteDart(readerunner.wordpress.com ↗)

2 points · by danidiaz · 2y ago · discuss

4.

Facts vs. Opinions(sootyempiric.blogspot.com ↗)

2 points · by danidiaz · 2y ago · 1 comment

comment 2y ago · link · parent

"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-...

comment 2y ago · link · parent

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...

7.

Facts and general information relating to pneumatic despatch tubes (1897)(gutenberg.org ↗)

1 points · by danidiaz · 2y ago · discuss

comment 3y ago · link · parent

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.

comment 3y ago · link · parent

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

comment 3y ago · link · parent

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.

comment 3y ago · link · parent

> 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.

12.

Artificio de Juanelo(en.wikipedia.org ↗)

3 points · by danidiaz · 3y ago · discuss

comment 3y ago · link · parent

> 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

comment 3y ago · link · parent

There's also jOOQ for Java. https://www.jooq.org/

comment 3y ago · link · parent

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

comment 4y ago · link · parent

> 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?

comment 4y ago · link · parent

> 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...

comment 4y ago · link · parent

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.

comment 4y ago · link · parent

> 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...

comment 4y ago · link · parent

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".

comment 4y ago · link · parent

A recent video about -fdefer-type-errors: https://www.youtube.com/watch?v=hPVjA3TO9OI

comment 4y ago · link · parent

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.

comment 4y ago · link · parent

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.

comment 4y ago · link · parent

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.

comment 4y ago · link · parent

> 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?

comment 4y ago · link · parent

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!

comment 4y ago · link · parent

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

28.

Writing about Haskell is Hard(anthony.noided.media ↗)

10 points · by danidiaz · 5y ago · 5 comments

comment 5y ago · link · parent

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

12345
10