News for hackers. Stuff that matters.
Re:Go makes it easier to write correct, clear and efficient ... by sacado2 on Friday May 10, 2019 @08:38AM (#19877135)
If you want a real-world example: I struggle with my SAT solver, gophersat[1].

I have different kinds of constraints, mainly propositional clauses (a or b or c) and pseudo-boolean constraints (2a + b + c >= 2). Long story short, a propositional clause is a special kind of pseudo-boolean constraint, so I can process my clauses as if they were regular pseudo-boolean constraints, but this is slower than using dedicated code.

Lots of problems only deal with propositional clauses, so they take longer to solve than they should, because I cannot say "this is a problem with only propositional clauses", vs "this is a problem with all kinds of clauses". I could use interfaces, and tried, but this is way slower, to the point it doesn't make sense to use them.

And I can't use C++ or rust for this problem: there are already tons of very good c++ SAT solvers, but my goal was to provide a SAT solver I can use in my go programs without resorting to cgo black magic.

[1]https://github.com/crillab/gophersat

Re:Go makes it easier to write correct, clear and efficient ... by foldr on Friday May 10, 2019 @08:49AM (#19877208)
Neat project.

Yes, fair enough, I think that is a good example of the kind of code that Go is not particularly suited to (if performance is critical).