News for hackers. Stuff that matters.

hope-striker

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.

Re:Ladder of Algebraic Structures on Tuesday April 14, 2020 @05:34AM (#22864104)
Ah, whoops. That seems even more useless, though.
Re:Ladder of Algebraic Structures on Tuesday April 14, 2020 @04:24AM (#22863746)
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".

Re:Ladder of Algebraic Structures on Tuesday April 14, 2020 @04:21AM (#22863732)
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).

Re:Blog of Inigo Quilez, Creator of Shadertoy on Sunday April 12, 2020 @08:51AM (#22847917)
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 .
Re:You're a Slave to Money, Then You Die on Sunday April 12, 2020 @08:43AM (#22847875)
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.

Re:Swift: Google’s Bet on Differentiable Programming on Thursday April 09, 2020 @06:31AM (#22821229)
• 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."

Re:A Little Clojure on Wednesday April 08, 2020 @05:11AM (#22811279)
> 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

Re:A History of Erlang (2007) on Tuesday April 07, 2020 @12:54AM (#22800441)
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

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...

Re:SpaceX bans Zoom over privacy concerns on Wednesday April 01, 2020 @08:23PM (#22755007)
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.
Re:Writing an OS in Rust: Async/Await on Monday March 30, 2020 @12:10PM (#22729147)
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

Re:Genetic Architecture of Gray Matter on Saturday March 28, 2020 @10:14PM (#22715822)
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.

Right, I mostly end up using Haskell's lists as an extremely ergonomic counterpart to iterators / generators in languages like Python and Rust.
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...

Re:The EARN IT act is an attack on end-to-end encryption on Saturday March 07, 2020 @07:25AM (#22511240)
Does this really work?

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

Re:Miranda released as free software on Sunday March 01, 2020 @05:53AM (#22456316)
> 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.

Re:Multicore OCaml: Feb 2020 update on Saturday February 29, 2020 @09:12AM (#22450627)
> 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?

Re:Multicore OCaml: Feb 2020 update on Friday February 28, 2020 @05:29PM (#22447009)
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
Re:I Want Off Mr. Golang's Wild Ride on Friday February 28, 2020 @04:43PM (#22446691)
They are the exact same sense!

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

Re:I Want Off Mr. Golang's Wild Ride on Friday February 28, 2020 @04:27PM (#22446530)
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

Re:I Want Off Mr. Golang's Wild Ride on Friday February 28, 2020 @03:32PM (#22446064)
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.
Re:I Want Off Mr. Golang's Wild Ride on Friday February 28, 2020 @03:26PM (#22446003)
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.
Re:I Want Off Mr. Golang's Wild Ride on Friday February 28, 2020 @02:29PM (#22445566)
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...

Re:I Want Off Mr. Golang's Wild Ride on Friday February 28, 2020 @02:27PM (#22445553)
Reassignment isn't shadowing. See https://news.ycombinator.com/item?id=22444824 .
Re:What Is Good About Haskell? on Thursday October 03, 2019 @07:07PM (#21153217)
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.
Re:What Is Good About Haskell? on Thursday October 03, 2019 @03:44PM (#21151247)
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.
Re:What Is Good About Haskell? on Thursday October 03, 2019 @03:41PM (#21151212)
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.
Re:Facebook, WhatsApp Will Have to Share Messages With U.K.? on Saturday September 28, 2019 @07:09PM (#21103667)
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?
Re:Men Are Waiting to Share Some Feelings (2018) on Saturday September 28, 2019 @10:24AM (#21100433)
I agree, it's a very strange use of the word, and I'm confused as to how it became so popular, but concerted by whom and to what end?

Older »