News for hackers. Stuff that matters.
Re:Interactive constraint solving in Haskell by dhaivatpandya on Sunday October 25, 2015 @10:59AM (#10447022)
Interesting article. It is also possible to resolve constraints probabilistically (i.e. without gradient descent), which is a good approach for functions which are very "unsmooth." I wonder if it is possible to replicate this article using a probabilistic solver (e.g. http://poincare.github.io/DCFL/ - a Haskell probabilistic constraint solving lib. written by me).
Re:Interactive constraint solving in Haskell by gh02t on Sunday October 25, 2015 @01:23PM (#10447515)
I think it'd also be cool to look at more sophisticated deterministic methods with these nice visualizations. I imagine a similar diagram that shows the expansion and contraction of the trust region in an L-M solver would be pretty enlightening as well. Or look at the path taken by steepest descent for pathological cost functions like the Rosenbrock banana.

I've done visualizations like this in Mathematica, which is really awesome for doing interactive visualizations, but it'd be fun to redo these in Haskell. I haven't done much plotting in Haskell, what libraries do people favor?

Re:Interactive constraint solving in Haskell by julien-c on Sunday October 25, 2015 @12:25PM (#10447291)
Cool visualizations, nicely done. By the way there is a typo in the "Constraint Solving" section, in the last equation, it currently is

  c_x - b_y = 1
It should read

  c_x - b_x = 1
Re:Interactive constraint solving in Haskell by mkeeter on Sunday October 25, 2015 @01:03PM (#10447434)
Thanks, that's now fixed.
Re:Interactive constraint solving in Haskell by platz on Sunday October 25, 2015 @04:40PM (#10448316)
for some reason I get

    "([True,True],fromList [('x',1.7500000780766642),('y',-0.24999969839074443)])"
when i run

    print $ show $ solveSystem 
     [ ((2 * x) + (3 * y)) * (x - y) === 2
     , (3 * x) + y === 5 ] 
     $ Map.fromList [('x', 0),('y', 0)]

which doesn't match the suggested solutions.. using this code: https://gist.github.com/80e982016a267b1f2e48

* edit - lowering the precedence of === fixed it

Re:Interactive constraint solving in Haskell by mkeeter on Sunday October 25, 2015 @05:31PM (#10448518)
Thanks, I've updated the page with a fix.
Re:Interactive constraint solving in Haskell by danharaj on Sunday October 25, 2015 @11:06AM (#10447049)
Someone ought to make d3 bindings for ghcjs. It does have an ffi for a reason.
Re:Interactive constraint solving in Haskell by skimpycompiler on Sunday October 25, 2015 @10:55AM (#10447011)
Loving the haskell to javascript thingy. On my i7 4770 animations are still fast.

Although, I thought that animations were done completely in haskell but it seems that necessary functions were exported and data used in d3js.

Re:Interactive constraint solving in Haskell by mrspeaker on Sunday October 25, 2015 @02:34PM (#10447806)
It's a tiny bit janky on my macbook in Chrome (Canary), and runs like dog on Firefox (Nightly). Not that I care at all - the article is excellent and informative.

But it highlights one of the thing people forget when their language gets a JavaScript compiler: your render target is now the DOM, so you have to start caring/learning about that cross-browser world of pain!

Re:Interactive constraint solving in Haskell by leadingthenet on Sunday October 25, 2015 @10:54AM (#10447006)
What's with all the Haskell love I've been seeing on HN recently? I kinda feel good about taking that FP course in first year uni now.
Re:Interactive constraint solving in Haskell by dmit on Sunday October 25, 2015 @07:31PM (#10448890)
Most likely explanation: Baader-Meinhof Phenomenon.

Slightly less likely: modern Haskell distills some ideas that have proven to be beneficial to software projects regardless of the language(s) they choose. As long as the number of HN users grows, and more and more of them realize the benefits of the FP paradigms championed by Haskell, there will be more upvotes for related submissions to the front page.