HNHacker News
TopNewBestAskShowJobs

momentoftop

405 karma · joined December 11, 2018

submissionscomments
momentoftop··on A brief, incomplete, and mostly wrong history of programming languages (2009)
I was at Edinburgh when this came out, and it went round the mailing list. Wadler replied saying he wasn't aware of the fact, and wanted to know the proof.

I was sharing an office a few floors down with Roko of Basilisk fame, who was the category theory guy. He thought about it for a few minutes and then took us through the proof on the board.

momentoftop··on Why F# evangelism isn't working (2015)
Are you thinking of preprocessors? Back then, it would have been via Camlp4 and Camlp5.
momentoftop··on Why F# evangelism isn't working (2015)
You're thinking of Haskell. F# was modelled after OCaml, which doesn't attract monad transformer stacks, and doesn't have a zoo of compiler extensions.
momentoftop··on Why don't we define “imaginary” numbers for every “impossibility”? (2012)
Ah, thanks for the link. I suggested the reason that Isabelle/HOL does this is because it requires total functions and you don't have a convenient way to do refinement types. But that's not an adequate explanation, because Lean does allow such refinements, but it still turns out to be inconvenient for division.

I will note that setting a - b = 0 for a <= b is pretty standard, and is often called "partial subtraction."

momentoftop··on Why don't we define “imaginary” numbers for every “impossibility”? (2012)
The theorem a/b * c/d = ac/bd doesn't hold if x/0 = 6, though.

The theorem prover HOL Light is a close cousin of Isabelle/HOL and doesn't adopt this, and just says that x/0 is some unspecified number. You can't prove much interesting about it. You can prove, say, that x/0 * 0 = 0, but you can't prove whether or not x/0 is, say, positive or not.

If you prefer null, there was a logic that allowed for undefined terms and partial functions that became the basis of the IMPS theorem prover. I found it most notable for the fact that it doesn't have reflexivity of equality: 1/0 = 1/0 is false in IMPS.

momentoftop··on Why don't we define “imaginary” numbers for every “impossibility”? (2012)
Exactly.

Functions in these logics are total, so if you want division to be a function (and you probably do), it has to assign something to division by 0.

It would be acceptable to assign an unspecified object from the domain, for which you have no non-trivial theorems, and so all your real theorems must have a precondition about the denominator being non-zero. But if you specify a candidate like 0, you can get some theorems which don't have the precondition. Consider:

a/b * c/d = ac/bd.

This now holds even if one of b or d is 0.

momentoftop··on Why don't we define “imaginary” numbers for every “impossibility”? (2012)
The Isabelle/HOL theorem prover assigns 0 to x/0 for all x, without contradiction.
momentoftop··on GitHub Actions Incident 29.3
It's a request to the owner of some reference in a Git repository to pull in some changes from some reference in some (possibly other) Git repository. You can do this via email, but centralised Git hosts like Github have their own interface to this basic workflow.
momentoftop··on Web fingerprinting is worse than I thought
I understand the principle. I'm saying that the test on this page isn't demonstrating uniqueness, and so isn't demonstrating fingerprinting.

The first time I heard about fingerprinting was with EFF's panoptoclick, which stated how many hashes had been generated from visitors, and how many you shared with them.

momentoftop··on Web fingerprinting is worse than I thought
I don't understand the test on this page. It says we should be worried because a fingerprinting website generates the same hash even after you clear your cache and site-data, and even if you go into a private tab. But I'm not overly concerned by this, provided I share that hash with other people.

The worry would be that the hash is unique to me (i.e. a fingerprint), but I don't see the evidence that it is.

momentoftop··on Why use Rust on the back end?
OCaml has dune/opam, OCamlfmt and Merlin. I don't know how Rust can blow these out of the water, but would be interested in comparing killer features.

I mean, OCaml's autoformatter just autoformats arbitrary Ocaml files. How do you blow that out of the water?

momentoftop··on Nix-Powered Development with OCaml
It's a bunch of optimisation passes, I believe mostly around inlining. Ocaml is historically quite passive on that.
momentoftop··on Nix-Powered Development with OCaml
Nix can replace opam, which is the dependency manager supporting isolated ocaml environments. I generally try to use Ocaml now without opam, and just using Nix.

You'll still want dune, though I could see an argument for generating the dune files from nix expressions.

momentoftop··on All you may need is HTML
LaTeX predates HTML by a decade and supports pictures, charts, quotes and far more, and doesn't force me as an author to make finicky decisions about presentation. I just write the content, and then set the document class to whatever the publisher wants.
momentoftop··on SICP: the end of an era (2021) [video]
You can do tail call optimisation when the last thing you do before you return is a call. That tail call is not necessarily recursive, let alone a call to yourself. Whatever it is, its position means your current stack-frame can be reclaimed before you jump.

If you can only optimise calls to yourself, you have a very limited form of tail call optimisation. It's an important point in the context of Scheme, where they made a big deal out of experimenting with continuation passing style. In CPS, all function calls are tail calls, and you want to optimise them all, even though most are not recursive.

momentoftop··on Functional programming should be the future of software
Yep, though it's got type-classes specifically from Haskell.
momentoftop··on Functional programming should be the future of software
That article went round the Edinburgh mailing list when it was published, and Phil Wadler, who got monads into Haskell, replied saying something like "I didn't know this. Does anyone have the proof?"

The actual quote that monads are monoids in the category of endofunctors comes from MacLane, and is intended for mathematicians.

momentoftop··on Transmission 4.0.0 beta 1
As soon as it lands in transmission, I will start seeding my favourite peertube videos 24/7, and I hope others will do the same. Unless peertube videos are typically being seeded like this, I'm sceptical of the platform.
momentoftop··on List of Creepypastas
Here's one crossover: the Blair Witch Project was marketed as an Alternate Reality Game, as were many of the later low budget found-footage horrors. It turns out that the top-of-the-list creepypasta "Slender man", in the form of the "Marble Hornets" youtube series, was mistaken for an ARG by the members of Unfiction.

https://en.wikipedia.org/wiki/Alternate_reality_game

momentoftop··on OCaml at First Glance
> Some projects use tons of variation of `>>=`, other use `let%bind`

It gets better. Since 4.08, the preference would be `let*`.

momentoftop··on An Intuition for Lisp Syntax (2020)
> This is useful for compiler programmers, or maybe also those writing source code analyzers/optimizers, but is that it? On occasion I have had to write DSLs for the user input, but in these cases the (non-programmer) users didn't want to write Lisp so I used something like Haskell's parsec to parse the data.

If you're talking about Haskell, you should be talking about folk who write template Haskell, which is the macro system for GHC. There are plenty of Haskell programmers who know how to write Template Haskell, and there are plenty of Haskell programmers who don't. By contrast, I don't think there's a single Lisp programmer who can't write Lisp macros.

That's homoiconicity. Once you learn Lisp, you automatically know how to write Lisp macros. Once you learn Haskell (or Ocaml or Rust), you don't automatically know how to write macros in that language (and the macro system may not even be portable across compilers).

momentoftop··on 3-Lisp: an infinite tower of meta-circular interpreters
My understanding (it's been well over a decade since I read Brian's paper) was that 3-lisp was the direct inspiration for the CLOS Metaobject Protocol. The semantics of CLOS are given in terms of CLOS, and as a reflective object system, you can happily intercede and change those semantics.
momentoftop··on John Carmack's new AGI company, Keen Technologies, has raised a $20M round
Throughout the Wolfenstein codebase, he spelled "column" with two "l"s.
momentoftop··on Black holes finally proven mathematically stable
If the proof is that size, I'd leave it out of my thesis proper, and just provide a link to it as a stable artifact.
momentoftop··on Why the Windows Registry sucks technically (2010)
I think it's all too easy to say they should have just used an existing language. The most obvious feature of the nix language is that it's lazy, because they want their enormous collection of configuration dictionaries computed on demand. There are no mainstream languages that are lazy.

Well, there's Haskell, and I expect any Haskell programmer to be able to pick up Nix very quickly.

Guix has gone with a strict language, Scheme, but I understand they have their own monadic DSL to cope with the peculiarities of following the Nix model. So again, not something that a mainstream language can do well, and even as a Schemer, you're going to have to learn their macro language.

momentoftop··on Why the Windows Registry sucks technically (2010)
They're already getting decent reproducibility of their curated package set, but some of us want to pin to a particular version of this, especially when creating our own private packages. That's where I'm finding I really want pinning.

The latest release has included "flakes", promoted from an add-on to an opt-in feature and which, among other things, lets me pin my dependencies and the environment I need to build my private projects. I then don't have to worry about going out of sync with the main package set, and I can share private projects in a (hopefully) fully reproducible way, with people using different versions of nix.

https://xeiaso.net/blog/nix-flakes-1-2022-02-21

momentoftop··on Buttery Smooth “10fps” (2020)
For most realtime 3d animation, I wonder whether it's that the camera effectively has an infinite shutter speed, so you lose the natural motion blur you get when real film and our retinas get exposed to short durations of changing light. That changing light and blur carries information that is not rendered by most games. Quadrupling the frame rate will add some of it back?
momentoftop··on Ante: A low-level functional language
It's pretty easy to reason about that particular example if you have a type system. In a simply typed language, "f f x" is just a type error, so it doesn't do anything. In the polymorphic lambda calculus, the typing will force f to either be the identity, meaning that "f f x = x", or it will be a constant function, so you just replace "f f" with the constant.
momentoftop··on OCaml 5.0 Alpha Release
ReasonML is now Rescript, and is still using the 4.06 compiler. I think the idea is to move ahead largely independently of Ocaml, and that a move to 5.0 now is probably seriously ambitious given the runtime overhaul.
momentoftop··on OCaml 5.0 Alpha Release
Is there any plan to have effect types like in koka, where the effects that a function performs are visible in the type, and handling an effect eliminates it from the function's type?
← PreviousPage 2 of 5Next →