31

Performance issues with large numeric arrays very often happen because of unpacking of PackedArrays. Numeric operations on Packed arrays are very well optimized, while unpacking and operations on huge unpacked lists are usually slow. If you turn on packing warnings (On["Packing"]) before your tests, you will see that applying Plus to packed array leads to ...


30

Edit: This solution no longer works due to changes in the Entity framework. The "UnderDevelopment" EntityClass no longer exists. It's not part of EntityClassList["WolframLanguageSymbol"] or WolframLanguageData["Classes"] anymore. The symbols that are market [[EXPERIMENTAL]] in the documentation are in their own entity class of the "WolframLanguageSymbol" ...


25

Updated to include both unary and binary operators One idea is to use the usage message of a symbol as a clue that it has a special display form, probably with no built-in meaning. For example: ?TildeTilde The following 2 functions check the usage message of a symbol to see if it contains "displays as" or "formats as", and then weeds out those symbols ...


23

There are a lot of commands! One way to get a list is to use Names["*"], which will return all the symbols Mathematica knows. Since commands start with capital letters, you can gain more control over the list by asking for only a subset. For example, all = {"A*", "B*", "C*"}; Names[#] & /@ all provides a list of all commands that start with A, B, or C....


23

New functions conveniently carry the "NEW in 10.4" header in their documentation page. Since the docs are blessedly written as Mathematica notebooks, and notebook are text files, we can just use grep or a similar tool to hunt for those help files that contain that header. New in 10.4 Inspection of one such file with a text editor reveals that the raw cell ...


22

Disclaimer: This answer is written from a user's point of view. For useful insider information on this topic see this discussion with Mathematica developers on Community Forums. Introduction Binary serialization is rewriting expressions as an array of bytes (list of integers from Range[0, 255]). Binary representation of expression takes less space than a ...


21

In Mathematica, "everything is an expression". All data and code is represented in the same manner, as Mathematica expressions. Thus expressions must be very general. They need to be able to represent anything that appears in the language. There is usually a tradeoff between generality and performance. Mathematica expressions, which can contain ...


20

Perhaps the simplest way is to use the built in function Information, which is the programmatic form of ?? Information[#, LongForm -> False] & /@ functionslist gives a long list of (short) function definitions. By the way... it's easy to figure this kind of thing out -- in this case, I highlighted the symbol ?? (double question mark) and pressed ...


19

If my answer for the 2D case lacks detail, it's because Typeset`MakeBoxes is an internal, undocumented function. That makes it hard to say anything authoritative about how it works. Essentially though, we are defining the custom primitive in such a way that the definition only applies during conversion of a graphics expression to boxes. Here's a version of ...


17

The original MMa fonts were designed by Andre Kuzniarek and Andrew Hunt. From Andre: Indeed, those are old easter eggs, and there used to be glyphs for each of us. They were "abandonded" in later releases. All were involved in dealing with font design, encoding and integration going back to the initial Unicode release (V3). Myself, Andy Hunt, Robby ...


16

The reason is to prevent users to mess with it. Unprotecting something is not necessarily dangerous, but unprotecting everything definitely is. Performance is probably not the issue. The real danger is that you replace a very important feature of a built-in symbol by chance. Since built-in symbols often have the ReadProtected attribute, you cannot check ...


15

You can executive the code in mma 10 or above version EntityClass["WolframLanguageSymbol", "Atomic"]//EntityList But is not all atomic function,as I know.


15

Remember that WolframLanguageSymbol entities always return the state of latest version of the Wolfram Language; not the version of the language you currently have installed. The Entity function calls appear to be returning the correct information when you take this into consideration. New in 10.4 EntityList[Entity["WolframLanguageSymbol", {"...


15

Introduction @Shadowray has already put a finger on the source of the time difference in the OP's example: unpacking. But it seems to me that the question points out just a symptom of a broader question of how best to add up lists and arrays. One might want to consider the problem of addition from a design perspective and consider the roles of the tools ...


15

There is a typesetting step after formatting, and MakeBoxes definitions do not require unprotecting Hold, you will just add more DonwValues for MakeBoxes. MakeBoxes[Hold[a___], fmt_] := With[ {foo = MakeBoxes[Panel[Column[{a}]], fmt]} , InterpretationBox[ RowBox[{"Hold", "[", foo, "]"}] , Hold[a] ] ] Hold[1 + 1, 2 + 2, 4 + 4] It ...


15

find the year that MMA functions were introduced via programmatic calls You can use, as an example WolframLanguageData["DSolve", "DateIntroduced"] So it is a matter of just running the above over all the commands you want. The above returns a DateObject See Looping through all functions defined in Mathematica for example of looping ...


15

Preamble The biggest problem with Head seems to be that it plays two distinct, although related, roles in the language: The 0 - th element of an expression The type of an expression Both expressions and types in WL have their own issues. Types and expressions Simple type model First of all, while WL is a dynamic untyped language, types certainly exist and ...


14

The issue is that to SetDelayed1 (:=), Function is just a normal head. For your third example, this means the following: You are defining a downvalue for F that says "every time you see F[something] replace it with the expression Function[x, 2 x + 1][x^2], where all x are to be replaced by something". Notice that at no point in that process is the ...


13

List available as EntityList[EntityClass["WolframLanguageSymbol", "Experimental"]]


13

Single-argument functions: funclist = Select[("ArgumentsPattern" /. SyntaxInformation[#]) === {_} &][ FromEntity /@ MathematicalFunctionData[]]; Grid[Prepend[Thread[{funclist, Through[funclist@2]}], Item[#, Background -> LightBlue] & /@ {"f", "f @ 2"}], Dividers -> All]


12

As Mr.Wizard already noted, it's not clear whether "operator form" occurs in the documentation of every command that has an operator form (or conversely, e.g., NDSolve*, which references the operator form of Inactive). docdir = FileNameJoin[{$InstallationDirectory, "Documentation", "English", "System", "ReferencePages", "Symbols"}]; docs = FileNames["*"...


12

Get the full list of Mathematica functions here: myFunctionList = Import["http://reference.wolfram.com/language/guide/\ AlphabeticalListing.html"]; Strip the list of header and footer material, and select a random element: RandomChoice[StringSplit[StringTake[myFunctionList, {3245, -1225}]]] Or, based on the approach of bill s: RandomChoice@Flatten[Names[...


12

ToExpression["\\[" <> # <> "]"] & /@ {"Mercury", "Venus", "Earth", "Mars", "Jupiter", "Saturn", "Uranus", "Neptune"} Gives (also corrected the code thanks to Kuba)


12

wd = WeightedData[Tuples @ Range @ Dimensions @ table, Join @@ table] Mean @ wd {22.3232, 33.9072} Also Total[MapIndexed[#2 # &, table / Total[table, 2], {2}], 2] (* and *) Dot[Join @@ table , Tuples[Range @ Dimensions @ table]] / Total[table, 2] {22.3232, 33.9072}


12

The oldest example I can think of is Medium. Version 1.x: It got deprecated after version 2, and was then re-introduced in version 6; that usage persists to this very day. I suppose Accumulate[] also counts. Version 1.x: If the usage looks awfully familiar, this is because it now exists as FoldList[], and Accumulate[] was then repurposed in version 6.


11

They are: C D E I K N O It's easy to know. Just open a notebook and type the capital alphabet. Those changing color to black are protected.


11

To convert my comment into an answer: one can naively run Select[Names["System`*"], StringLength[#] == 1 &] to pick out built-in symbols that are only one character long. This will work in older versions of Mathematica, but ever since the introduction of formal symbols (which are, to be fair, in the System`​ context and are one-character expressions as ...


11

As you mentioned, And is not Orderless just for efficiency; its arguments are evaluated one by one to prevent unnecessary computation. Orderless attribute would require sorting, which require more computation... In a && b && c: a is evaluated. If it is False, the evaluation ends, and the output is False. If not, the evaluation proceeds. b ...


11

(analysis current as of Mathematica V11.0.1) UnpackOptions is a macro that provides a convenient notation for accessing option values within a function definition. At definition time, it transforms a source macro expression of the form: UnpackOptions[option1, option2] into an expanded expression of the form: {option1, option2} = OptionValue @ {"Option1",...


11

Here is an approach based on reading the Front End resource UnicodeCharacters.tr. This method finds some operators that do not presently appear in Carl Woll's list including documented operators CapitalDifferentialD, DifferentialD, and Square, and runs much more quickly. However it also misses the bracketing operators i.e. AngleBracket, BracketingBar, ...


Only top voted, non community-wiki answers of a minimum length are eligible