Skip to content

Releases: sociomantic-tsunami/ocean

v6.2.0: Deprecation cleanup, change in FormatterSink, new `LogLevel`

12 Dec 09:47
Compare
Choose a tag to compare

Notable changes

Fixes for forward compatibility with new DMD releases

  • ocean.net.server.connection.IConnectionHandler, ocean.text.entities.model.MarkupEntityCodec,
    ocean.io.Stdout, ocean.core.SmartUnion

Those modules have been changed to clean up errors with new releases,
namely pokemon-style catch which is now an error,
working around a visibility bug (public alias to private template instance doesn't work),
and an upcoming improvement to DMD about discarding without side effect.

Two extra levels are now available to the Logger: Debug and Verbose

  • ocean.util.log.ILogger, ocean.util.log.Logger

Those new levels should help developers to have more fine-grained log messages.
Previously, only Trace was available for development output, the next level, Info,
being for informative messages to the users.
Debug itself is the lowest (most verbose) level, followed by the pre-existing Trace level,
followed by Verbose. The other log levels (Info, Warn, Error, Fatal) follow,
and are unchanged.

In addition to the enum values, convenience function were added to Logger:
Logger.dbg and Logger.verbose. The former name is an abbreviation,
as debug is a keyword in D.

FormatterSink now takes its char[] argument as in, not const

  • ocean.text.convert.Formatter, ocean.util.log.Appender

This change shouldn't have any effect for users that do not use -preview=in.
For -preview=in users, it allows a more consistent usage of delegates,
as void delegate(const char[]) is not covariant with void delegate(in char[]),
notably when Throwable.toString is involved.

Deprecations

creal / ireal functions in ocean.math are deprecated

  • ocean.math.IEEE, ocean.math.Math, ocean.meta.traits.Basic

Upstream deprecated support for creal and ireal types in v2.097.0.
Functions in ocean.math.{IEEE,Math} that used them are now deprecated.
Templates isComplexType / isImaginaryType used for introspection are deprecated as well.

v6.1.0: Forward compatibility with DMD, ocean.stdc.string deprecated

20 Apr 03:33
Compare
Choose a tag to compare

Notable changes

This release contains some minor fixes that help with newer D releases.
Notably, all uses of body have been replaced by do,
reducing the friction of upgrading to DMD v2.096.0.

Deprecations

Module ocean.stdc.string has been deprecated

  • ocean.stdc.string

This module exposed C functions that have now been fully upstreamed,
hence the core modules should be imported directly.

v6.0.0: Major clean up, updated upstream support

26 Feb 02:13
Compare
Choose a tag to compare

v5.4.1...v6.x.x

This release remove all the code deprecated during v5.x.x's lifetime,
support for Ubuntu xenial as it is about to reach EOL
(the minimum supported version is now Bionic), and support for DMD
older than v2.092.0 (including dmd-transitional).

Migration instructions

Removed the deprecated init method

ocean.core.BitArray

Use the initialize method instead.

Templates Const, Immut and Inout have been removed

  • ocean.transition, ocean.meta.types.Qualifiers

Those templates were used during the transition to D2, but are obsolete now.
However, due to a DMD bug
they could not be deprecated. Instead, usage in downstream project was cleared,
and they were directly removed. Any usage can be replaced by the equivalent keyword
(Immut!(T) => immutable(T), Inout!(T) => inout(T), Const!(T) => const(T)).

Deprecated modules have been removed

  • ocean/core/Time.d, ocean/core/Traits.d,
    ocean/stdc/posix/arpa/inet.d, ocean/stdc/posix/net/if_.d,
    ocean/stdc/posix/netinet/in_.d, ocean/stdc/posix/netinet/tcp.d,
    ocean/stdc/posix/stdlib.d, ocean/stdc/posix/sys/ipc.d,
    ocean/stdc/posix/sys/mman.d, ocean/stdc/posix/sys/select.d,
    ocean/stdc/posix/sys/shm.d, ocean/stdc/posix/sys/stat.d,
    ocean/stdc/posix/sys/statvfs.d, ocean/stdc/posix/sys/types.d,
    ocean/stdc/posix/sys/uio.d, ocean/stdc/posix/sys/utsname.d,
    ocean/stdc/posix/sys/wait.d,
    ocean/time/chrono/Hebrew.d, ocean/time/chrono/Hijri.d,
    ocean/time/chrono/Japanese.d, ocean/time/chrono/Korean.d,
    ocean/time/chrono/Taiwan.d, ocean/time/chrono/ThaiBuddhist.d,
    ocean/util/log/model/ILogger.d

Those modules are either available via druntime, have been moved,
or are unused and unsupported. Refer to their deprecation notices
for specific instructions.

v5.4.1: Merge v5.1.5 bugfix for isUTF8StringType

12 Dec 01:20
Compare
Choose a tag to compare

This release is a merge of v5.1.4 .. v5.1.5 into v5.4.x.

v5.3.1: Merge v5.1.5 bugfix for isUTF8StringType

12 Dec 01:17
Compare
Choose a tag to compare

This release is a merge of v5.1.4 .. v5.1.5 into v5.3.x.

v5.2.2: Merge v5.1.5 bugfix for isUTF8StringType

12 Dec 01:16
Compare
Choose a tag to compare

This release is a merge of v5.1.4 .. v5.1.5 into v5.2.x.

v5.1.5: Fix isUTF8StringType to work with static arrays

12 Dec 01:14
Compare
Choose a tag to compare

Bug Fixes

Fix function to check for UTF-8 string type

ocean.meta.traits.Arrays

The function ocean.meta.traits.Arrays.isUTF8StringType() is suggested to
replace the deprecated ocean.core.Traits.isStringType() but it failed to
check for static arrays and now it is fixed to support both basic kind of
arrays.

See #778

v5.4.0: D2 cleanups, enum pretty-printing, pkgzip files streaming

18 Aug 03:38
Compare
Choose a tag to compare

https://github.com/sociomantic-tsunami/ocean/milestone/121

Migrations

Replacement of IEBtree protected operators

  • ocean.util.container.ebtree.IEBTree

The opAddAssign and opSubAssign operators have been replaced with
increaseNodeCount and decreaseNodeCount.
These are protected member functions used only in the implementation of
the EBTree classes, so no impact on user code is expected.

Bug fixes

Missing versions added to ocean.LibFeatures

  • ocean.LibFeatures

This module was supposed to provide means for library writers depending
on Ocean to conditionally support a feature. However the module hasn't been
updated for a long time, and versions 4.2 to 4.8 were missing in the v4
suite, while no v5 version (so 5.0 - 5.3) were present.
This release adds all the missing features as well as the current (5.4).

SmartUnion will no longer produce conflicting opCall

  • ocean.core.SmartUnion

Before this change, SmartUnion would generate duplicated static opCall
for initialization. However those opCall were not callable,
as the call would be ambiguous.
After this change, those opCall won't be generated anymore,
and only the set and get methods will be available on fields
which don't have a unique type in the union.

New features

The Formatter now pretty-print enums

enum members are now correctly printed by the Formatter.
For example enum Foo { A, B} will print either Foo.A or Foo.B
instead of 0 and 1, previously.
If a value that is not a member of an enum is casted to it,
such as cast(Foo) 42, the Formatter will print cast(Foo) 42.
Note that the type will be printed qualified, e.g. passing a const
value will print const(Foo).A, for example.

Support for streaming pkzip files

  • ocean.io.compress.ZipStream

The new class ZipStreamDecompressor supports streaming of both gzip and
well-behaved single-file pkzip archives. Streaming of pkzip archives is
supported only when the archive contains a single file, and does not use
any of the exotic features allowed by the pkzip format.

Deprecations

Most calendar types have been deprecated

  • ocean.time.chrono.Hebrew, ocean.time.chrono.Hijri,
    ocean.time.chrono.Japanese, ocean.time.chrono.Korean,
    ocean.time.chrono.Taiwan, ocean.time.chrono.ThaiBuddhist

Those modules were not used, badly supported, and not up to
any coding convention.

ocean.core.Time has been deprecated

  • ocean.core.Time

This module has been completely deprecated and should be replaced by usages of core.time.
The sole function in this module, seconds, was mostly used as argument to Thread.sleep.
It can be replaced by seconds from core.time if the argument is an integer,
or msecs, usecs, hnsecs or nsecs depending on the expected precision.

Module ocean.stdc.posix.netinet.tcp is deprecated

ocean.stdc.posix.netinet.tcp

This module was just a thin wrapper around core.sys.posix.netinet.tcp,
which should now be imported directly.

Module ocean.core.Traits have been deprecated

  • ocean.core.Traits

All symbols in this module were deprecated in v5.0.0,
but the module itself wasn't marked as deprecated before.

Most modules in ocean.stdc.posix.sys are deprecated

  • ocean.stdc.posix.sys.ipc, ocean.stdc.posix.sys.mman,
    ocean.stdc.posix.sys.select, ocean.stdc.posix.sys.shm,
    ocean.stdc.posix.sys.stat, ocean.stdc.posix.sys.statvfs,
    ocean.stdc.posix.sys.uio,
    ocean.stdc.posix.sys.utsname, ocean.stdc.posix.sys.wait

Those modules where just thin wrapper, publicly importing their
core.sys.posix.sys counterpart and can be trivially replaced.
The only two remaining modules are ocean.stdc.posix.sys.un,
which a create method and a different definition (but binary compatible)
for the sockaddr_un struct, and ocean.stdc.posix.sys.socket,
as it contains definitions not available as of DMD 2.091.0.

Exposed declaration of pthread_getattr_np had been deprecated

  • ocean.util.aio.internal.ThreadWorker

This module inadvertently exposed the extern (C) declaration for the
non-standard function pthread_getattr_np.
Users can import core.thread instead to get the declaration.

C bindings in ocean.sys.TimerFD have been deprecated

  • ocean.sys.TimerFD

This module exposed the functions timerfd_create, timerfd_gettime, timerfd_settime,
as well as the constants CLOCK_MONOTONIC, TFD_TIMER_ABSTIME, TFD_CLOEXEC, TFD_NONBLOCK.
Those have now been deprecated, as they are part of druntime.
CLOCK_MONOTONIC is part of core.sys.posix.time, and the other functions / constants
can be found in core.sys.linux.timerfd since 2.069.
The rest of the module, which provides wrapper types around this functionality, is not deprecated.

v5.3.0

26 Nov 16:56
Compare
Choose a tag to compare

https://github.com/sociomantic-tsunami/ocean/milestone/115

Deprecations

Module ocean.stdc.posix.sys.types has been deprecated

ocean.stdc.posix.sys.types

This module was just publicly importing core.sys.posix.sys.types.
Prefer this import instead.

Trivial wrappers in ocean.transition have been deprecated

ocean.transition

The following symbols have been deprecated:

  • min_normal (T : real)
  • global(istring)
  • ModuleInfoPtr

They can be trivially replaced by their builtin D2 equivalent.

Deprecate D1 operator overloads in SignalSet

DMD 2.088.0 has deprecated D1 operator overloads, which are expected to
be replaced with the newer D2 op{Unary,Binary,BinaryRight,OpAssign}
templated methods: https://dlang.org/changelog/2.088.0.html#dep_d1_ops

The D1 operator overloads in SignalSet are used in a rather weird way
which does not really seem appropriate to use for insertion and removal
from a set. Rather than replace them with D2 operator overloads, they
have simply been deprecated in favour of using the existing add and
remove methods directly. Support for the operator overloads will be
dropped in the next major release of ocean.

Module ocean.util.log.model.ILogger have been moved one level up

ocean.util.log.model.ILogger

This module was the only one in its package.
Additionally, as explained in Ocean issue #573,
the package hierarchy including model is flawed.

Module ocean.stdc.posix.stdlib has been deprecated

ocean.stdc.posix.stdlib

This module was just publicly importing two other modules.
Most uses can be replaced with an import to core.sys.posix.stdlib.
Users of mkstemp, mkostemp, or mkostemps should import
ocean.stdc.posix.gnu.stdlib.

Module ocean.stdc.posix.arpa.inet has been deprecated

ocean.stdc.posix.arpa.inet

This module was just publicly importing core.sys.posix.arpa.inet.
Prefer this import instead.

Module ocean.stdc.posix.net.if_ has been deprecated

ocean.stdc.posix.net.if_

This module was just publicly importing core.sys.posix.net.if_.
Prefer this import instead.

Fix -= operator implementation in SuspendableThrottlerCount

ocean.io.model.SuspendableThrottlerCount

The -= operator overload (D1 opSubAssign) was inexplicably aliased
to the add method rather than the correct remove. This probably
means that no one was ever actually using the operator overload, but it
seems a good idea to fix it in any case.

Replace D1 operator overloads with D2 operator overloads

ocean.io.model.SuspendableThrottlerCount
ocean.math.Distribution
ocean.math.SlidingAverage
ocean.math.WideUInt
ocean.time.Time

DMD 2.088.0 has deprecated D1 operator overloads, which are expected to
be replaced with the newer D2 op{Unary,Binary,BinaryRight,OpAssign}
templated methods: https://dlang.org/changelog/2.088.0.html#dep_d1_ops

Since templated methods cannot be overridden this may in some rare cases
cause breaking change for classes that implemented the old operators.
In general however this will likely make no practical difference, other
than the absence of scores of deprecation messages with more recent DMD
versions.

Deprecated the init method in BitArray and introduced initialize

ocean.core.BitArray

The BitArray struct has an init method which was used for initializing
with a set of parameters. However, this makes BitArray.init unusable in
some contexts in generic code, as it would trigger compiler errors.

The new initialize method should be used instead.

Function ocean.text.Util : layout has been deprecated

ocean.text.Util

This function was duplicating the functionality of Formatter.
Additionally, the speed advantage does not apply anymore,
as the overhead of the old Tango Layout was due to the usage of TypeInfo,
and performances should be equivalent nowadays.
Lastly, most usage in Ocean were to format temporaries into buffer,
and later pass them to a delegate,
something that can be done without temporary using sformat.

Features

Add snakeToPascal string case conversion function

ocean.meta.codegen.CTFE

The new 'snakeToPascal' function converts a snake_case name to a PascalCase.
But it's not memory friendly and you should use only at CTFE.

Logger.runtime() now uses Clock.startTime()

  • ocean.util.log.Logger

The Logger now uses Clock.startTime() instead of the hierarchy instantiation time.
This means that all hierarchy will have the same runtime.
In practice, programs only ever had one hierarchy,
and since the common usage is to instantiate Loggers from the module constructor,
the runtime() was almost always that of the program, save for a few milliseconds.

v5.2.1

15 Oct 12:42
Compare
Choose a tag to compare

Merge of v5.1.3 and v5.1.4 into v5.2.x.