5 ms·
Interactive constraint solving in Haskell
- leadingthenet 11y agoWhat'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.
- dmit 11y agoMost 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.
- skimpycompiler 11y agoLoving 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.
- mrspeaker 11y agoIt'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!
- dhaivatpandya 11y agoInteresting 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/ http://poincare.github.io/DCFL/ - a Haskell probabilistic constraint solving lib. written by me).
- gh02t 11y agoI 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?
- danharaj 11y agoSomeone ought to make d3 bindings for ghcjs. It does have an ffi for a reason.
- deleted 11y ago[deleted]
- julien-c 11y agoCool 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
- mkeeter 11y agoThanks, that's now fixed.
- Ch_livecodingtv 11y agoNice read. Let me also post nice video tutorial regarding haskell. https://www.livecoding.tv/video/haskell-messing-with-spacemacs-9/ https://www.livecoding.tv/video/haskell-messing-with-spacema...
- platz 11y agofor 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 https://gist.github.com/80e982016a267b1f2e48 * edit - lowering the precedence of === fixed it
- mkeeter 11y agoThanks, I've updated the page with a fix.