Better HN
topnewbestaskshowjobs
Log inSign up

hope-striker

87 karma · joined Jul 4, 2019 (7y ago) · 47 submissions

Submissions

comment 6y ago · link · parent

It has a lot to do with GraphQL the ecosystem, though, doesn't it?

SQL injection is a particularly bad problem because concatenating strings is the easy path to getting queries working, and parameterization takes (a tiny bit) more effort.

Similarly, a system such that "by default, there's no authorization, no authentication, and it even comes with introspection" is a system that makes it very easy to do the wrong thing. And the default settings of GraphQL generators tend to be even worse than that.

comment 6y ago · link · parent

Ah, whoops. That seems even more useless, though.

comment 6y ago · link · parent

Small note: people often (but don't always) assume that a ring is unital (has an identity element), and that an algebra over a field is unital and associative.

Also, the label "algebra" is vague here, and refers to an "algebra over a field", but sometimes it refers to an "algebra over a ring".

comment 6y ago · link · parent

What would you do with that?

For example, I can see the use of commutativity (ab = ba) and anticommutativity (ab = -ba), but I'm not sure what I'd do with the negation of commutativity (ab ≠ ba).

comment 6y ago · link · parent

As mentioned below, he has a blog at https://www.iquilezles.org/blog/ and it's WordPress, so there's a feed at https://www.iquilezles.org/blog/wp-rss2.php .

comment 6y ago · link · parent

1. How do they live on charity?

2. So what if they live on charity? I don't see how that would invalidate anything being said.

comment 6y ago · link · parent

• Sure, it could come under the umbrella of "declarative programming", but that's an enormous umbrella, so that doesn't really say much.

• I fail to see how differentiable programming (the idea of expressing the desired computation in terms of differentiable objective functions) is any less of a "paradigm" than logic programming (the idea of expressing the desired computation in terms of logical predicates).

• Depending on the expressiveness of your programming language, every paradigm can seem like it's "a great use case of a library, but hardly worthy of being called a new programming paradigm."

comment 6y ago · link · parent

> These let you build all sorts of language constructs that you couldn't build in other programming languages.

Many languages (e.g. Rust[0]) let you write procedural macros, even if their grammar is much more complex than that of a Lisp.

Is there some technical advantage to Lisp macros over macro processors in other languages (ignoring string-based ones like the CPP), or do all the benefits lie in the massively improved ergonomics of writing macros?

(Note that Rust also has simpler hygienic macros, but they're not expressive enough for many things.)

[0]: https://doc.rust-lang.org/reference/procedural-macros.html

comment 6y ago · link · parent

Yep, GP mentions in another comment that they misinterpreted the error.[0]

Anyway, Python replaces the prompt ">>> " with "... " if the input is mid-statement, and I suppose it would be nice if Eshell did the same thing.

[0]: https://news.ycombinator.com/item?id=22799222

comment 6y ago · link · parent

Wow, that's quite the list, but it's a bit weird to see Kaczynski thrown in after all of these mathematical legends.

Also, there was quite a bit more to Godel's death than simply dying "from starvation and exhaustion"!

https://en.wikipedia.org/wiki/Kurt_G%C3%B6del#Later_life_and...

comment 6y ago · link · parent

It means that it's opaque to your ISP and other people on your network, which is at the very least useful for people using it at McDonald's or a university.

comment 6y ago · link · parent

Didn't most old operating systems use cooperative multitasking? I remember, at least, that classic Mac OS (i.e. pre-OSX) didn't use preemptive multitasking, either.

Anyway, this SO answer[0] explains why early Linux, much like the hobby kernel in this article, used cooperative scheduling inside the kernel, and only preempted user-space stuff.

[0]: https://stackoverflow.com/a/16766562

comment 6y ago · link · parent

It is already known that there is some association between intelligence and, for example, race. The underlying causes, whether they're wealth disparities, cultural attitudes toward intelligence, or genetics, don't change whether it's right or wrong to discriminate by race.

You seem to be insinuating something unpleasant, so I would very much appreciate if you could be explicit about what consequences you think this will have.

comment 6y ago · link · parent

Right, I mostly end up using Haskell's lists as an extremely ergonomic counterpart to iterators / generators in languages like Python and Rust.

comment 6y ago · link · parent

There are better alternatives to linked lists for this use case.

1. Clojure uses wide balanced trees as its general-purpose ordered collection.[0] These have probably already been adapted for Haskell, and they offer persistence and fast random access and some degree of cache-friendliness. In my opinion it makes better trade-offs as a general-purpose structure.

2. By passing an &[usize] in Rust, or a const size_t* in C (i.e. by making g accept a read-only pointer), you can be guaranteed that g doesn't modify the array.

[0]: https://hypirion.com/musings/understanding-persistent-vector...

comment 6y ago · link · parent

Does this really work?

I see no reason why my local "representative" would bother listening to me.

comment 6y ago · link · parent

> If you don't box all your closures, functional programming in Rust gets tedious quite quickly.

Somewhat true, but argument position and return position impl Trait have made that slightly nicer.

comment 6y ago · link · parent

> The bigger problem is laziness. How is laziness implemented? A value is represented as an unevaluated thunk, a closure to compute the value. When the value is needed, the closure is run and then replaced by the resulting data. This is mutability. And this is something that almost every Haskell program relies on.

Tangent: does GHC ever decide that it's cheaper to just potentially evaluate something twice than to use thunks?

comment 6y ago · link · parent

Really? I have no experience with Haskell's internals, but self-referential objects are fairly common in Haskell thanks to its non-strictness. The simplest one is probably the list with one element repeated forever.

    ones = 1:ones

comment 6y ago · link · parent

They are the exact same sense!

The exact same idea of shadowing is also present in, for example, sentences in first order logic.

comment 6y ago · link · parent

Shadowing is when you have two separate variables with the same identifier. It is beyond obvious that all the x's refer to the same variable in dilap's example. Contrast that with an actual example of shadowing[0], in which it is clear that the same identifier is being used to refer to two different variables.

[0]: https://en.wikipedia.org/wiki/Variable_shadowing#Python

comment 6y ago · link · parent

The value in Rust does not depend on f.

I will be precise. There is no definition of f such that this function will print anything other than "4".

    fn main() {
        let mut x = 4;
        f(x);
        println!("{}", x);
    }
Again, you seem to be confusing mutable references and mutable variables. If I had written f(&mut x) rather than f(x), you would be right.

comment 6y ago · link · parent

You seem to be confusing mutable variables with mutable references. A name, in Python, is a mutable cell that holds a reference. Python names definitely correspond to mutable, not immutable variables in Rust.

comment 6y ago · link · parent

Here is the most common definition of strong typing, and below it an assertion that "Smalltalk, Perl, Ruby, Python, and Self are all strongly typed".

https://en.wikipedia.org/wiki/Strong_and_weak_typing#Implici...

comment 6y ago · link · parent

Reassignment isn't shadowing. See https://news.ycombinator.com/item?id=22444824 .

comment 7y ago · link · parent

It's not about whether or not it's command-line based, it's that a lot of pain can be patched over by a good IDE.

comment 7y ago · link · parent

They enumerate a finite set of disjoint cases, so in some sense they are an enumeration. But the real reason is, of course, that sum types can be seen a generalization of C enums, so the syntax was chosen to maximize familiarity.

comment 7y ago · link · parent

I guess it's comparable to Maven, but people usually use Maven with an IDE, and Stack on the command line, so that's not very encouraging. Anyway, compared to something like NPM (Node.js) or Cargo (Rust), its user experience is extremely lacking.

comment 7y ago · link · parent

But by your very comment, it only makes sense to hate the politicians! If all they care about is that they keep their jobs, then isn't trying to get the politicians fired for threatening our privacy the best way to get them to care about our privacy?
12