User loginNavigation |
archivesCatch me if you can: Towards type-safe, hierarchical, lightweight, polymorphic and efficient error management in OCamlCatch me if you can: Towards type-safe, hierarchical, lightweight, polymorphic and efficient error management in OCaml, by David Teller, Arnaud Spiwack, Till Varoquaux:
Exhaustively checked, user-friendly exception handling was a bit of an open problem for awhile. As the paper details, languages supported either cumbersome, exhaustively checked polymorphic exceptions, as in Haskell, or we had unchecked easily extensible monomorphic exceptions, as in ML, or we had checked, extensible exceptions using a universal type as in Java. Supporting exhaustively checked, easily extensible polymorphic exceptions seemed quite a challenge, which this paper solves using monadic error handling and nested polymorphic variants. The paper also gives a good overview of current techniques of exception checking in OCaml, ie. ocamlexc. The performance of such exceptions is understandably lower than native exceptions, given all the thunking and indirection that monads entail. The authors attempt various implementations and test their performance against native exceptions. Ultimately, monadic error management seems acceptable for actual error handling, but not for control flow as native exceptions are sometimes used in OCaml. One interesting extension is to consider how efficient the implementations would be given more sophisticated control flow operators, such as continuations, coroutines, or delimited continuations, or whether native exceptions can be salvaged using a type and effects system in place of monads. By naasking at 2008-07-11 15:16 | Functional | Implementation | Software Engineering | 12 comments | other blogs | 20532 reads
In search for a programming language to replace spreadsheets.Hello, I'm in the search for a good programming language to replace much of what I use spreadsheets for today: The advantage of a spreadsheet is that it's extremely easy and fast to work with. But a spreadsheet can soon become complex with: I would like a language that can be used like this: You define a data field to be a function of multiple arguments like: Amount Income(Company, Month, Year) You can then derive other fields like: Amount Income(Month, Year) = sum(Income(Company, Month, Year)) Amount Income(Year) = sum(Income(Month, Year)) You can also define a lot of data: Amount Income(Company, Month, Year) = [ ("Microsoft", "01", "2008") => 1234, ("Microsoft", "02", "2008") => 15664, ("Sun", "01", "2008") => 1564, ("Sun", "02", "2008") => 1652 ] You can now ask for Income("2008") and get the appropriate amount: (= sum [for all months] [for all companies] Income(Company, Month, "2008")) I know many imperative languages, but I've only experimented very little with other programming paradigms. I'm thinking of learning a declarative language like Prolog for this .. but are there better alternatives? I like the idea of Haskell being strongly typed, but I don't know if it will be good for this. The idea is to be able to model very complex systems, while keeping the calculations concise. Another advantage would be that you are able to reuse formulas. Ideally there should be a nice IDE with the possibility of getting a graphical/tabular view of the calculated data. Have any of you thought of something like this, or even made or heard of something like this? |
Browse archivesActive forum topics |
Recent comments
22 weeks 2 days ago
22 weeks 2 days ago
22 weeks 2 days ago
44 weeks 3 days ago
48 weeks 5 days ago
50 weeks 2 days ago
50 weeks 2 days ago
1 year 6 days ago
1 year 5 weeks ago
1 year 5 weeks ago