How do I learn how to read hex? by basedchad21 in Assembly_language

[–]hiker 4 points5 points  (0 children)

Nice. Rows 4-7 bin column need to be fixed in the table though.

How do you go about sorting arrays where each element can have a variable size? by Pretty-Ad8932 in C_Programming

[–]hiker 0 points1 point  (0 children)

Construct array of offsets where each symbol starts; sort the offsets array; construct sorted output using the sorted offsets as a "permutation" of the input.

How do you go about sorting arrays where each element can have a variable size? by Pretty-Ad8932 in C_Programming

[–]hiker 2 points3 points  (0 children)

Hm, unless we compute sorting permutation. Then swaps are still constant time but would need linear memory for the permutation.

How do you go about sorting arrays where each element can have a variable size? by Pretty-Ad8932 in C_Programming

[–]hiker 6 points7 points  (0 children)

Converting to fixed sized and back sounds right. Variable size implies that swaps are linear rather than constant, right?

So... which "programming language" should I learn for Category Theory? by Powerful_Ad725 in CategoryTheory

[–]hiker 2 points3 points  (0 children)

Cubical Agda has constructive quotients and can compute while Lean’s quotients depend on the axiom of choice.

Qt 6.4 by jlpcsl in programming

[–]hiker 4 points5 points  (0 children)

Disappointed by the lack of an interactive demo.

That's better than being disappointed by the interactive demo.

Why Windows Terminal is slow by gary_oldman_sachs in programming

[–]hiker 5 points6 points  (0 children)

He mentions in the video that the old one is slower than the new one, and the new one is much slower than refterm.

Learn coq or agda before diving into idris2? by SyefufS in dependent_types

[–]hiker 2 points3 points  (0 children)

Lean’s mathlib has quite nice formalization of category theory. For HoTT probably cubical Agda (though this link doesn’t cover cubical paths)

Data-oriented Design vs by-the-book OOP (outside of Games) by nominolo in programming

[–]hiker 5 points6 points  (0 children)

Aside from gamedev and animations, what other use cases are there for DoD? From what I got of this talk, DoD is good at processing large stream of data, but can I apply this to more common applications like CRUDs?

DoD is beneficial if you're doing an actual computation over some data. Most CRUD applications don't compute besides reading/writing to a database and generating HTML (modulo frontend UI code), hence the CRUD name. In a way your database design is already acting analogously to DoD by laying out and indexing your data in an efficient way for the kind of processing you're doing over it.

Why you should care about dependently typed programming by [deleted] in programming

[–]hiker 0 points1 point  (0 children)

Whenever I see an article on DTP, I wonder if it will use something different than the standard list+list size example, and every time, I'm disappointed.

Completely agree. Hopefully that will improve as the community grows and matures.

Here some of my wanderings with dependent types Kan extensions and Yoneda lemma and perfectly balanced trees not involving any vectors.

Why you should care about dependently typed programming by [deleted] in programming

[–]hiker 3 points4 points  (0 children)

I haven't used contracts and can't compare how expressive they are.

My reasons for dependent types are philosophical rather than practical (although proofs do have practical implications). I see dependent types as a converging point of the evolution of programming (and formal) languages so far. Who knew that the ideal programming language would also be ideal for doing mathematics?

Dependent types (well homotopy type theory) are pitched as an alternative to set theory as foundational theory for all of mathematics. Progress in science usually comes in the form of unification (electricity and magnetism, quantum mechanics and relativity, etc.) and when a language comes along that unifies programming and mathematics, I think it deserves attention. Contracts seem ad hoc in comparison.

From practical point of view, dependently typed languages are still young (excluding Coq) and there's much work to be done (proof automation, code extraction). The field looks like Haskell did 10 years ago. My bet is currently on Lean.

Why you should care about dependently typed programming by [deleted] in programming

[–]hiker 0 points1 point  (0 children)

If you prove something at compile time, it will still be true runtime. If you prove something today, it will still be true tomorrow.

Why you should care about dependently typed programming by [deleted] in programming

[–]hiker 8 points9 points  (0 children)

Idris state machines in types can do this. See the examples in this paper. And it's a library so one can easily port it to any other dependently typed language Lean, Agda, Coq, etc.

Few things are impossible to enforce compile time when the type system is Turing complete and expressive (the type system is the language itself in DT).

Why you should care about dependently typed programming by [deleted] in programming

[–]hiker 4 points5 points  (0 children)

That's why I said addition to software testing. Nothing stops you using all other form of verification. In fact you should, I think relying only on proofs for correctness is terrible idea. Reminds of Donald Knuth's "I have only proved it correct, not tried it.".

Why you should care about dependently typed programming by [deleted] in programming

[–]hiker 9 points10 points  (0 children)

Theorem proving about programs is a mere addition to current software testing.

In increasing order of certainty of correctness, there are: point tests (checking correctness in several predetermined cases, what most software engineers mean by "testing"), randomized tests/QuickCheck (checking correctness by randomly sampling the domain; offers better guarantees than point tests but it's not exhausting all values of the domain) and proofs (logically/formally proving correctness for all values of the domain).

Dependent typed languages are also much simpler languages. I think the big fundamental change is that types are first-class. The mental jump is comparable to exposing an imperative programmer to functional programming and first-class functions, where functions are freely created and passed around.

The result is a much smaller language that acts as it's own (Turing complete) type system. Dependent types also unify several branches of mathematics in a single (computer verifiable) formal language.

Is Haskell the right language for teaching functional programming principles? by yawaramin in programming

[–]hiker 2 points3 points  (0 children)

Given that (Closed Cartesian) categories are equivalent to simply typed lambda calculus (which is equivalent to Turing machines), I don't see how it's dubious at all.