pike.git / CHANGES

version» Context lines:

pike.git/CHANGES:1:   Pike 8: Changes since Pike 7.8 (scratch area for future release notes)   ----------------------------------------------------------------------   -- New language features      o local:: +    o variant    | class Test1 { int b(); }    | class Test2 { int a(); }    |    | class Foo    | {    | variant string foo( object q ){ return "Genericfoo"; }    | variant string foo( Test1 x ) { return "Test 1"; }    | variant string foo( Test2 x ) { return "Test 2"; }    |
pike.git/CHANGES:18:    | variant int bar( int(2..2) s ) { return 2; }    | }      o New typechecker      o Support for ", ##__VA_ARGS__" cpp feature.      o Allow '.' to be used as an index operator in the few places id did    not work before.    - o safe index -  + X[?10] -- index X with 10, or if X is null, evaulates to 0. -  + X?->foo -- index X with foo, or if X is null, evaluates to 0. + o "Safe" index +  Copied from a popular extension to other C-like languages.    -  +  X[?ind] is equivalent to ((auto _ = X),(_ && _[ind])) +  while X?->ind is equivalent to ((auto _ = X),(_ && _->ind)) +  +  The main use is 'deep indexing' where some elements can be 0: +  +  | request_id?->user?->misc?->x +  +  vs +  +  | request_id && request_id->user && request_id->user->misc +  | && request_id->user->misc->x +    o Added the '?:' operator for compatibility with other C-like languages. -  It is identical to '||' in pike. +  It is identical to '||' in pike, and this is not /really/ needed.    - o && changed, when doing A && B, and A is false, keep A instead of -  pushing 0. + o The && operator changed, when doing A && B, and A is false, keep A +  instead of pushing 0.    - o X::this +  This is especially useful then A is not actually 0, but an object +  that evaluates to false, or UNDEFINED.    - o dynamic macros (master()->add_predefine("MACRO()", callback) etc) -  | > master()->add_predefine("RND()", lambda( string arg1 ) { return random((int)arg1); }); -  | > RND(10); -  | (2) Result: 9 -  | > cpp("RND(123)") -  | (3) Result: "19" + o Added new syntax that can be used to return an object as if it was a +  class you are inheriting, X::this where X is the inheriting class. +  + o Dynamic macros +  You can now add programatic macros. There is currently no syntax +  that can be used to define these while compiling code, but you can +  add them from one program before compiling plugins/modules. +  +  The main use is macros like DEBUG(...) and IFDEBUG() that would +  expand to something if a debug setting is enabled in the module but +  nothing otherwise, or, to take an actual example from the Opera +  Mini source code: +  +  | add_predefine( "METRIC()", +  | lambda( string name, string ... code ) +  | { +  | string type = type_of( code ); +  | string aggregate = aggregate_of( code ); +  | string format = format_of( code ); +  | code -= ({ 0 }); +  | return replace( base_metric_class, +  | (["ID":(string)next_metric_id++, +  | "NAME":stringify(name), +  | "TYPE":type, +  | "AGGREGATE":aggregate, +  | "FORMAT":format, +  | "CODE":make_value_function(code), +  | ])); +  | }); +  +  +  That is, a macro that needs does some calculations, and rewrite the +  code more than is possible in normal macros.. +  +  This one expands something along the lines of +  +  | METRIC("requests", Summarize, PerSecond, floating_average_diff(requests)); +  +  into +  +  | class Metric_requests_01 +  | { +  | inherit Server.Metric; +  | constant name = "transcoder:requests"; +  | constant type = Float; +  | constant format = PerSecond; +  | constant aggregate = Summarize;    | -  | It can also be used to override the default builtin macros. If you -  | want "fun" debug information (not used for backtraces, but code using -  | __LINE__ will be confused): -  | -  | > master()->add_predefine("__LINE__", lambda() { return random(4711); }); -  | > __LINE__; -  | (6) Result: 2593 -  | > __LINE__; -  | (7) Result: 1780 +  | float value() { +  | return floating_average_diff(requests); +  | } +  | }    -  +    --- optimizations      o New significantly faster block allocator -  +  The free in the old one was O(n), which means that as an example +  creating a lot of objects and then free:ing them mainly used CPU in +  the block allocator. +  +  This fix changed the ordo of one of the tests that did that very +  thing (binarytrees) from O(n) to O(n), and as such is more than a +  simple percentual speedup. +    o Power-of-two hashtables are now used for most hashtables - o Significantly changd x86-32 and new AMD64/x86-64 machinecode -  compilation backend - o svalue type renumbering +  +  This speeds up mappings and other hashtables a few percent, and also +  simplifies the code. +  + o Significantly changed x86-32 and an entirely new AMD64/x86-64 +  machinecode compilation backend +  +  The main feature with the x86-32 edition is that it is now using +  normal function call mechanics, which means that it now works with +  modern GCC:s. +  +  The x86-64 backends has been rewritten so that it is easier to add +  new instructions (x86-64) and opcodes (pike) to it. +  + o Svalue type renumbering +  +  PIKE_T_INT is now type #0, which makes certain things significantly +  faster. +  +  As an example, clearing of object variables is now done +  automatically when the object is created since all object memory is +  set to 0. +  +  The same thing happens when clearing values on the stack. +    o string(x..y) (constant) types    | > typeof("foo");    | (1) Result: string(102..111)    also used to optimize lower_case/upper_case search and    string_has_null etc.    -  +  The strings now keep track of the min/max values in addition to two +  new flags: all-uppercase and all-lowercase. +  +  The fairly common case where you are doing lower_case or upper_case +  on an already lower or uppercase strings is now significantly +  faster. +    o Several other optimizations to execution speed has been done -  +  + object indexing (cache, generic speedups) +  + lower_apply, changes to apply in general +  Taken together these individuallt small optimizations speeds up at +  least pike -x benchmark more than 5%.    -  +  + A lot of opcodes implemented in machinecode for x86-64 +  This speed up the loop benchmarks close to a factor of 3. But then +  again, most real code is nothing like that benchmark. +  +  + Several new opcodes added +  As an example an observation was that most branch_if_zero is +  followed by an is_eq, is_lt or is_gt or similar. Those opcodes +  always return 1 or 0. +  +  So, two new opcodes, fast_branch_if_zero and +  fast_branch_if_non_zero were added that map directly to three x86-64 +  opcodes, there is no need to check the types, do a real pop_stack +  etc. +    --- removed stuff -  +    o Removed bundles   o Removed facets   o The built in sandbox is now deprecated   o Bignums are now a required language feature, it is no longer    possible to build a pike without them   o Tools.PEM and Tools.X409 deprecated (use the corresponding modules in Standards.)   o The old 'files' module was renamed to _Stdio   o Locale.Charset -> Charset   o Renamed GTK to GTK1, added a GTK.pmod that is either GTK2 (if    available) or GTK1 (if there is no GTK2, but GTK1 is available).
pike.git/CHANGES:99:    An implementation of the WebSocket (RFC 6455) standard, both server    and client      o Image.WebP    Encoder and decoder for the WEBP image format.    More information about the format can be found on    https://developers.google.com/speed/webp/      o Serializer    APIs useful to simplify serialization and deserialization of objects -  + Serializer.Encodable +  Mainly it allows you to easily iterate over the object variables, +  including the private ones. +  +  + Serializer.Encodable    A class that can be inherit to make an object easily serializable    using encode_value.    - o Filesystem.Monitor (System.Inotify, System.FSEvents) + o Filesystem.Monitor and the lowlevel System.Inotify + System.FSEvents    Basic filesystem monitor.       This module is intended to be used for incremental scanning of a    filesystem.       Supports FSEvents on MacOS X and Inotify on Linux to provide low    overhead monitoring; other systems currently use a less efficient    polling approach.      o Mysql.SqlTable
pike.git/CHANGES:154:       In many ways these values should be considered constant, but it is    possible for a program to replace them with extended versions,    provided they don't break the behavior of the base classes defined    here. Since there is no good mechanism to handle such extending in    several steps, pike libraries should preferably ensure that the    base classes defined here provide required functionality directly.      -- UNSORTED    + o clang compatibility   o SDL.Music added to SDL.    Allows the playback of audio/music files.    Requires the SDL_mixed library.      o Bz2.File("path"), line_iterator      o Crypto.CAMELLIA      o System.TM    Low-level wrapper for struct tm.
pike.git/CHANGES:210:    + added ipv6 multicast support    + added set_buffer      o sprintf("%H") and sscanf("%H") (new) sscanf("%n") (now documented, existed before (%!<X> modifier, used by optimizer))   o Image.JPEG.exif_decode   o Process.daemon    The daemon() function is for programs wishing to detach themselves    from the controlling terminal and run in the background as system    daemons.   o Crypto.PGP - support more hash functions. +    o String.levenshtein_distance()    That function calculates the Levenshtein distance between two    strings. The Levenshtein distance describes the minimum number of    edit operations insert, delete or substitue a character to get    from one string to the other.       The algorithm can be used in approximate string matching to find    matches for a short string in many longer texts, when a small    number of differences is expected. -  +    o Unicode databases updated to 6.2.0 -  +    o Timezone databases updated to tzdata2013d -  +    o inherit ::this_program    This syntax refers to the previous definition of the current class    in its parent, and is typically used with inherit like:       inherit Foo;       // Override the Bar inherited from Foo.    class Bar {    // Bar is based on the implementation of Bar in Foo.    inherit ::this_program;    // ...    } -  +    o precompile    + inherit "identifier"    -- inherit the program returned by calling master()->resolve() on    the specified identifier. Useful to inherit code written in pike.    + cpp prefix feature #cmod_define #cmod_if etc   o System.sync()   o System.getloadavg()   o Stdio.File()->send/receive[_fd]   o The Search module has seen several fixes   o Standalone tools added: