JXN versus Java

no compilation

no variable declarations

simplified syntax

no type cast necessary for object references

controlled type cast for primitive values

exceptions are handled automatically

array extensions

pluggable arithmetic for primitive types

  • safe arithmetic (default: automatic change of type prevents overflow and loss of precision)
  • - see PluggableArithmetic.html, JxnPortable/docs/

  • java arithmetic (overflow handling as in java, usefull for prototyping)
  • - to change to java arithmetic enter:
        JxnPrimitiveWrapper.setPluggable( "Java" )
    - to return to safe arithmetic enter:
        JxnPrimitiveWrapper.setPluggable( "Safe" )

missing java operators (relational, boolean, bitwise)

  • available as static methods in class JxnUtilities:
  • - relational:  eq, ne, lt, le, gt, ge, isSame, isNull
    - boolean:  not, and, or, exor
    - bitwise:   not, and, or, exor, left, right, right0

  • in JXN the arithmetic operators also used for boolean x and y are given in the table:

  •  JXNJava
    exorx ^ yx ^ y
    not-x!x
    andx * yx & y
    orx + yx | y

    the operator preference for boolean is the same as for arithmetic operands

no L-values (→ Wikipedia: de | en)

  • instead of  arr[i] = expression use  set( arr, i, expression )
  • instead of  obj.fieldname = expression use  set( obj, "fieldname", expression )
  • ( note: slider dependency is not transfered to arr and obj => subsequent statements depending on arr or obj are not repeated,
    see SliderRepeatNopDemo.html and use  nop(depVar) to force repetition of statements depending on arr or obj )

also see JxnMissingFeaturesWorkaround.html


design objectives of JXN

  • quick math, alternative for pocket calculator, function plotter

  • slider animated demos (standalone and embedded in html the later no more works 😞 with abandoned Java → Applets. Java → Web Start is a more than poor substitute)
  • quick development of (not too big) applications (see gallery for examples)

  • data analysis (see tutorial)

  • REPL for java (read-eval-print-loop)
  • rapid prototyping (exploring java features)
  • extensibility by user defined java classes

  • not intended for large (type) safe applications (my recommendation, however some people do really big data bases with MS Excel)