HNHacker News
TopNewBestAskShowJobs

mrkgnao

1,913 karma · joined March 29, 2016

submissionscomments
mrkgnao··on Maryam Mirzakhani, first woman and Iranian to win Fields Medal, has died
Her work was in (the more visualizable parts of?) geometry/topology.
mrkgnao··on Maryam Mirzakhani, first woman and Iranian to win Fields Medal, has died
I hope to study (non-inter-universal) Teichmueller theory some day, as a side quest on my own journey (which is vaguely directed in some sense toward number theory at present). It's the best way I can think of to honor her memory: to learn to appreciate the ideas that she devoted her life to understanding better.

Here is a picture of her drawing on one of her vast sheets of paper.

https://news.artnet.com/app/news-upload/2014/08/Maryam-Mirza...

mrkgnao··on ZFS Is the Best Filesystem For Now
not* provided?
mrkgnao··on Why you should, actually, rewrite some of it in Rust
HN supports a funky subset of Markdown. :(
mrkgnao··on Why you should, actually, rewrite some of it in Rust
The URL is slightly misleading: yes, you can call Haskell from C++.

https://stackoverflow.com/questions/3859340/calling-haskell-...

mrkgnao··on Owl – An OCaml Numerical Library
I didn't think "algorithmic differentiation" meant automatic differentiation. Instead:

https://arxiv.org/abs/1610.07690

mrkgnao··on What’s in a Continuation (2016)
> It takes three callback functions: "before", "during", and "after".

Does this remind anyone of MonadBaseControl from the Haskell package monad-control?

mrkgnao··on Why We Chose Typescript
, yes Purescript :)

For those new to this, good search terms are "row polymorphism", "extensible records", and "polymorphic variants".

mrkgnao··on Why We Chose Typescript
I'm pretty sure that's just "administrative" and imposed by the syntax (e.g. think Java/C++ function declaration syntax), instead of being something the compiler can't infer. Thanks for clearing this up, though.
mrkgnao··on Why We Chose Typescript
Haskell:

  factorial n =
    if n < 2 
      then 1
      else n * factorial (n - 1)
I think the OCaml version will look almost exactly like the F# one.
mrkgnao··on Why We Chose Typescript
> infer recursive functions

Any of the mainstream functional languages (which are most likely to have type inference) can infer the types of all functions, unless you use funky language extensions that make type inference undecidable. Rust has a Hindley-Milner system, so it should be able to "infer recursive functions" too (but I can't say for sure since I don't use it).

mrkgnao··on Math 115A – Linear Algebra – Terrence Tao
Mods: Terence* Tao.

Not sure why this is so common: perhaps the Terry form of the name?

mrkgnao··on Hacks Raise Fear Over N.S.A.’s Hold on Cyberweapons
https://en.wikipedia.org/wiki/Dead_Hand_(nuclear_war)
mrkgnao··on Why is the function SHStripMneumonic misspelled?
The correct link to the IOCCC entry is:

http://www0.us.ioccc.org/1987/hines/hines.c

mrkgnao··on Stop Buying Things and Start Borrowing Them
Indeed, Meer and See are excellent words.
mrkgnao··on Luna – Visual and textual functional programming language
This looks really beautiful: what's it written in?

Also, "Num in IO", nice. Now we wait for someone to write a "(Num in IO) in IO" action.

mrkgnao··on Capacity and Trainability in Recurrent Neural Networks
Context: the submission was originally titled "Google Brain: Experimental Limits of RNNs [Technical]".
mrkgnao··on Tabs, spaces and your salary – how is it really?
http://www.tylervigen.com/spurious-correlations
mrkgnao··on Stop Buying Things and Start Borrowing Them
> borrow to someone

lend.

I think some European languages have the same word for both lend* and borrow (German?): is that actually the case?

mrkgnao··on [dead]
Ah, an ad for the next Markdown-APL.
mrkgnao··on Go and Simplicity Debt Redux
Good compilers don't keep immutable things immutable at runtime, but turn uses of clean high-level functional code into tight C-like loops.

https://donsbot.wordpress.com/2010/02/21/smoking-fast-haskel...

It's been seven years since: that's GHC 6.13, and GHC 8.2.1 is being released soon. Performance is even better now as long as laziness doesn't bite you (which is much less rare than people think).

> you won't be able to convince him that a standard recursive-descent parser is 10x simpler to write and read

I don't know what a "compile-time parser" is, but someone used to a good parser combinator library is going to be difficult to convince.

http://www.haskellforall.com/2017/06/translating-c-parser-to...

It reads like the formal spec of the language. Hand-writing recursive descent parsers isn't fun (given a sufficiently complex grammar) and expecting people to accept it as the One True Practical Non-Ivory Tower Way (and expressing dismay at not being able to convince them otherwise) is suggestive of monoculture, the kind that prides itself on copying code and using wrappers over the two or three first-class data structures that exist in the language for everything.

mrkgnao··on Go and Simplicity Debt Redux
No, it's meant as a warning against the trappings of explosive popularity. A language like C++/Java/JS is difficult to modify because of how entrenched the usage of the language becomes. In that sense avoiding "success at all costs" (which is how it should be parsed) allows "agile" development of the language.
mrkgnao··on Georgia Tech's free math textbook collective
http://stacks.math.columbia.edu
mrkgnao··on Elon Musk Publishes Plans for Colonizing Mars
"The Rust Evangelism Strikeforce lingers in the distance, not sure how to leverage the color of Martian dust to their advantage but convinced of the feasibility of the endeavor."
mrkgnao··on Things that Idris improves things over Haskell
I've been experimenting with answering that question.

An extremely heavily-commented approach to defining equality for things like Double (where there are multiple sensible ways to compare things) will probably be a better introduction to these ideas:

https://github.com/mrkgnao/noether/blob/master/library/Noeth...

https://github.com/mrkgnao/noether/blob/master/library/Noeth...

The rest of the repo implements abstract algebraic structures along similar lines.

Here is what monoids look like in this formalism at present. It's a bit involved: first I use a fine-grained separation into highly polymorphic Magma and Neutral classes:

https://github.com/mrkgnao/noether/blob/master/library/Noeth...

And there are "strategies" for combining those pieces of structure, whose use looks like

  type instance MonoidS (op :: BinaryNumeric) Rational 
    = DeriveMonoid_Semigroup_Neutral op Rational
Which means "derive the preferred monoid structure with operation op" (MonoidS op) on Rational from the preferred semigroup structure and preferred neutral element on it with that operation.

https://github.com/mrkgnao/noether/blob/master/library/Noeth...

You can always use some other monoid structure for the same combination of type and operation (!) if you like. For instance, here's a demo of using the self-action of a ring on itself (i.e. considering a ring as a module over itself) to compute something, even if your preferred choice of action has been declared to be something else (or hasn't been defined at all).

https://github.com/mrkgnao/noether/blob/master/library/Noeth...

This says "here, use the self-action derived from the multiplicative magma structure on R".

mrkgnao··on Harmony Explained: Progress Towards a Scientific Theory of Music (2014)
From the homepage:

> Lyra is a non-profit, non-invasive communication service which aims to enable deep and meaningful conversations.

Seems like a Slack/wiki hybrid.

mrkgnao··on Things that Idris improves things over Haskell
Doesn't mono-traversable/classy-prelude solve this?
mrkgnao··on Things that Idris improves things over Haskell
AFAIK -XDuplicateRecordFields and -XOverloadedRecordFields solve this now, creating a typeclass for each of the record labels. In this case, the compiler would generate a HasName class. (This is conceptually similar to classy lenses, but minus the TH.)
mrkgnao··on Rust as a gateway drug to Haskell
I'm under the impression that SPJ made that comment thinking of adoption (for a future "regrettably popular" Haskell), since the difficulty of reasoning about laziness does put people off. I might be wrong though: maybe he was arguing that laziness doesn't warrant the user and compiler-author cost it brings. I don't remember where I picked this up from.

Idris is strict too, but optional laziness is built into the compiler with the use of a special-cased Lazy wrapper of the form

  data Lazy a = Delay a
This is kind of the opposite of strictness annotations (bang-patterns) from Haskell, except one doesn't need to pattern-match on Delay or use it to wrap arguments to functions expecting Lazy values. The Idris compiler can do something like "laziness analysis" (admittedly trivial in comparison to GHC's strictness analyser) to introduce and eliminate Delay constructors automatically. The laziness information is carried around in the types:

  force : Lazy a -> a
  force a = a
https://github.com/idris-lang/Idris-dev/wiki/Unofficial-FAQ#...

(purescript-lazy is also a thing, but I think it's not as seamless because of the "no compiler magic" position.)

In any case, what about -XStrict? I've never used it (or -XStrictData either), but isn't it a solution to the laziness problem, albeit a nuke-ish one at that?

And while we're thinking ahead, let's talk about the project to get linear types (something similar to Rust lifetimes, but weaker) into GHC :)

https://ghc.haskell.org/trac/ghc/wiki/LinearTypes

mrkgnao··on Translating a C++ parser to Haskell
Megaparsec is more actively maintained than Parsec (which it's a fork of). You could try that. It's not as fast as attoparsec, but it's close.
← PreviousPage 6 of 19Next →