NickPollard

Joined 16 years ago

Karma
2,965
Submissions
505
Member since
Feb 4
Email me at nickedwardpollard (@ a popular google based email domain)
View on Hacker News

Recent submissions

Comment · 9 months ago
There is apparently a suite to rent in the Rosewood Hotel in London (near Holborn) which has it's own postcode (WC1V 7EN).

To be fair it's a 6-bedroom wing, but still a fun fact.

Comment · 1 year ago
I have a 4 year old and an 18 month old, and I don't own a car (nor does my partner).

We rent a car ~10-20 times a year, but that's usually for vacations or trips out of the city to visit family. Regular weekly family life we use buses, the underground (metro), trains, or sometimes taxis.

We are considering eventually getting a car, but we've managed for 4 years with children to not need one and it's not been an issue.

(I live in London, United Kingdom)

Comment · 1 year 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.

Comment · 1 year 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.

Comment · 5 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.

Comment · 5 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?
Comment · 8 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.

Comment · 8 years ago
Comment · 9 years ago
and Dolphin can upscale to e.g. 1080p rather than the gamecube's native 480p.
Comment · 9 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...

Comment · 10 years ago
For what it's worth this was (and is) my red line that prevents me from ever buying an iPhone. That's one person who agrees with you at least!
Comment · 10 years ago
The XPS 13 is a really nice machine - I use one full-time for work, although with Linux (Fedora) rather than Windows, and it's fantastic.
Comment · 10 years ago
You are right - in a tautalogical way - that type systems only catch type errors. However, in modern languages (including Haskell, Scala, as well as newer, more experimental languages like Idris), those type errors can be extremely powerful.

Many people assume that 'types' are simply primitives like Int and String, and that a type checker just makes sure you don't pass an Int to a function expecting String. However, it is possible to express far more powerful statements about your data using a good type system.

For example, you can express the idea of non-emptiness of a container, as mentioned in the article. Then you know that, say, taking the max element of a non-empty container is guaranteed to give you an element, whereas with a possibly-empty container you might not have any element at all, causing a null, or exception, or at least requiring an Optional type.

You can express safety properties such as a sanitized string vs. unsanitized. You can have a Sanitized type that can only be created by calling a sanitize function - which carefully escapes/handles any invalid characters - and then functions that might, say, pass a value into an SQL instruction can be typed to only take Sanitized strings. Now the representation in memory of Strings and Sanitized strings is identical, but by using different types and a certain set of allowed functions on those types, you can encode the invariant that a string cannot be inserted into an SQL query until it has been sanitized. Now your type checker can catch SQL insertion vulnerabilities for you. How's that for a type error?

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton