QuoteOriginally posted by: ehQuoteOriginally posted by: neuroguyMatlab is quick, but its very dirty. How so?Well its partly a matter of personal preference I guess, but here is my justification. Matlab is fast to use for three reasons (or so):1. It is minimally syntactically fussy. Hence writing procedures is more or less as easy as it could be.2. If you can start to think in terms of linear algebra, the code can be very condensed.3. Lots of things are implemented using built in functions.In my opinion a 'clean' language permits the programmer to optimise the explicitness/conciseness tradeoff of their code. On this basis,C is clean - its very explicit and can be made pretty concise, but equally it can be written in a very self explanitory fashion. There is a lot of choice about style.Python/Ruby are clean, although multiparadigm, the programmer can express the algorithm very clearly. Indeed some of the weird fussyness of python exists to enforce this idea. Of course in python there are scads of functions in libraries, but the 'everything as object' philosophy means that use of these functions carries its own structural logic.C++ can be written to be clean - perhaps is more easily abused - but on the other hand there is infinite expressive and sylistic power. Alteratively a dirty language 'forces your hand'. Hence you can find your self hacking around the features of the language rather than getting that feeling of 'building'.Matlab encourages programs that make extensive use of implicit knowledge about functions and matrix multiplications. Indeed to write quick code, you have to write it this way. Hence I would say it is useful, but not clean, because it forces you to think about things in certain ways and sometimes that gets in the way of the structures you are trying to express. Of course if you are doing everything using matrix multiplication its great, but in my experience there are often bits that don't easily fit that paradigm.

Last edited by neuroguy on July 4th, 2012, 10:00 pm, edited 1 time in total.

- exneratunrisk
**Posts:**3559**Joined:**

neuroguy, interesting assessment.We are hybrid programmers, and this is what I though of Mathematica and Idealism vs Realism in Programming.From the beginning, we have implemented our pricing and calibration engines in C++. And we have integrated them into Mathematica enabling high level domain specific programming - instruments, models, methods (organized orthogonally) as foundations for building instrument and scenario groups, exploiting symbolic parallelism, driving CUDA over the grid, ... After 10 years experience we reinvent everything. Our core engines will be reimplemented in OpenCL and the domain-specific layer will become multi language. It will have representations in C++, Python and other general purpose languages, like, C#, Objective C, Java, .. and special purpose languages: Mathematica, MatLab .... We call this a reverse innovation - it was only possible because of the experiences with the Mathematica programming layer.What do you think (to me it sounds you have made a similar "Wittgenstein's Ladder" experience)?

Last edited by exneratunrisk on July 8th, 2012, 10:00 pm, edited 1 time in total.

QuoteOriginally posted by: exneratunriskneuroguy, interesting assessment.We are hybrid programmers, and this is what I though of Mathematica and Idealism vs Realism in Programming.From the beginning, we have implemented our pricing and calibration engines in C++. And we have integrated them into Mathematica enabling high level domain specific programming - instruments, models, methods (organized orthogonally) as foundations for building instrument and scenario groups, exploiting symbolic parallelism, driving CUDA over the grid, ... After 10 years experience we reinvent everything. Our core engines will be reimplemented in OpenCL and the domain-specific layer will become multi language. It will have representations in C++, Python and other general purpose languages, like, C#, Objective C, Java, .. and special purpose languages: Mathematica, MatLab .... We call this a reverse innovation - it was only possible because of the experiences with the Mathematica programming layer.What do you think (to me it sounds you have made a similar "Wittgenstein's Ladder" experience)?According to wikipedia, the statement in Tractatus Logico-Philosophicus that "Wittgensteins ladder" originates from is:"My propositions serve as elucidations in the following way: anyone who understands me eventually recognizes them as nonsensical, when he has used them - as steps - to climb beyond them. He must, so to speak, throw away the ladder after he has climbed up it."Which is a beautiful thing in its own right, but in the context of programming, I think it nicely encapsulates the ever present problem that there is no perfect programming language. One way around this is to build systems so that you can use different languages for different things. Coding extensions for MATLAB or Mathematica is a weak form of this. But if one is going to do this, it is not a big leap to discard MATLAB and mathematica completely and look to other high level languages to perform the same role. The advantage of this is that it provides flexibility. I probably have been through this process somewhat. I always used to be programing in one langauge at a time. I would find certain tasks easy, but others would either be obscured by the language or would become herculean to implement. As a result of working on neural simulators however I was exposed to the practice of everything having multiple interfaces. Hence there is usually more than one way (and language) to solve a given problem. This probably steepens the learning curve, but is certainly powerful. I guess with programming, once you discard the ladder, the actual language and platform becomes less important than the structure of the code you are able to write.

- exneratunrisk
**Posts:**3559**Joined:**

QuoteOriginally posted by: neuroguyQuoteOriginally posted by: exneratunriskneuroguy, interesting assessment.We are hybrid programmers, and this is what I though of Mathematica and Idealism vs Realism in Programming.From the beginning, we have implemented our pricing and calibration engines in C++. And we have integrated them into Mathematica enabling high level domain specific programming - instruments, models, methods (organized orthogonally) as foundations for building instrument and scenario groups, exploiting symbolic parallelism, driving CUDA over the grid, ... After 10 years experience we reinvent everything. Our core engines will be reimplemented in OpenCL and the domain-specific layer will become multi language. It will have representations in C++, Python and other general purpose languages, like, C#, Objective C, Java, .. and special purpose languages: Mathematica, MatLab .... We call this a reverse innovation - it was only possible because of the experiences with the Mathematica programming layer.What do you think (to me it sounds you have made a similar "Wittgenstein's Ladder" experience)?According to wikipedia, the statement in Tractatus Logico-Philosophicus that "Wittgensteins ladder" originates from is:"My propositions serve as elucidations in the following way: anyone who understands me eventually recognizes them as nonsensical, when he has used them - as steps - to climb beyond them. He must, so to speak, throw away the ladder after he has climbed up it."Which is a beautiful thing in its own right, but in the context of programming, I think it nicely encapsulates the ever present problem that there is no perfect programming language. One way around this is to build systems so that you can use different languages for different things. Coding extensions for MATLAB or Mathematica is a weak form of this. But if one is going to do this, it is not a big leap to discard MATLAB and mathematica completely and look to other high level languages to perform the same role. The advantage of this is that it provides flexibility. I probably have been through this process somewhat. I always used to be programing in one langauge at a time. I would find certain tasks easy, but others would either be obscured by the language or would become herculean to implement. As a result of working on neural simulators however I was exposed to the practice of everything having multiple interfaces. Hence there is usually more than one way (and language) to solve a given problem. This probably steepens the learning curve, but is certainly powerful. I guess with programming, once you discard the ladder, the actual language and platform becomes less important than the structure of the code you are able to write.Understand the essence of programming by programming? But still the paradigm seems to be important - in one paradigm, it does not seem to be difficult to generate interfaces from one to the other language...

- exneratunrisk
**Posts:**3559**Joined:**

Adding to the discussion with neuroguy:In Examples of our Multi Language Cancept we show code examples for the valuation of an instrument under a Heston model in C++, Python, Mathematica, MatLab.

How many MATLAB toolboxes make a Mathematica 9?

- Cuchulainn
**Posts:**64439**Joined:****Location:**Drosophila melanogaster-
**Contact:**

QuoteOriginally posted by: exneratunriskAdding to the discussion with neuroguy:In Examples of our Multi Language Cancept we show code examples for the valuation of an instrument under a Heston model in C++, Python, Mathematica, MatLab.Herr Exner,I see you use the Builder pattern. Very good. Have you looked at dynamic injectionBTW there is a discussion of Builder for MC system on qfcl forum.

Last edited by Cuchulainn on December 2nd, 2012, 11:00 pm, edited 1 time in total.

"Compatibility means deliberately repeating other people's mistakes."

David Wheeler

http://www.datasimfinancial.com

http://www.datasim.nl

David Wheeler

http://www.datasimfinancial.com

http://www.datasim.nl