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

Trent, tried to reply to you in your other post in this thread but it doesn't seem to a "reply" link (weird.)

wrt to http://quantlib.org/reference/_equity_option_8cpp-example.ht...

It should be fairly straightforward to implement enough of Quantlib in Common Lisp IF you are able to implement the same algorithms in any other language. The data structures and data types can be mechanically converted (the Lisp numeric tower if far richer than C++'s numeric capabilities and it might obviate some things) however, it's the numeric algorithms that require expertise to reimplement. A 1:1 translation wouldn't produce an attractive result.

By algorithms I mean stuff like the monte-carlo constructors, MakeMCEuropeanEngine, etc.

The rest of the stuff would look far more attractive in Common Lisp. deftype can tidy up type definitions. The lisp pretty printer and the format function look way more compact than those huge blocks of cout, etc.

One way I can think of is to create C wrappers for C++ and call those wrappers from Lisp. You might have to struggle with Boost, templates and other design patterny crap tacked onto C++ though :-( one way I know is to reify template arguments into function arguments. e.g:

new BinomialVanillaEngine<JarrowRudd>(bsmProcess,timeSteps)

==>

binomial_vanilla_engine (JARROW_RUDD, bsm_process, time_steps)



The financial engineering is not a problem at all. I just asked the two questions that spawned these posts because I was interested in what type things Lisp was being used for. Google and Wikipedia are good, but not nearly as helpful as a direct answer from some people responding directly to questions I've posted.

I spent a good deal of last year and most of this year ripping apart both GSL and QuantLib in an effort to teach myself numerical programming. My plan is to just keep pace in Lisp with my MSFE program. Since at least the first few months of the program are likely to cover things I already feel comfortable with, the plan is--listen in lecture-->go home and code it up.


Brent, if you're good with GSL and basic numeric analysis, take a look at CL-GSL:

http://common-lisp.net/project/cl-gsl/

other stuff

http://www.cliki.net/Mathematics

Feel free to ask me privately for any help you might need, there is also the #lisp channel on freenode.

Fun times are ahead :-)

Cheers!




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

Search: