iRihttp://www.jerf.org/iri/Tagline pending.en-usMon, 19 Jul 2021 13:17:53 -0000 I&#39;ve said a few times on Hacker News over the years that I don&#39;t think ... http://www.jerf.org/iri/post/2959 <p>I've said a few times on Hacker News over the years that I don't think you can have a single shell language that covers the interactive and programmatic use cases, but I have not yet talked through it enough to myself to crystallize the point.</p> <p>I think I have it now.</p> <p>Interactive shell usage is optimized for the fact that a human will be examining the state of the world after every shell command. Programmatic shell usage is optimized for the fact that computer will be examining the state of the world after every shell command. I contend that the gulf between these two use cases, and the type and degree of intelligence being brought to bear by the two parties, is too large to be optimally covered by one language.</p> <p>A language must either privilege interactive use over programmatic use, in which case you get existing shell languages whose affordances run actively counter to what is needed to make it safe to run with a computer as the responsible party, or it must privilege the sorts of things that make it easy to trust a computer driving, at the cost of making it too tedious for real-time usage.</p> jerf@jerf.org (jerf)Mon, 19 Jul 2021 13:17:53 -0000http://www.jerf.org/iri/post/2959Programming Functors and Monads For People Who Have Read Too Many &quot;Tutorials&quot; http://www.jerf.org/iri/post/2958 <p>Title is literally true. This may not be the best place to learn about these concepts for the first time, because I'm going to focus on knocking down the misconceptions about them.</p> <p>Then again, it may not be the worst place, for the same reason.</p> <p>I had promised myself I would not add to the pile of functor or monad "tutorials", but I've been worn down. I gave up when I saw a reddit comment complaining about how Functor was "too hard to understand", which made me sad, because the correct response to the Functor interface is, "That's it?". And while Monad is legitimately a bit more interesting and complex, the correct response to that is not that different.</p> <p>I am aware of the notorious effect that people "get" monads and then post their own idiosyncratic takes on them. In my defense, this isn't something I write just after my "ah ha!" moment, I've understood them in Haskell's context for many years now, and actually... this isn't even about that "ah ha!" moment at all. This is only about <i>what they are</i>. Even if you completely understand everything I write in this post, the real "ah ha!" where you realize just how useful the libraries built up around the monad interface are, the first time you search for a type on <a href='https://hoogle.haskell.org/'>Hoogle</a> where you're like <i>this should exist</i> and it turns out it does in fact exist already, that's still in your future. In fact I'm quite <i>deliberately</i> not trying to convey that feeling in the interests of getting at simply <i>what the monad interface is</i>. Which isn't, strictly speaking, a pre-requisite to that experience, but it does help.</p> <p><a href="http://www.jerf.org/iri/post/2958">Read the rest...</a></p> jerf@jerf.org (jerf)Tue, 25 May 2021 14:07:12 -0000http://www.jerf.org/iri/post/2958ProgrammingHaskell Interfaces and Nil in Go, or, Don&#39;t Lie to Computers http://www.jerf.org/iri/post/2957 <p>It is commonly held up as a wart in Go that interfaces have "two different nils"; one is when the interface value is nil:</p> <pre>var something interface{} fmt.Println(something == nil) // prints true</pre> <p>and one is when the interface contains a nil:</p> <pre>var i *int // initializes to nil var something interface{} = i fmt.Println(something == nil) // prints false</pre> <p>This is not a wart in Go. It is a result of a <b>programmer misconception</b> combining with a <b>software engineering bug</b> which results in an <b>attribution error</b>.</p> <p><a href="http://www.jerf.org/iri/post/2957">Read the rest...</a></p> jerf@jerf.org (jerf)Tue, 11 May 2021 13:41:18 -0000http://www.jerf.org/iri/post/2957ProgrammingGolang Pray. http://www.jerf.org/iri/post/2956 <p>Pray.</p> jerf@jerf.org (jerf)Wed, 04 Nov 2020 14:53:55 -0000http://www.jerf.org/iri/post/2956Bloviation Why Go Getting Generics Will Not Change Idiomatic Go http://www.jerf.org/iri/post/2955 <p>After years of overly-acrimonious online discussion, Go is continuing down the chute towards getting generics. I'm already seeing the inevitable "functional" libraries (plural) coming out. I'm going to explain why none of these libraries are going to materially impact <i>what the community considers good style</i>.</p> <p>They may see some use. I may even use some of them myself on small scales. Some iconoclasts will program with them extensively, and their code will work, in the sense that it will do what it was designed to do regardless of how the code reads. But they are not going to change what generally-good style is considered to be.</p> <p>Edit: May 2021 - Update for the latest generics syntax.</p> <p><a href="http://www.jerf.org/iri/post/2955">Read the rest...</a></p> jerf@jerf.org (jerf)Mon, 03 Aug 2020 14:10:06 -0000http://www.jerf.org/iri/post/2955ProgrammingGolangHaskell