HNHacker News
TopNewBestAskShowJobs

reuben364

176 karma · joined April 21, 2015

submissionscomments
reuben364··on The unreasonable effectiveness of declarative programming
One thing I realized that seq'ing too many things might be bad for performance. As I understand it,

   foldr1 (\x y -> ((x `par` delay 1) `seq` y)) $ map pure [1..]
Would require more and more comparisons over time. Is there some sort of codensity like trick that you can do? Or is this something the user of the library would worry about if it came to that. Or just have a redundant API.
reuben364··on The unreasonable effectiveness of declarative programming
Replying to your edit:

As I was writing it my headspace was that the duration was for seq to know when to switch. I wasn't really thinking about stopping the animation too.

(I also notices that my seq is wrong. The subsequent animation should start at the beginning, so it should be `g (t - df)`, not `g t`

I believe you are correct. Your implementation is more at the heart of what I wanted to show. . The main point I wanted to get across was the interface itself.

reuben364··on The unreasonable effectiveness of declarative programming
Thanks. I should have just clarified that I wanted to communicate the idea. I didn't expect to get it right first try.

Maybe I'll try and make a small library of it if there isn't already. I've never posted something on Hackage.

reuben364··on The unreasonable effectiveness of declarative programming
Basically auto playing anything for me is bad UX.
reuben364··on The unreasonable effectiveness of declarative programming
In Haskell, one can make more general combinators in the following way:

   type Anim a = (Duration -> a, Maybe Duration)

   -- Linear interpolation
   linear :: Anim Duration
   linear = (id, Nothing)

   -- Sequencing
   seq :: Anim a -> Anim b -> Anim (Either a b)
   seq (f, Nothing) g = (\t -> Left $ f t, Nothing)
   seq (f, Just df) (g, dg) = 
        (\t -> if t < df 
           then Left $ f t 
           else Right $ g t
        , df + dg)

   -- Parallelism
   par :: Anim a -> Anim b -> Anim (a, b)
   par (f, df) (g, dg) = (\t -> (f t, g t), max df dg)

   -- Constant
   pure :: a -> Anim a
   pure a = (const a, Nothing)

   -- EDIT: forgot delay
   delay :: Duration -> Anim ()
   delay d = (const (), d)
I know there's an Applicative in there, but I'm not sure where else this lies in the typeclass hierarchy.

EDIT: More fixes

EDIT: I should really test in GHCI before I post these things. But I'm lazy.

reuben364··on Swift: Google’s Bet on Differentiable Programming
I'm no expert, but is there not cause for it being a language feature rather than a library? When you use a library you effectively have a DSL to construct your differentiable program, and lose the facilities of the host language.

It's also not quite declarative programming either. In the same way that you build ordinary executable programs out of smaller executable parts. You build differentiable programs of smaller differentiable parts. You aren't declaring what outcome you want, you are simply restricting what you are building your program out of so that it has properties that allow you to interpret the program differently from how it will run "normally".

reuben364··on Lean Book: The Hitchhiker's Guide to Logical Verification [pdf]
I'm learning lean with that intent (to self learn mathematics). I get distracted trying to learn how to do better proof automation and tactic golf.

Also, since I don't see anyone mentioning so it far: there is a currently fairly active Zulip chat for the lean prover. They have been quite helpful for me getting started.

reuben364··on Be wary of functions which take several parameters of the same type
Adga does mixfix pretty well. A variable in scope can indicate the places for arguments with underscores (e.g. _+_ or _=<_>_). The tradeoff for being able to use pretty much any symbol in identifiers along with mixfix is that you have use whitespace (3 + 5, not 3+5). Though I agree it doesn't scale.
reuben364··on A Son’s Race to Give His Dying Father Artificial Immortality (2017)
I far I am concerned, the most crucial aspect is my mind. I think, but wouldn't know how to prove, that the information needed to satisfactorily copy a human mind is finite. You may not be able to replicate quantum states, but can definitely replicate bits.
reuben364··on A Simple Structure Unites All Human Languages
Unordered would be if cons(a, b) == cons(b, a) which is not the case
reuben364··on A Simple Structure Unites All Human Languages
Well, a binary tree with unordered children.
reuben364··on Timeline for Logic, λ-Calculus, and Programming Language Theory (2012) [pdf]
I found the OPLSS lectures on parallel cost semantics using lambda calculus quite enjoyable, but I don't really know much about it.

https://www.youtube.com/watch?v=lSc0EtF6_Zk

reuben364··on Terminating Service for 8Chan
I agree with the premise, not the argument

We can arrive at truth through dialogue, but dialog can also lead to propagation and affirmation of misinformation. One does not necessarily converge on truth.

Though, to entrust any government to control free speech to that end is an entire different point.

reuben364··on How many holes does a straw have? [video]
The point isn't that the deformed "cup" is the same as the original cup. It's that in the process of deformation the number of holes remains the same.
reuben364··on Please do not attempt to simplify this code
That's kind of a truism though. There will always be a non-zero entropy for the distinct kind of systems you want to build.

Unless there is one system to rule them all, configured exactly the way it is needed out the box.

reuben364··on Airbnb's new typeface
That's a strawman. No one has stated that the success of AirBnB is easy to replicate, nor that a system of equal functionality is easy to create.
reuben364··on Representing the Impractical and Impossible with JDK 10 “var”
Lambas? That sounds amazing. :-)
reuben364··on Garbage collectors open a library with abandoned books
Feels like a garden path sentence [1] targeted at developers

[1] https://en.wikipedia.org/wiki/Garden_path_sentence

reuben364··on Writing a formally-verified image browser in Coq and Haskell
Coq isn't very good for developing with properties encoded in the types. Such properties are defined seperately from the data structures involved.
reuben364··on Haskell Data Analysis and Machine Learning Cookbook
The dependently-typed-ish features of haskell can provide a sweet spot of both untagged data along with the flexibility of heterogeneous lists.
reuben364··on Algebraic patterns – Semigroup
That is the dependent typed aspect mentioned. This is actually done in Idris with VerifiedSemigroup and other verified instances.
reuben364··on Ask HN: Are you programming on your holidays?
Working my way through Software Foundations. Though that might not be considered programming.
reuben364··on How Wasps Use Viruses to Genetically Engineer Caterpillars
My point stands. A non-endangered species is equally likely to yield useful insight as an endangered one.

Though I realise that I have made a weak argument and that I do have a, perhaps unreasonable, bias towards not expending effort to preserve endangered species. In my mind preservation of endangered species is hoarding on a larger scale: someday this species may be useful to us, so let us keep it around.

reuben364··on How Wasps Use Viruses to Genetically Engineer Caterpillars
There are different types of value you can derive from these stories. There is the practical: crops that defend themselves from predators. Then there is entertainment value.

Arguing that practical value to be found in species past and present is akin to stating that all information can be found by in the digits of pi. Sure enough there are valuable things to find, but only amongst uninteresting things. Unless there is a mechanism to roughly draw out the interesting, such as evolution.

On the other hand, entertainment doesn't have a need to be fixated on anything particular. Details on the Dodo are lost, so you turn to the wasps. If the wasps are gone you turn to the snakes.

As for other types of value, I may miss something. Or our beliefs may fundamentally differ such that we cannot argue in terms of each others.

reuben364··on The Python Road Not Taken
If you are saying print is gone, it isn't. It became a function in python 3.

   print "hello world"
became

   print("hello world")
If you are complaining about the format, then that really is a dumb reason.
← PreviousPage 5 of 5