Releases: sociomantic-tsunami/ocean
v2.3.0-preview
Release Notes for Ocean v2.3.0
Note: If you are upgrading from an older version, you have to upgrade incrementally, following the instructions in the previous versions' release notes.
Dependencies
Dependency | Version |
---|---|
makd | v1.3.x |
tangort | v1.3.x |
New Features
-
ocean.core.Traits
A new symbol,TemplateInstanceArgs
was introduced.
It allows to get the arguments of a template instance in a D1-friendly manner.
It can also be used to check if a type is an instance of a given template. -
ocean.util.config.ConfigFiller
Provides the same functionality as the old
ClassFiller
, but it's
extended to supportstruct
s too. -
ocean.util.container.queue.LinkedListQueue
Added the ability to walk over a
LinkedListQueue
with a foreach statement.
It will walk in order from head to tail. -
ocean.util.encode.Base64
- the encode and decode tables used by
encode
,encodeChunk
anddecode
have been rewritten in a readable way,
and made accessible to user (public
) under thedefaultEncodeTable
anddefaultDecodeTable
names, respectively; - encode and decode table for url-safe base64 (according to RFC4648) have been added under the
urlSafeEncodeTable
andurlSafeDecodeTable
, respectively; encode
anddecode
now accepts their table as template argument: this means one can provide which characters are
used for base64 encoding / decoding. By defaultdefault{Encode,Decode}Table
are used to keep the old behavior.encode
now takes a 3rd argument,bool pad
which defaults totrue
, to tell the encoder whether to pad or not.
- the encode and decode tables used by
-
ocean.net.server.unix.UnixListener
,ocean.net.server.unix.UnixConnectionHandler
UnixListener
andUnixConnectionHandler
classes are added with support for listening on the unix socket
and responding with the appropriate actions on the given commands. Users can connect to the application on
the desired unix socket, send a command, and wait for the application to perform the action and/or write
back the response on the same connection. -
ocean.io.serialize.StringStructSerializer
A new optional boolean flag has been added to the
serialize()
function. If
this flag is set, then single character fields in structs will be serialized
into equivalent friendly string representations if the fields contain
whitespace or other unprintable characters.
For example, the string '\n' will be generated for the newline character, '\t'
for the tab character and so on. -
ocean.io.select.EpollSelectDispatcher
Optional delegate argument of
eventLoop
method now can returnbool
,
indicating if there is any pending work left at the call
site. This is likely to only be relevant forocean.task.Scheduler
internals
Deprecations
-
ocean.util.config.ClassFiller
Deprecated in favour of the new
ConfigFiller
which provides the
same interface. -
ocean.io.select.EpollSelectDispatcher
Old overload of
eventLoop
was deprecated. If your app calleventLoop
with
no arguments, it won't be affected.
v2.2.2-preview
Fixed Issues
MapSerializer
: Allow structs without full backward compatibility- Fix broken links in
README
- Fix implementation of
math.hypot
- Don't consider
KillException
scheduling failure debug(ISelectClient)
: Wrongerrno
output
v2.2.1-preview
Issues Fixed
- All fixes in v2.1.3-preview release
v2.1.3-preview
Issues Fixed
- Problems with
Buffer!(void[])
- Check
waitid
for signal interruption TaskPool
/ThrottledTaskPool
doesn't recycle the task object when the scheduler throws a queue full exception- D2: Enable stomping prevention + fix serializer
- Process
Root
before other loggers - Fix recursive class defintion crashing
d2conv
- Fix debug trace functionality in
ThrottledTaskPool
v2.2.0-preview
Release Notes for Ocean v2.2.0
Note: If you are upgrading from an older version, you have to upgrade
incrementally, following the instructions in the previous versions' release
notes.
These notes are usually structured in 3 sections: Migration Instructions,
which are the mandatory steps a user must do to update to the new version,
Deprecated, which contains deprecated functions which are not recommended to
be used (and will be removed in the next major release) but will not break any
old code, and New Features which are new features available in the new
version that users might find interesting.
New Features
-
ocean.util.cipher.gcrypt.AES
Aliases for AES-CBC ciphers have been added.
-
ocean.text.utf.UtfUtil
Add
truncateAtN
method which truncates a string at the last space before
the n-th character or, if the resulting string is too short, at the n-th
character. -
ocean.util.cipher.gcrypt.c.kdf
Bindings to gcrypt's C functions for key derivation have been added.
-
ocean.util.cipher.gcrypt.core.KeyDerivationCore
A wrapper class for gcrypt's key derivation functions has been added.
-
ocean.util.cipher.gcrypt.PBKDF2
An alias for key derivation using the PBKDF2 algorithm has been added.
-
ocean.util.cipher.misc.Padding
New module with cryptographic padding functions, currently contains functions
for PKCS#7 and PKCS#5 padding. -
ocean.text.convert.Formatter
This new module provides similar functionalities to
ocean.text.convert.Layout_tango
,
but use compile-time type information instead ofTypeInfo
to do so.
In the long run,ocean.text.convert.Layout_tango
will be deprecated and this module will replace it.The module provides 4 different functions:
format
takes no buffer and allocate a newistring
. Equivalent toFormat(format_string, args)
.- The first
sformat
overload takes aSink
(scope
delegate of typesize_t delegate (cstring)
) as first parameter and will
call this sink (possibly multiple times) with the data to append. - The second
sformat
overload takes a buffer (ref mstring
) which will be appended to. - A
snformat
function which takes a buffer (mstring
) and will overwrite it. The buffer won't be extended and if the formatted
string is too long, the extra data will be discarded.
This brings a couple of advantages:
- If a type isn't supported, an error will be issued at compile-time
- Support formatting of type which don't have enough TypeInfo attached, like
struct
- As a result of the previous point, support formatting our Typedef implementation
- Better code is generated, as lots of branches can be taken in advance
- Doesn't use excessive amount of stack space
As a result of the re-implementation, some behaviour might differ from
Layout_tango
's.
For example:- Pointers are now formatted as "{X16#}" in 64 bits and "{X8#}" in 32 bits
So formatting a random pointer will give "0XFF002A0042000000" in 64 bits for example. null
pointers and references will now be formatted asnull
instead of0
- If a type define an overload of
toString
that takes a string sink as a parameter
(e.g.void toString (scope size_t delegate (cstring) sink)
, it will be preferred
over the regulartoString
overload, as the sink one is most-likely non-allocating.
Previously onlyistring toString()
was supported. - Structs will now be formatted as a curly-braced enclosed, comma-separated list
of "field: value".
For examplestruct T { uint c; char[] data }
will be formatted as{ c: 0, data: null }
by default.
Inside structs,char
and string types will be quoted. Using the previously definedstruct T
,
an instance ofT(42, "Hello world")
will result in{ c: 42, data: "Hello world" }
- AA formatting changed from
{key => value, ...}
to[ key: value, ... ]
. - String nested inside an aggregate (arrays, AAs, struct...) are now quoted.
- Function pointers are now formatted as their type + pointer, delegates as type + funcptr + ptr.
union
is the only built-in type which is not supported, as the formatter would need to be
able to discriminate it in order to print it, or avoid following references, which would lead
to an inconsistent behaviour.- Many types might now be more respectful of the formatting options given to them, especially
when it comes to string size limitation.
In addition, the following are not supported by
Formatter
:- Formatting from / into arrays of
wchar
ordchar
will output an array instead of string.
Though it is not inherent to the design, the current version only support arrays ofchar
as strings. - Formatting values of imaginary or complex floating point type. Those are deprecated in D2.
- Formatting floating point as hexadecimal
v2.1.2-preview
Issues Fixed
- Update copyright years (6fe8f73)
v2.0.9-preview
Issues Fixed
- Add license to new task package (120273c)
v2.1.1-preview
Bug fixed
- Replace
TempFile
usage withFile
in TaskPoolSerializer
v2.1.0-preview
Release Notes for Ocean v2.1.0
Note: If you are upgrading from an older version, you have to upgrade
incrementally, following the instructions in the previous versions' release
notes.
These notes are usually structured in 3 sections: Migration Instructions,
which are the mandatory steps a user must do to update to the new version,
Deprecated, which contains deprecated functions which are not recommended to
be used (and will be removed in the next major release) but will not break any
old code, and New Features which are new features available in the new
version that users might find interesting.
Migration Instructions
-
ocean.text.convert.Integer_tango
format
andformatter
are now templated on the integer type they get as an argument,
allowing to properly format negative numbers into their non-decimal
(binary, octal, hexadecimal) representation.
In addition, passing anulong
value which is >long.max
with format "d" will now
be correctly formatted (before it resulted in a negative value and required "u" to be used). -
ocean.util.serialize.model.VersionDecoratorMixins
VersionHandlingException
has been changed to avoid allocating a
new message any time a conversion fails. -
ocean.transition
enableStomping
function now can't be called on arrays ofimmutable
or
const
elements. This may cause compilation errors but any code which
is subject to it was triggerring undefined behaviour and must be fixed
with uttermost importance.
Deprecations
-
ocean.util.cipher.gcrypt: MessageDigest, HMAC
HMAC
has been moved to a separate module,ocean.util.cipher.gcrypt.HMAC
.
TheHMAC
class inocean.util.cipher.gcrypt.MessageDigest
is deprecated.MessageDigest.hash()
andHMAC.hash(void[][] ...)
are deprecated and
replaced withcalculate(
ubyte[][] ...)
. This is to avoid an implicit
cast fromvoid[][]
tovoid[]
when calling the function, which causes a
wrong hash result, and the error is hard to find. -
ocean.io.select.client.EpollProcess.ProcessMonitor
All references to the ProcessMonitor class should be removed. It existed
only as a workaround for a bug in EpollProcess, but is no longer required. -
ocean.task.util.StreamProcessor
-
Constructor that expects
max_tasks
,suspend_point
andresume_point
has
been deprecated in favor of one that takes aThrottlerConfig
struct. -
ThrottlerConfig.max_tasks
and the constructors which accept amax_tasks
argument have been deprecated. New constructors have been added which do not
expect or usemax_tasks
, instead creating an unlimited task pool. If you
want to limit the maximum number of tasks in the pool, usegetTaskPool
and
set a limit manually. -
ocean.text.util.StringC
The function
toCstring()
is now deprecated in favour oftoCString()
(note
the uppercaseS
). -
ocean.text.convert.Float
parse
overloads forversion = float_dtoa
andformat
overload
forversion = float_old
have been deprecated. -
ocean.util.cipher.gcrypt.core.Gcrypt
The
Gcrypt
template has been deprecated, eitherGcryptWithIV
or
GcryptNoIV
should be used, depending on if your desired encryption mode
requires initialization vectors or not. -
ocean.util.serialize.contiguous.VersionDecorator
The
VersionDecorator
defined in this module is deprecated.
TheVersionDecorator
in theMultiVersionDecorator
module of the same package
should be prefered, as it handles multiple version jump without runtime performance. -
ocean.io.serialize.XmlStructSerializer
This unmaintained module is deprecated.
-
ocean.text.xml.Xslt
,ocean.text.xml.c.LibXslt
,ocean.text.xml.c.LibXml2
The XSLT processor implemented here is not generic and is thus being removed
from ocean. It will be moved to another repository. -
ocean.util.cipher.gcrypt.AES
The
AES
alias has been deprecated in favor of the equivalentAES128
.
New Features
-
ocean.io.serialize.StringStructSerializer
Introduced an overload of the
StringStructSerializer
serializer
which takes an array of known timestamp field names.
If a field matches one of the names and implicitly converts toulong
,
an ISO formatted string will be emitted in parentheses next to the value of
the field (which is assumed to be a unix timestamp).Bugfix: Trailing spaces are no longer emitted for arrays with length zero.
-
ocean.util.cipher.gcrypt.AES
Added libgcrypt AES (Rijndael) algorithm with a 128 bit key.
-
ocean.util.config.ClassFiller
In the ClassIterator, a new
opApply()
function has been added to provide
foreach iteration only over the names of the matching configuration
categories. -
ocean.text.convert.Float
A new
format
method has been introduced, which formats a floating point value according to
a provided format string, which is a subset of the one passed to Layout.
It mimics what Layout will do, with the exception that "x" and "X" format string aren't handled
anymore as the original output wasn't correct. -
ocean.sys.socket.model.ISocket
Add
formatInfo
method which formats information about the socket into the
provided buffer -
ocean.task.util.StreamProcessor
Added getter method for the internal task pool.
-
ocean.io.select.client.TimerSet
The
schedule()
method now returns an interface to the newly scheduled event
(IEvent
), allowing it to be cancelled. -
ocean.task.Task
Task has gained methods
registerOnKillHook
/unregisterOnKillHook
that can be
used to register/unregister callback hooks to be called when the Task is killed. -
ocean.util.cipher.gcrypt.AES
Additional aliases for 192- and 256-bit AES ciphers have been added.
-
ocean.time.timeout.TimeoutManager
TimeoutManager now has a constructor that takes an optional bucket element
allocator. The intended usage is to allow the use of an alternative allocator,
e.g. BucketElementFreeList. This can reduce the number of GC allocations
performed. The existing constructor uses the default bucket allocator of
map (BucketElementGCAllocator), which will cause garbage collections. -
ocean.task.ThrottledTaskPool
ThrottledTaskPool has been moved out of
ocean.task.util.StreamProcessor
and
made public. -
ocean.task.util.TaskPoolSerializer
Added methods to dump and restore tasks inside of a task pool to disk to
facilitate preserving tasks between application restarts.To use the serialization and deserialization funtionality the derived task
must implementserialize
anddeserialize
.
public void serialize ( ref void[] buffer )
public void deserialize ( void[] buffer )
See usage example in the unit test for example implementation.
v2.0.8-preview
Issues Fixed
-
Fix
BucketElementFreeList
:instantiateAllocator
The type of the return value did not match the type actually being returned by the function.