Syntax and speed

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • bearophileHUGS@lycos.com

    #1

    Syntax and speed

    ShedSkin (http://shed-skin.blogspot.com) has taught me something:
    simple syntax and high speed can often go together, in a computer
    language.

    This means two things:

    1) A "fast language" can have a simple (python-like) syntax. For
    example a language fast as C++ can allow:
    d = {"hello":1}
    as a syntax to define a dictionary (with implicit typing like in
    Haskell, etc.)
    Sometimes the user of a fast language needs something different than
    the built-in dicts. So he/she can import a different data structure
    (like ordered dicts) from the standard lib. This gives an easy syntax
    for the most common case (most times normal dicts are fine) but it
    allows faster and more fitting data structures (with a little less
    simple syntax) for the harder situations. (If the code doesn't use the
    built-in dicts then their compiled code can maybe be stripped from the
    final executable.)

    2) A "slow but elastic" language (Python and the like) can "compile"
    some things, to go faster than now (Psyco shows this already), because
    often scripts don't use/need too much dynamic tricks.

    Bye,
    bearophile

Working...