Readit News logoReadit News
NickPollard commented on That XOR Trick (2020)   florian.github.io//xor-tr... · Posted by u/hundredwatt
tomtomtom777 · 2 months ago
Fascinating. It can see it work but I still can't really wrap my head around where the magic cycle length of 4 comes from.
NickPollard · 2 months ago
There are essentially two bits of information in the 'state' of this iterated algorithm: a) Are all the non-lowest bits zero, or are they the value of the latest N b) the value of the lowest bit

So the cycle of (N, 1, N+3, 0) corresponds to (A) and (B) being: (0,0), (0,1), (1,1), (1, 0) - i.e. the 4 possible combinations of these states.

NickPollard commented on A list is a monad   alexyorke.github.io//2025... · Posted by u/polygot
pdhborges · 2 months ago
If all monad instances work differently what is the value of the Monad interface? What kind of usefull generic code can one write against the Monad interface.

Related: https://buttondown.com/j2kun/archive/weak-and-strong-algebra...

NickPollard · 2 months ago
Traverse (or foldM) is probably a good start, likely the most useful monad-generic (or applicative-generic) function, that is simple but incredibly powerful and useful.

More generally, Monads essentially support function composition between monadic functions, so you can use it to write code that is agnostic to the monad it runs in. This can let you write e.g. prod. Code that is in IO or Async or Maybe, but for unit testing run it in Identity.

Also, it allows syntax sugar such as do notation that makes it clear to work with even when you know which monad you're working in.

NickPollard commented on Wuffs’ PNG image decoder   nigeltao.github.io/blog/2... · Posted by u/est31
nyanpasu64 · 4 years ago
Functions and types can take integers as monomorphization-time template parameters (const generics).

It would be nice if you could pass (n, t) where n is supplied at runtime, the type of t depends on the value of n, and the compiler only lets you use t if your code is valid for all reachable values of n.

eg. fn(n: usize, arr1: &[i32; n], arr2: &[i32, n]) allowed the function body to assume the two slices can be zipped without losing elements.

Note that i don't have enough experience with either dependent types, zz, or wuffs to explain much further.

NickPollard · 4 years ago
> Functions and types can take integers as monomorphization-time template parameters (const generics).

Const generics aren't dependent types though; you're still dealing with known constants at compile time. For it to be dependent types, you need something like in your latter example, where a type is dependent on an actual _value_ passed to a function at runtime.

NickPollard commented on Wuffs’ PNG image decoder   nigeltao.github.io/blog/2... · Posted by u/est31
steveklabnik · 4 years ago
Rust does as much as possible at compile time, and some of its most famous features are entirely at compile time, but it will also use runtime checks where appropriate.

Some amount of runtime checking is inherent in any program. Even dependently typed programs must, for example, check input at runtime. They can make it easier to have absolutely minimal runtime checks, however. Rust is adding a limited form of dependent types for this reason.

NickPollard · 4 years ago
I've not been following recent Rust development as closely, can you elaborate on what limited form of dependent types Rust is adding?
NickPollard commented on Advice for Haskell beginners (2017)   haskellforall.com/2017/10... · Posted by u/sridca
ad_hominem · 7 years ago
I don't have any personal knowledge of it but I've heard that the code of conduct you're referencing was actually created and weaponized by certain sociopath-types to eject Tony from his own open source library in a hostile takeover.

And not that it excuses his behavior, but I also seem to recall Tony suffering from some very severe back injuries accompanied by chronic pain.

(Not to white knight a person I'm barely aware of but your description seems pretty one-sided based on what I've seen)

NickPollard · 7 years ago
Absolutely not. The code of conduct was created to help produce a welcoming and supportive community, and if Tony being kicked out for being neither welcoming nor supportive counts as 'weaponizing', then that's a very strange view. I've met many of the people who were involved in this and they are amongst the nicest, friendliest, accepting people you could meet, and about as far from 'sociopath' as you can imagine.

This idea of a hostile takeover and such is a figment of Tony's imagination and a deliberate distraction equivalent to Trump's referring to the Mueller investigation as a witch hunt.

NickPollard commented on Advice for Haskell beginners (2017)   haskellforall.com/2017/10... · Posted by u/sridca
KirinDave · 7 years ago
Addenda (relevant to community musings today):

Be aware that as a small and very distributed community, the Haskell world has less power to eject bad actors than more centrally managed and resourced projects have (e.g., Golang and Rust have much more structural power to moderate). Awful and abusive people exist in the community, and it's best to just start blocking and ignoring folks who disrespect you.

The amazing thing about the Haskell community is that knowledge is very well distributed throughout the community these days. The culture, influenced by academia, strongly values writing and publishing ideas rather than sharing them orally or in the workplace. This means that if you're interested in learning, there are a ton of places and ways to do it.

If you're looking for good initial connections to folks who are respectful, well informed, and unlikely to expose you to some of the frustrating cabals in the community, I've got a few recommendations

1. Gabriel Gonzales (this is his blog, and he's @GabrielG439 on twitter)

2. Chris Martin of TypeClasses. I'd also list his partner in crime Julie Moronuki, but her social media interaction is reduced these days. These two focus on helping programmers get up to speed with haskell from a variety of starting points, and they care more about functional programming than haskell specifics.

3. Patrick Thompson of Github (@importantshock on Twitter). A fantastically skilled person who will link you to a network of amazing Haskell folks who do stuff in a positively next-generational way.

Two people who are adjacent to the Haskell community and incredibly interesting, but probably can't answer direct questions for you. Worth a follow.

1. Dr. Edwin Brady, creator of the Idris language. He's widely respected, humble, and has a beautiful vision for how humans and computers should interact to write programs.

2. Dr. Bodil Stokke (@bodil on twitter). Bodil is not so much a Haskell person these days, but she's got a phenomenal breadth of knowledge and always has interesting things to talk about in the FP space. Worth a follow if you're on that platform.

I suppose you can ask me for help too, but I'm certainly not as competent as these folks.

NickPollard · 7 years ago
Can second all these suggestions. Also, from my experience all the Haskell events I've been to have been incredibly welcoming and positive, whilst I'm aware there are a tiny subset of abusive people out there, I've never met them nor met anyone who would tolerate them.

Shoutout if you're in the SF area, BayHac (https://wiki.haskell.org/BayHac2018), a yearly unconference/hackathon is incredibly fun, and also there are (roughly) bi-monthly Haskell meetups (https://www.meetup.com/Bay-Area-Haskell-Users-Group/) in SF which are great fun (disclaimer: I co-organise the meetups - find me @Nick_enGB).

NickPollard commented on Ubershaders: A Ridiculous Solution to an Impossible Problem   dolphin-emu.org/blog/2017... · Posted by u/voltagex_
imtringued · 8 years ago
And the game disks won't last forever either.
NickPollard · 8 years ago
and Dolphin can upscale to e.g. 1080p rather than the gamecube's native 480p.
NickPollard commented on Show HN: NStack – Typed, composable microservices for data analytics   github.com/nstack/nstack... · Posted by u/NickPollard
adam_ellsworth · 8 years ago
What are some good resources on better understanding composability?
NickPollard · 8 years ago
We have some info on our docs here: https://docs.nstack.com/en/latest/features/index.html (See the composition section at the top).

Composition is a simple technique to build functions out of multiple simpler functions. It's heavily used in Functional programming but we think it's really useful for everyone, particularly data workers who might be gluing together lots of different modules/libraries/systems. We also use types to help check that functions can compose - this can catch schema mismatch errors early rather than waiting until you run your data pipeline to realise that the output of one function isn't _quite_ what your second function expects.

Wikipedia as some more detailed info on function composition: https://en.wikipedia.org/wiki/Function_composition_(computer...

u/NickPollard

KarmaCake day2951February 4, 2010
About
Email me at nickedwardpollard (@ a popular google based email domain)
View Original