Loading ...
Sorry, an error occurred while loading the content.

kokogut-0.6.1 released

Expand Messages
  • Marcin 'Qrczak' Kowalczyk
    Kokogut is a compiler of the Kogut language, written in itself. http://kokogut.sourceforge.net/ New in Kokogut-0.6.1 (25 January 2006), a release with readline
    Message 1 of 1 , Jan 25, 2006
    • 0 Attachment
      Kokogut is a compiler of the Kogut language, written in itself.

      New in Kokogut-0.6.1 (25 January 2006), a release with readline
      interface and settable default numeric types:

      - kokoc doesn't pass -O2 to gcc by default. It accepts options
      beginning with -O and passes them to gcc.

      - Assignment returns Null rather than the assigned value.

      - The sigsafe library is used when available,
      It is recommended, otherwise signal handling will have race
      conditions. When building sigsafe, set debug=0 in SConstruct.

      - New functions:
      * GetOrSet dict key absent - set dict@key to absent() if it did not
      exist, and return it
      * Unsafe{Eq,NE,LT,GT,LE,GE,Neg}Int in module Unsafe
      * Cplx in module Math (replaced) - convert an arbitrary
      representation of complex numbers into CPLX
      * WithoutWaiting in module Threads
      * CloseAll - execute all actions even if some of them fail
      * ReadByteArrayFrom - read a fixed number of bytes
      * ReadBlockAt, WriteBlockAt, ReadBlockAhead, CanReadAhead -
      I/O at the specific position, without moving the file pointer
      * AttachDynamic - attach the current dynamic environment to a
      function, i.e. make a function which is executed with bindings
      of dynamic variables taken from the place of AttachDynamic

      - Renamed:
      * HandlerOfSystemSignals -> SystemSignalHandler
      * {Text,Binary}Reader -> {Text,Binary}Input
      * {Text,Binary}Writer -> {Text,Binary}Output
      * ReadBlock -> ReadSomeFrom
      * WriteBlock -> WriteSomeTo
      * FlushingOther -> TiedInput
      * {Byte,Char}InputFilter -> {Byte,Char}FilteredInput
      * InputDecoder -> DecodingInput
      * {Byte,Char}OutputFilter -> {Byte,Char}FilteredOutput
      * OutputEncoder -> EncodingOutput
      * {Byte,Char}InputBuffer -> {Byte,Char}BufferedInput
      * {Byte,Char}OutputBuffer -> {Byte,Char}BufferedOutput
      * Compress{GZip,BZip2} -> {GZip,BZip2}Output
      * Decompress{GZip,BZip2} -> {GZip,BZip2}Input

      - Removed:
      * E in module Math; use Exp 1 instead
      * Cplx in module Math (there is a different Cplx now); use a+b*I
      * HandleSystemSignals; use SystemSignalHandler variable instead
      * ProcessSyncSignals; correct handling of synchronous signals is
      generally done by waiting primitives
      * WithInfiniteBuffer

      - ByteCopyInput and CharCopyInput make a view of the given stream,
      array or string, which can be read without changing the original.

      The stream must support ReadBlockAhead, which in practice means
      that it should be buffered (the buffer will grow) or seekable.

      - Reversed the result of FilterBlock: it returns True when output
      did overflow.

      FilterBlock is no longer called with Null as the input buffer
      (which used to be equivalent to an empty array).

      Revised the meaning of flush. If it's not #none and there is room
      in the output buffer, FilterBlock should not leave anything in the
      input buffer.

      - Non-Unix line separators are supported:
      * 'LineSepDecodingInput input lineSep' wraps input such that
      the given lineSep is translated to "\n"
      * 'LineSepEncodingOutput output lineSep' wraps output such that
      "\n" is translated to the given lineSep
      * TextReader and TextWriter have a named parameter lineSep

      An output lineSep is #lf (Unix), #cr (classic Mac), or #crlf (Windows).
      The default is the value of the dynamic variable DefaultLineSep,
      except that for sockets the default is #crlf. The default value of
      DefaultLineSep is the local convention of the platform.

      An input lineSep can be one of the above, or #auto which accepts
      any of these separators. The default is #auto.

      Setting lineSep to #cr in either direction actually swaps "\n" and

      Since setting an input lineSep to #crlf translates "\r\n" to "\n",
      where the program treats "\n" after translation as line separator,
      in this case either "\n" or "\r\n" separate lines.

      - Elaborated the issue of specifying character encodings:
      * supertype ENCODING for encodings
      * function Encoding converts an encoding descriptor (i.e. either
      encoding or encoding name) to an encoding
      * dictionary NamedEncodings and function NamedEncoding are used
      internally to convert names to encodings

      - EncodingError and DecodingError store the encoding for debugging.
      The other field of DecodingError is now called bytes, not byte, and
      holds the list of bytes which caused the error, or the empty list in
      case of an unexpected end of bytes. ReplaceCodingErrors skips its
      size in input.

      - "\0;" characters in strings passed to C (e.g. file names) are
      detected and reported as errors of type NUL_ENCODING_ERROR.

      - More encodings are supported natively, without using iconv
      (in addition to Latin1Encoding):
      * ASCIIEncoding
      * UTF8Encoding
      * UTF{16,32}{BE,LE}Encoding
      * UTF{16,32}Encoding with an argument which is meaningful for the
      encoder: #be (prepend the BE BOM and use BE), #le (prepend the
      LE BOM and use LE), #noBOM (don't prepend any BOM unless needed
      and use BE). The "UTF-16" and "UTF-32" names correspond to
      UTF{16,32}Encoding #be.

      - UTF8EscapedBytesEncoding is an extension of UTF-8 where any byte
      sequence can be decoded into a string and yields the same byte
      sequence when encoded again. Bytes which would be invalid in UTF-8
      and 0 bytes are prefixed with U+0000 and stored as a character
      between U+0080 and U+00FF or U+0000. On encoding only those
      character sequences prefixed with U+0000 are valid which would be
      invalid in true UTF-8, so different strings encode to different
      byte sequences. Valid UTF-8 byte sequences which don't contain 0
      bytes yield the same results as in true UTF-8. The idea is based
      on UnixEncoding in Mono but slightly different.

      If the environment variable KO_UTF8_ESCAPED_BYTES is set to 1 and
      the default encoding (as determined by KO_DEFAULT_ENCODING or the
      locale) is "UTF-8", then it means UTF8EscapedBytesEncoding instead
      of UTF8Encoding. Specyfying "UTF-8" in the program explicitly always
      means true UTF-8.

      - Parameters of the default StdIn, StdOut and StdErr (encoding,
      line separator, buffering) are determined the first time these
      streams are used, rather than at the beginning of the program.

      Global bindings of dynamic variables are consulted to determine the
      parameters, i.e. they must be assigned to instead of being locally
      rebound to take effect here. Accessing the default StdIn has a side
      effect of accessing StdOut, because of OutputFlushingInput.

      - ProgramName and Parameters are converted from byte strings using
      DefaultEncoding each time they are accessed, until they have been
      assigned or locally rebound. This implies that the program can catch
      decoding errors.

      - DefaultEncoding is determined the first time it is needed. This
      implies that the program can install additional encodings before
      the name of the default encoding is mapped to the actual encoding.

      - The value of a lazy variable is computed in the dynamic environment
      from the place of its definition.

      - New library ReadLine provides an interface to GNU Readline.

      - New library Digest with modules Digest, Digest.SHA1, and Digest.MD5.
      SHA1 code is derived from RFC 3174. MD5 code is derived from the
      RSA Data Security, Inc. MD5 Message-Digest Algorithm (RFC 1321).

      - Removed library QSort. It was not useful (sorting is implemented
      natively), just intended as an example of callbacks, which are
      now better demonstrated in ReadLine, and it was subtly wrong with
      respect to GC.

      - It's easier to use optionally available libraries: appending "?"
      to the name of a library silences the warning if the library is
      not found.

      - Inf and NegInf are considered REAL, and allowed as real and
      imaginary parts of complex numbers.

      They are stronger than InfFloat and NegInfFloat in comparisons
      and arithmetic.

      - New option for showing numbers: inexactSpecial. If not Null,
      it overrides special for inexact infinity and inexact NaN.

      - Transcendental functions return exact numbers when possible, e.g.
      64 %Power (2/3) is exactly 16, Log (9/25) (125/27) is -2/3, and
      Exp (-Inf) is 0. Not all cases of complex rationals are covered
      though because the author doesn't know needed algorithms.

      - Dynamic variable DefaultReal holds a function which converts a real
      number to some specific type. The default is Float.

      DefaultReal determines the type of irrational function results
      derived from rational arguments, the type of literals with a decimal
      point or exponent, and the conversion used in default implementations
      of functions for real arguments.

      Setting DefaultReal to Ratio works for literals but causes
      transcendental functions to loop for most exact arguments, because
      their definitions for INT and RATIO use DefaultReal if they are
      unable to find a rational result.

      - Similarly to DefaultReal, the dynamic variable DefaultRational holds
      a function which converts a rational number to some specific type.
      The default is Ratio.

      DefaultReal determines the type of rational but non-integer function
      results derived from integer arguments, and the conversion used in
      default implementations of functions for rational arguments.

      DefaultRational can be set to Float, in which case e.g. division of
      integers produces a float instead of a ratio.

      - Some arithmetic functions have default definitions which convert
      arguments using Int, Ratio, DefaultReal and Cplx:
      * Int, '+', '-', '*', Quot, Rem, QuotRem, Div, Mod, DivMod,
      BitNot, BitAnd, BitOr, BitXor, BitShift, SizeInBits,
      Ratio, '/', Float, ScaleFloat, Conj, Sqrt, Phase, Exp, Log, Power,
      Sin, Cos, SinCos, Tan, SinH, CosH, SinCosH, TanH,
      ASin, ACos, ATan, ASinH, ACosH, ATanH

      Other arithmetic functions have default definitions in terms of
      other operations rather than by conversion:
      * Abs, Signum, Sqr, IsDivisible, IsEven, Floor, Ceiling, Trunc,
      Round, GCD, Hypot

      Special cases:
      * '==', '<', '<=' - default implementations convert real numbers to
      Ratio instead of DefaultFloat
      * IsFinite, IsInfinite, IsNaN, SignBit, DecodeFloat - defined for
      each concrete type separately, without default implementations

      - Float arrays accept any real numbers as elements and convert them to

      - Inferring regions where signals can be processed has been fixed and
      made more consistent. In particular:
      * Locking a mutex or read-write lock with signals unblocked is
      * In synchronous mode only one signal at a time is handled. Any
      further signals are handled only if the reason to wait still
      * GarbageCollect, MaybeGarbageCollect and Close in synchronous mode
      are no longer interruptible.
      * WaitForProcess in synchronous mode processes a pending system
      signal only if it would actually wait.
      * If a signal is sent before the target thread started waiting in
      synchronous mode, further signals are correctly blocked while
      handling the signal.
      * If a signal is sent before the target thread is going to wait for
      opening a file or for a process in synchronous mode, the signal is
      handled before waiting.
      * The time window when handling a system signal sent just before a
      blocking system call is delayed after the system call returns is
      reduced in case of some functions. Unfortunately with standard
      Unix APIs it cannot be entirely eliminated.

      The following operations are interruptible in synchronous mode
      when they have to wait:
      * Wait
      * WaitForThread
      * accessing a lazy list
      * Sleep
      * SleepForever
      * Take, TakeFirst
      * opening a fifo
      * reading from or writing to a pipe, fifo, socket, or a device which
      may block (like a terminal)
      * Connect, Accept
      * WaitForProcess

      The following operations may cause the thread to wait but are not
      interruptible in synchronous mode:
      * Lock
      * Unlock, Wait (when relocking at the end)
      * LockRead, LockWrite, LockReadWillWrite, ChangeLockToWrite
      * UnlockRead, UnlockWrite, UnlockReadWillWrite, ChangeLockToRead
      (when relocking at the end)
      * accessing a lazy variable
      * executing a module
      * FinalizeWeakRef
      * returning from a C callback in a wrong order, if pthreads are not

      - Functions Using and Using_ accept also 4 arguments, with separate
      functions for rollback and commit instead of the single release,
      called depending on whether the body failed.

      - Changed event queues:
      * The event is specified as a single action which either returns,
      or fails, or calls EventReady with an argument being an action
      to be performed when this event is taken.
      * There is no attempt to detect whether the final action waits.

      - New algorithm for generating random numbers: ISAAC by Bob Jenkins
      <http://burtleburtle.net/bob/rand/isaacafa.html>. Provided by
      module Random.ISAAC. The constructor is RandomStateISAAC.

      The constructor for Mersenne Twister in Random.MT got renamed
      to RandomStateMT, but module Random reexports it under the name

      - In strings \cX denotes a control character when X is an ASCII letter
      or one of these characters: @ [ \ ] ^ _ ?

      - In strings "\ " is a space instead of "\s". This is useful after
      a backslash and line break.

      - If libffi is available, we provide the LibFFI library which just
      links to libffi and adds options to compiler invocations; it doesn't
      provide any modules. Libffi is useful to wrap function closures in C
      function pointers, among other things.

      - Parsec no longer requires characters to be comparable, but they must
      be hashable.

      - CopyStream no longer flushes the output stream at the end.

      - The Calc example moved to examples directory and installed under the
      name kocalc. It now supports float constants and more functions.
      Type '?' for help.

      - Bugs fixed:
      * SizeInBits returned wrong results for small negative numbers.
      * IsEven was wrong with an earlier version of GMP than 3.1.
      * Log was sometimes returning NaN instead of a complex number.
      * Passing strings to C using EncodeSizedCString truncated the
      last character if there were any non-ASCII characters.
      * NextPermutation was repeating a permutation when some of inputs
      were equal.
      * There were memory leaks in dividing big integers into ratios.
      * Get for WEAK_HASH_DICT{,_BY} no longer holds the lock when
      applying absent and present.
      * Fixed the logic of estimating the amount of external memory
      (e.g. from malloc) to trigger GC earlier.

      __("< Marcin Kowalczyk
      \__/ qrczak@...
      ^^ http://qrnik.knm.org.pl/~qrczak/
    Your message has been successfully submitted and would be delivered to recipients shortly.