Skip to content

Commit

Permalink
FIx intro to manual chapter on types (#26312)
Browse files Browse the repository at this point in the history
The paragraph I edited in this chapter of the manual on types confused me when I was a Julia newbie, and I still find it confusing.  How do type annotations simplify a program?  Improve performance?  I rewrote it to state the purpose of type annotations more accurately,
  • Loading branch information
StephenVavasis authored and StefanKarpinski committed Mar 3, 2018
1 parent d02546a commit acb1898
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions doc/src/manual/types.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,11 @@ of function arguments to be deeply integrated with the language. Method dispatch
detail in [Methods](@ref), but is rooted in the type system presented here.

The default behavior in Julia when types are omitted is to allow values to be of any type. Thus,
one can write many useful Julia programs without ever explicitly using types. When additional
one can write many useful Julia functions without ever explicitly using types. When additional
expressiveness is needed, however, it is easy to gradually introduce explicit type annotations
into previously "untyped" code. Doing so will typically increase both the performance and robustness
of these systems, and perhaps somewhat counterintuitively, often significantly simplify them.
into previously "untyped" code. Adding annotations serves three primary purposes: to take advantage
of Julia's powerful multiple-dispatch mechanism, to improve human readability, and to catch
programmer errors.

Describing Julia in the lingo of [type systems](https://en.wikipedia.org/wiki/Type_system), it
is: dynamic, nominative and parametric. Generic types can be parameterized, and the hierarchical
Expand Down

1 comment on commit acb1898

@nanosoldier
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Executing the daily benchmark build, I will reply here when finished:

@nanosoldier runbenchmarks(ALL, isdaily = true)

Please sign in to comment.