56,452 reputation
5159252
bio website mathprogramming-intro.org
location St. Petersburg, Russia
age 37
visits member for 2 years, 6 months
seen 2 hours ago

Ok, an obligatory note: opinions expressed here are mine and not those of my employer.


Jul
1
comment What's a non-trivial Mathematica program involving conscious choice of stack vs. queue data structure?
The example of a trie used to implement prefix word search here, and particularly its application to the Boggle problem are I think good examples where the right choice of data structures was crucial. The first one also uses a stack to collect letters for words, while the last one also uses linked lists to store partial results.
Jun
30
awarded  Informed
Jun
28
comment String templating
@Szabolcs I had similar strategy for Composition, having instead used my own version of it which wasn't unpacking. I wasn't aware of the fact that Composition no longer unpacks. I just checked on the dev.version, and yes, you are right. Thanks for pointing this out. There is (at least) one more issue with Composition, which is good to know, and which I have discussed here in the section "Fixing some speed problems". I did not re-test now, but it is probably still there.
Jun
28
awarded  Good Answer
Jun
28
awarded  Nice Answer
Jun
28
comment Building sparse array from packed arrays
@VanillaSpinIce Not that I know of (which doesn't mean there isn't). It seems that the unpacking is done in the internal code, which constructs the sparse array. I wrote some code which constructs the sparse array from pieces at lower level, but the unpacking was still there - thus I did not post it.
Jun
28
comment Performance tuning in Mathematica?
@bobthechemist Thanks, updated.
Jun
28
revised Performance tuning in Mathematica?
Added a mention of Associations
Jun
27
comment Building sparse array from packed arrays
It looks like there is some internal unpacking going on, for large enough lists. It is possible to construct the pieces of the SparseArray without unpacking, but it looks like they are still unpacked internally.
Jun
27
comment Building sparse array from packed arrays
There is unpacking if you try this on larger arrays, of e.g. 100 elements. But to see it, you have to enable On["Packing"] before running the code.
Jun
26
comment String templating
@Kuba I agree. I don't consider this style the most powerful (in the sense that it does not really allow to introduce qualitatively more powerful abstractions), but it can be applied to the majority of tasks where Mathematica shines, and it is still considerably more expressive that the "usual" one where component functions are not singled out explicitly.
Jun
26
comment String templating
+1 for using the Composition-style code. It had become my preferred style too, some time ago. New operator forms (curried functions) for many built-in functions in V10 makes this even much easier to use.
Jun
26
comment Is learning haskell still necessary to MMA users?
I actually think that someone who knows one or a few general-purpose functional languages really well, can quickly become really good in Mma too. The sooner you broaden out, the better programmer you become, in Mma or other language. The important thing IMO is to become pragmatic and clearly see advantages and flaws of any given language / tool, for a given task. Also, one needs to be able to distinguish real problems, inherent to the task at hand, and problems generated by the system or language being used, which have nothing to do with the essence of your task / problem proper.
Jun
26
comment Is learning haskell still necessary to MMA users?
FP layer in Mathematica is rather peculiar, as I briefly explained here. There are a number of advantages in learning FP using a general purpose FP language, such as Haskell (I don't know Haskell yet). You will benefit from real general support for persistent data structures, currying, laziness, real type system, and advanced abstractions. Also, strong developer community and tons of high quality code to learn from. And, far less perplexing performance model.
Jun
25
comment Defining a pure function involving a function argument
I don't know. Perhaps one can come up with some example, where the renaming will work differently. But I am opposed to this approach in principle. It's just not a robust code. If the renaming mechanism is, for example, changed in later versions, even slightly, this will stop working.
Jun
25
comment Defining a pure function involving a function argument
I strongly advise against this kind of code. You use the specific knowledge about certain implementation details, which makes this error-prone.
Jun
25
comment How to make a function with its own options as well as passing options to other functions
@Mr.Wizard I probably learned much more on SO and SE from you and others than the stuff I found out on my own or learned from other sources. Moreover, my way of learning is certainly not the most effective, because of the "find it out myself" mantra. I would've probably learn much more had I been more open to it.
Jun
25
revised How to make a function with its own options as well as passing options to other functions
added 290 characters in body
Jun
25
comment How to make a function with its own options as well as passing options to other functions
@Mr.Wizard I really didn't remember. Will edit this in.
Jun
24
comment How do I save/export a list so that it can later be easily imported as a list again?
@Szabolcs Ok, apparently we agree on all points.