87 karma · joined Jul 4, 2019 (7y ago) · 47 submissions
comment 6y ago · link · parent
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
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
comment 6y ago · link · parent
• 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
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
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
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.
comment 6y ago · link · parent
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
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
Tangent: does GHC ever decide that it's cheaper to just potentially evaluate something twice than to use thunks?
comment 6y ago · link · parent
[0]: https://en.wikipedia.org/wiki/Variable_shadowing#Python
comment 6y ago · link · parent
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
https://en.wikipedia.org/wiki/Strong_and_weak_typing#Implici...
comment 6y ago · link · parent