Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Why is this at 44 points? I respect this is trying to hit a nitch but the nitch looks more like a step backwards than forwards. This does not seem more reasonable than what we have available. Maybe when it handles promises will it have a more obvious use case.


What we have available cannot do what this does - logical resolution. The point is not the syntax for boolean operatons, it's that it can find solutions by resolving logical expressions against each other in a way that lets you say "add(2,x)=6, what is x?" and get an answer from the solver. This is basically doing Prolog using JavaScript, a thing vanilla JS is absolutely not equipped for.


Thank you. You have introduced me to something I can get excited about


Why does this need promises? Logic operations in JS doesn't do any I/O operations. Making this promises compliant is just overkill.


To me originally I thought it was just a library that replaced || with or() with no added benefit while promise support would have at least reduced the amount of overhead to create a readable logic wuth asynchronous situations (which is common in js). I now understand thos is a step towards making test code and runnable code one in the same.


*niche


There's absolutely nothing about this that would benefit from having promises - none of the operations performed are blocking. It's constraint solving, not I/O.


Promises can be helpful in a pure CPU bound workload as well: they help to avoid blocking the main thread, by yielding more often. This is typically done by breaking a long running computation into a series of sub-computations that are scheduled on a timer, and the top level API returns a Promise that completes when all computations are over.

The same goal could also be achieved with multiple threads (webworkers for example). But the promises and async/await syntax is more convenient.


I was unfamiliar with the use case that this offers and thought it was a mostly useless replacement or what we already have available.


niche not nitch




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: