new package adoption

acer's picture

Every now and then someone will post here on Mapleprimes and the code will use an older package such as linalg or stats. Quite often it is clear that the poster is new to Maple. Yet these packages have been superceded with new ones, eg. LinearAlgebra and Statistics.

One obvious question that then arises is: how did this user decide to use the older package?

I just did a google search on linear algebra maple. Of the ten results on the first page, eight were about linalg. A few were links to texts. many were links to Maple tutorials at colleges or universities.

So, in the eight years since LinearAlgebra was released in Maple 6, many college tutorials continue to use the older linalg package. It seems safe to surmise that this is a likely cause of why students and new users get directed to the out-of-date packages.

What can be done about it? Well, it shouldn't be that much work (most are short and simple) to rewrite these pages using the newer packages,and send the updated version directly to the relevant site administrators.

acer

Comments

alec's picture

an idea

I didn;t try that, but such things as linalg:=LinearAlgebra etc, with replacing old functions with new ones with similar functionality should work - why not?

Alec

acer's picture

backwards compatibility

Users will expect that their old code works, as is. And the syntax of the commands from the two packages is different. So the direct substitution of the package names, in commands, would not work I think.

One can observe that effort has been made to more strongly deprecate linalg, in the Maple help-system in Maple 12. For example, entering,

> ?linalg

> ?stats

takes one to the Student[LinearAlgebra] and Statistics help-pages, repectively, in Maple 12.

It's a little heavy handed in parts. For example issuing ?array takes one to the Array help-page, but I don't see any obvious cross-link from the top of that page to ?array(deprecated). One can find similar problems, when trying to access other older deprecates pages in Maple 12 without knowing in advance that they get accessed by the syntax ?<fcn>(deprecated). In the Standard interface, the help-browser should show a list of relevant matches, but in the Classic and commandline interfaces it's more problematic.

acer

alec's picture

It's hard

It's hard. I tried to explain that to Fred Lunnon - a brilliant mathematician and one of the first programmers out there - he started programming in 50s with the first IBM mainframes, whatever their names were (before 360) . Try to do that yourself - read his MapleGrumbles page in the Maple Wiki.

Whatever pagan (whoever he or she is - I have no idea) wrote about his page in his/her comment on the Maple wiki, is just ridiculous. It sounded similar to me like if somebody wrote that Don Knuth don't understand what TeX is (he wrote it, as well as Fred Lunnon is the closest thing that I know to the father of a lot of modern programming.)

Alec

acer's picture

what "compiler"

What is the "compiler" that gets mentioned on that page? Maple uses an interpreter, and doesn't (normally) compile code. Since the usual (not evalhf) Maple interpreter doesn't compile (not even just in time), it doesn't seem surprising to me that adding type-checks incurs extra runtime cost. It seems like a misunderstanding about how Maple works. That's not any disparagement -- Fred Lunnon did not create Maple in the way that Knuth wrote TeX.

Maple did get a Compiler routine, a few years ago. But Compiler:-Compile doesn't know how to handle that code, as it stands. (The Compiler knows about Arrays, but not arrays. And it might be more feasible to have the procedure accept the Arrays as arguments, since the Compiler doesn't know how to handle indeterminate index ranges like 0..m+3.)

With a little work, an edited version of the procedure (possibly running inside a wrapping procedure that sets up the Arrays) might be done. I would expect that to get a speed-up of something like a factor of 10-25 or so, for the sub-parts that are "Compilable". One would have to hit it explicitly with Compiler:-Compile.

acer

alec's picture

Fred Lunnon

He is an older guy now (probably, in his 80-s or 90-s)  and he certainly has nothing to do with Maple. He was quite surprised when I told him that Maple is using Arrays now instead of arrays.

Newertheless, Martin Gardner mentioned him a few times in his books (that's how I learned about him).

He is very active in the math-fun group (if you ever heard about that), which is not really very powerful, but still is quite influential (for various reasons), and he is a very good person in real lie (again as well as I can tell that). Try to contact him first before trashing his code publically on the Internet. (or he can, probably, thrash your life, too - just a joke :)

Alec

PS I am deleting all mentioning that I can thrash your life, too. Certainly, I can, but what is the point?

Alec

acer's picture

misunderstanding

Alec, I was not trying to trash anyone's code or cause offence. I am trying to figure out what was meant by the term "compiler". I see that Fred Lunnon also posted his code here on Mapleprimes, and specifically asked about suggestions for it.

Looking closer, it does not look appropriate to use Compiler:-Compile on the initbagperm procedure. That does indeed set up the arrays (which be switched to Arrays of a suitable datatype) which then get passed into procedure nextbagperm which does the hard work. So nextbagperm would be the natural Compiler target.

Initial experimentation indicates some speed-up buy using Compiler:-Compile. At least a factor of 5 at a smaller size. I've posted that as a reply to the original code as posted here on Mapleprimes.

acer

In Classic Maple 12

A Topic search for "array" shows array(deprecated). In some other cases a Full Text Search is needed.

deprecate linalg

It is not obvious that that such stronger deprecation will have a signifficant effect in the academics for some years. The Maple systems running in the student labs, professor and student desktops may be several versions behind. And if the teaching material (either in the web or not) was prepared years ago, it  works in those systems, and it is fit for the teaching objectives, it could be not worthwhile an additional effort investment to accommodate it to the newer package.

 

acer's picture

That was my point

Yes, that was one of my points. If the universities/colleges have not taken the time to update their tutorials, then someone could (likely, relatively easily) do it for them.

acer

Do you have a dimension

of what you are talking about? How many universities, faculties, subjects, countries, languages? Who is that someone that "could (likely, relatively easily) do it" for all of them? And how do you think it would be managed? Who would pay for that?

acer's picture

Maplesoft

I meant that Maplesoft might consider doing it. The tutorials, in particular, are mostly very elementary.

Of course, I do not know how many there are out there. But things get ranked in google for concrete reasons. The more high ranked linalg tutorials that get replaced with LinearAlgebra equivalents, then the better the first search results would become on average.

I just think that eight out of ten, as google search results pointing to the wrong packages, is a sign that some new action should be considered.

acer

Highly improbable

Just as an example, during the period that I was "ambassador" of Maplesoft in Argentina (1994-1998 aprox), I have tracked hundreds of sites where Maple was used, for courses and/or research. Most of them using unlicenced copies. And obviously all those course material was in (Argentinian) Spanish. Along these years, Maplesoft was unable to make something as simple as setting a working sales channel for those individuals/institutions here who wanted to purchase licences.

Clearly, Maplesoft does not have the capacity not the interest to track and reach all the sites in the world were Maple is currently being used, and process such mass of material in Spanish, Chinese, Hebrew, Korean or whatever language, in whatever country. 

acer's picture

not all

The idea is that it's not necessary to reach and fix all the tutorials, to make an effect here. Not even most. Just some. The most "popular" ones, by google ranking, say. The one's which come up in the first 5 pages of google search results, say, would be a decent start.

Suggesting that all such tutorials in the world be edited, by anyone, would be a crazy idea. I wasn't suggesting that at all.

acer

probably a small effect

I find that most people tend to reproduce what they have learned first. So, if eg someone was told to use 'linalg' in a course, by an advisor or a colleague, there are high chances that he will continue using it as long as it works, independently of whether he later happens to cross with one of those top-ten-after-google tutorials. In particular as those tutorials are written in English and most students prefer learning materials in their own language.

It may be a decent start, but my guess is that it will have a very small effect for several years in reducing the number of requests about the use of deprecated packages to Mapleprimes or elsewhere. 

Anyway, it is an experiment worth trying if statistics are made to measure such effect.

 

 

 

Wrappers?

A good question is: is it more work to rewrite people tutorials or to rewrite linalg as a wrapper for LinearAlgebra? (The same question could apply to stats as well).

It looks like Maplesoft had the old grobner's guts replaced with wrappers for Groebner.  I am guessing the same was not done for linalg because 1. matrix vs. Matrix and 2. there are a lot more commands in linalg than in grobner.  But it seems like matrix could be made to create a Matrix, etc. 

acer's picture

last-name-eval, etc

The matrix/vector objects have last-name-eval, while Matrix/Vector objects do not. I don't see how this difference could not cause serious and possibly insurmountable difficulties in a wrapper approach.

It's also not just that people shouldn't use linalg because it's old syntax. It's also more awkward syntax. The idea is to show them the nicer, cleaner syntaxes. Wrapper approaches perpetuate things which are not pretty (LNE, evalm, `&*`, etc).

acer

I think that the informatin in help page is not enough

I think that in many cases people do not know that those packages are deprecated. I think it would be good if the user would be informed about this, for example when loading the module.

As a side effect the authors would be "forced" to rewrite their tutorials since it doesn't look pretty when the program is complaining.

forced?

Who knows? My reaction, when a new version of a program includes some nagging, is to keep using the older, not-nagging version as far as possible. Besides, those individuals/sites may not upgrade anyways to the nagging version.

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
}