News for hackers. Stuff that matters.

bronty

Re:A Scala DSL for currency-related operations on Saturday March 28, 2015 @09:25AM (#9281413)
Cool, I've added it to the list of financial DSL resources at http://dslfin.org/resources.html

What application domain are you working in that you know all the currencies at compile-time?

Re:Idris: Type safe printf [video] on Sunday December 28, 2014 @10:52AM (#8806478)
You can check format strings in Java at compile-time using the Checker Framework: http://types.cs.washington.edu/checker-framework/current/che...

The format string semantics are actually pretty tricky because printf will perform conversions in certain cases.

Re:Test Data Generation with Prolog on Saturday December 20, 2014 @03:07PM (#8777748)
RUGE [1] is another open source PROLOG framework for functional and load testing. Brendon McCarthy originally developed it for testing financial applications at American Express.

Brendon presented it at the 2013 Workshop on Domain-Specific Languages for Financial Systems [2]. One observation made by the Haskellers was that PROLOG approaches such as these are attempting to solve a problem that has already been solved by QuickCheck [3].

[1] http://bmccarthy.bitbucket.org/ruge/faq.html [2] http://dslfin.org/ [3] https://en.wikipedia.org/wiki/QuickCheck

There's two different issues here: (1) whether or not to use compiler plug-ins, and (2) whether or not to use compiler plug-ins for metaprogramming.

Using plug-ins for automated analysis improves the quality of your codebase. The annotations serve as a machine-checked documentation which make the code easier to debug.

As you point out though, the benefits of plug-ins for metaprogramming (such as implementing a DSL) is not always as clear-cut: you have to pay the price of maintenance, much of which is not always obvious up-front.

You face many of the same issues when designing a DSL in Scala --- the DSL may generate code that depends on a custom run-time or library.

Java 8 adds support for type annotations, which enables developers to write code such as:

@Currency("USD") double amount;

These annotations can be checked automatically using a compiler plug-in, such as the Checker Framework [1]. The Checker Framework comes pre-packaged with a units checker [2] along with checkers for null pointer errors, locks, string formatting, security, and many more.

Java's domain-specific language (DSL) features aren't as rich as Scala's. However, you could implement some DSL-like features using aspect-oriented programming (AOP) tools or other similar compiler plug-ins.

[1] http://types.cs.washington.edu/checker-framework/ [2] http://types.cs.washington.edu/checker-framework/current/che...

Re:Proof Market: Submit Coq proof, get paid with Bitcoin on Wednesday January 01, 2014 @08:10PM (#6997646)
It depends on whether or not the buyer allows for proof irrelevance.

There are cases where _human_ buyers care about the structure of the proof. In particular, just like with code, you'd prefer a proof that is maintainable, modular, and not-too-hard to update if your assumptions or claim changes.

Re:Proof Market: Submit Coq proof, get paid with Bitcoin on Wednesday January 01, 2014 @07:50PM (#6997577)
You'd run into a problem if you let workers introduce assumptions (since introducing a contradiction lets the worker prove anything).

With Coq, you don't have a problem of unsoundness. The problem you have is that the difficulty / time it takes to write a proof is often very sensitive to how you've written your assumptions and formulated the claim. You'd likely want to add a mechanism to the marketplace to reward workers for suggesting ways to improve the problem formulation.

For my Java project, we were using ESC/Java2 under the hood which is unsound in a lot of ways. We definitely observed workers taking advantage of these (either intentionally or not).

Re:Proof Market: Submit Coq proof, get paid with Bitcoin on Wednesday January 01, 2014 @06:59PM (#6997400)
Yes, a grep could locate that.
Re:Proof Market: Submit Coq proof, get paid with Bitcoin on Wednesday January 01, 2014 @05:37PM (#6997093)
It actually can't -- a fundamental characteristic of this marketplace is that the work can be automatically verified [1].

As part of my PhD work, I created a service for crowdsourcing the verification of Java programs which relied on the same characteristic: http://homes.cs.washington.edu/~mernst/pubs/veriweb-oopsla20....

One limitation of these crowd-sourcing approaches is that, in practice, validation ("are we trying to build/prove the right thing?") is as important, if not more important, than verification.

[1] this might not be quite true yet, since a solution of "admitted." would pass the Coq checker.

Re:Google Pays for Drones To Bust African Rhino Poachers on Monday December 17, 2012 @09:14PM (#4935699)
There's also a campaign on indiegogo to help a Kenyan conservancy adopt drone technology: http://www.indiegogo.com/olpejeta

Support levels include drone flight time, trips to the conservancy, and naming an animal you can track with the drones' RFID technology.