DConf 2014 wrap-up of talks mentioning vibe.d

Header image
Fri, 05 Sep 2014 DConf 2014 again featured a lot of very interesting talks. This post presents four particularly interesting posts in the context of vibe.d related development. But on top of that it is of course highly recommended to also take a look at the complete list of talks.

This year's DConf is already over for a while now, but better late than never… The talks are packed with interesting topics and this post will mention a few particularly interesting ones in the context of developing with vibe.d.

Declarative programming in D

The Declarative programming in D talk by Михаил Страшун aka Dicebot talks about a programming paradigm that has become much more popular in the D community since the relatively recent introduction of user defined attributes. The gist of it is combining compile-time reflection together with compile-time code generation using a combination of templates, compile-time function evaluation (CTFE) and string/template mixins to be able to separate the "what" (what it achieves) of a component from the "how" (how this is actually implemented procedurally).

The prime examples in vibe.d for this are the and vibe.web.web modules, of which the former is presented as an example in the talk. The resulting code is usually a lot more modular and more concise than the procedural equivalent.

Mobile Gameserver Backend in D

Stephan Dilly aka Extrawurst talks about the implementation of a Mobile Gameserver Backend in D. This gives some insight in an actual production system made using modern web building blocks.

More interesting talks

Especially two other non-vibe.d related talks are also worth mentioning here. First there is the Case Studies In Simplifying Code With Compile-Time Reflection talk by Atila Neves about his MQTT broker, which, fitting right in with Dicebot's talk, focuses on the declarative approach that he took when implementing it. The MQTT broker is also written with vibe.d as its network layer and was used to carry out some comparative benchmarks.

The second talk is about Reducing D bugs by Vladimir Panteleev. He presents some of the tools that he made, which can be extremely useful when debugging and tracing back the origin of bugs. This talk is highly recommended for any D developer. Not also that the Dustmite tool is shipped together with DMD and is also integrated into DUB since version 0.9.22 (run dub dustmite --help).

Posted at 09:50:28 +0100 by Sönke Ludwig 0 comments

vibe.d 0.7.20 release

Header image
Tue, 03 Jun 2014 The "vibe.web.web" web interface generator module has been extended with some important features, making it a full replacement (and more) of the old registerFormInterface() functionality. Other important changes include the use of strong TLS ciphers out of the box, as well as a heavily optimized URLRouter implementation and support for compile-time localization of Diet templates.
Features and improvements
  • Web interface generator and Diet template system
    • Added vibe.web.web.terminateSession() and redirect()
    • Added support for struct and array parameters, as well as Nullable!T in vibe.web.web
    • Added the @errorDisplay annotation to vibe.web.web to enable automatic exception display using an existing request handler
    • Added built-in, compile-time, gettext compatible localization support for Diet templates using the tag& text syntax
  • HTTP router
    • Implemented a new match tree based routing algorithm for URLRouter, resulting in great speedups for complex routing setups
    • Added URLRouter.prefix to configure a prefix to append to every route
    • The HTTPRouter router interface is scheduled for removal
  • Serialization system
    • Added @asArray to force serialization of composite types as arrays instead of dictionaries
    • Added support for using a pre-allocated buffer for serializeToBson
    • Added support for custom serialization representations of user defined types using toRepresentation/fromRepresentation methods - issue #618
    • Made DictionaryList serializable as an array by adding toRepresentation/fromRepresentation - issue #621
    • Using only strong ciphers by default for SSL server contexts
    • Added out-of-the box support for perfect forward secrecy (PFS) (by Martin Nowak) - pull #630
    • Changed the default from SSLVersion.tls1 (fixed TLS 1.0) to SSLVersion.any (SSL 3 and up, including TLS 1.1 and TLS 1.2)
    • Added SMTPClientSettings.sslContextSetup to enable customization of the SSL context (e.g. adding trusted certificates)
    • Upgraded the Windows OpenSSL binaries to 1.0.1g
  • Performance tuning
    • Added HTTPServerOption.errorStackTraces to make costly stack trace generation optional
    • Arguments to the logging functions are now evaluated lazily to avoid computations when messages are not actually logged
    • Added support for direct de-serialization of MongoDB query results
    • Reduced memory allocations in the HTTP logger module
    • Heavily reduced the number of memory allocations happening in the MongoDB driver - see issue #633
  • General
    • Removed deprecated symbols and deprecated symbols that were scheduled for deprecation
    • Added runWorkerTaskH to run a worker task and return its handle in one step (by Luca Niccoli aka lultimouomo) - pull #601
    • Added createTestHTTPServerRequest and createTestHTTPServerResponse to support writing unit tests
    • Added vibe.core.file.readFile, readFileUTF8, writeFile and writeFileUTF8
    • Added a limited overload of RedisDatabase.zrevRangeByScore and fix the type of the start/end parameters (by Jens K. Mueller) - pull #637
    • Added TCPListenOptions.disableAutoClose to make incoming TCP connections independent of the initial handler task
    • Added vibe.core.concurrency.thisTid as an alias to Task.getThis() for improved API compatibility to std.concurrency
    • Added an overload of UDPConnection.recv taking a timeout parameter - issue #540
    • Added toString to HTTPRequest and HTTPResponse for convenient logging
    • Added MarkdownSettings with additional support of setting the base heading level of the generated HTML
    • Added TCPConnection.keepAlive to set the SO_KEEPALIVE option - issue #622
    • Error derived exceptions are not caught anymore (use -version=VibeDebugCatchAll to get the old unsafe behavior)
    • Annotated some basic modules with @safe/@trusted/pure
    • Extended ProxyStream to optionally take distinct streams for input and output
    • Replaced all remaining uses of renderCompat with render
    • Removed unused variables and made Bson.toString const (thanks to Brian Schott aka Hackerpilot) - issue #659
Bug fixes
  • Fixed the order of events reported by setTaskEventCallback when new tasks are started within an existing task
  • Fixed HTTP multi-file uploads by changing HTTPServerRequest.files to a DictionaryList
  • Fixed @byName to work for serializing (associative) arrays of enums
  • Fixed SSL based SMTP connections (by Martin Nowak) - pull #609
  • Fixed Diet text blocks (tag. style) to properly remove the input file indentation - issue #614
  • Fixed isStronglyIsolated!T to work for interface types
  • Fixed filterURLEncode to encode certain special characters (such as "{") - issue #632
  • Fixed a crash when accessing vibe.d event functionality from within shared static ~this
  • Fixed Task.join and Task.interrupt to work when called from outside of the event loop (e.g. when processEvents is used instead of runEventLoop) - issue #443
  • Fixed serialization of const class instances (by Jack Applegame) - issue #653
  • Fixed compilation of renderCompat!() on GDC (invalid use of va_list/void*)
  • Fixed handling of paths with empty path entries (e.g. "/some///path") - issue #410
  • Fixed a crash caused by GCAllocator - GC.extend is now used instead of GC.realloc to sidestep the issue - issue #470
  • Fixed rendering of Markdown links with styled captions
  • Fixed Path.relativeTo step over devices for UNC paths on Windows
  • Fixed compilation on 2.064 frontend based GDC - issue #647
  • Fixed output of empty lines in "tag." style Diet template text blocks

Posted at 20:01:39 +0100 by Sönke Ludwig 0 comments

vibe.d 0.7.19 release

Header image
Wed, 09 Apr 2014 Apart from working on the latest DMD versions, this release includes an important security enhancement in the form of new experimental code for SSL certificate validation. Other major changes include many improvements to the Diet template compiler, various performance improvements, a new FileDescriptorEvent to interface with other I/O libraries, a new web interface generator similar to the REST interface generator, many improvements to the Redis client, and a bunch of other fixes and additions.
Features and improvements
  • Compiles with DMD 2.065 (and the current DMD HEAD)
  • API improvements for the SSL support code
  • Implemented SSL certificate validation (partially by David Nadlinger aka klickverbot, pull #474)
  • Removed the old EventedObject interface
  • Implemented support for string includes in Diet templates (idea by Stefan Koch aka Uplink_Coder) - issue #482
  • JSON answers in the REST interface generator are now directly serialized, improving performance and memory requirements
  • Reimplemented the timer code to guarantee light weight timers on all event drivers
  • Libevent2TCPConnection now has a limited read buffer size to avoid unbounded memory consumption
  • Fixed the semantics of ConnectionStream.empty and connected - empty is generally useful for read loops and connected for write loops
  • Added an overload of runTask that takes a delegate with additional parameters to bind to avoid memory allocations in certain situations
  • Added vibe.core.core.createFileDescriptorEvent to enable existing file descriptors to be integrated into vibe.d's event loop
  • HTTP response compression is now disabled by default (controllable by the new `HTTPServerSettings.useCompressionIfPossible)
  • Removed the deprecated sslKeyFile and sslCertFile fields from HTTPServerSettings
  • Removed the compatibility alias Signal (alias for ManualEvent)
  • :htmlescape in Diet templates is now processed at compile time if possible
  • Added support for Rebindable!T in isStronglyIsolated and isWeaklyIsolated - issue #421
  • Added RecursiveTaskMutex
  • Throwable is now treated as weakly isolated to allow passing exceptions using vibe.core.concurrency.send
  • exitEventLoop by default now only terminates the current thread's event loop and always works asynchronously
  • Session is now a struct instead of a class
  • Added support for storing arbitrary types in Session
  • Moved the REST interface generator from to
  • Added a new web interface generator (vibe.web.web), similar to vibe.http.form, but with full support for attribute based customization
  • Added a compile time warning when neither VibeCustomMain, nor VibeDefaultMain versions are specified - starts the transition from VibeCustomMain to VibeDefaultMain
  • Added requireBoundsCheck to the build description
  • Added assertions to help debug accessing uninitialized MongoConnection values
  • Added logFatal as a shortcut to log called with LogLevel.fatal (by Daniel Killebrew aka gittywithexcitement) - pull #441
  • Empty JSON request bodies are now handled gracefully in the HTTP server (by Ryan Scott aka Archytaus) - pull #440
  • Improved documentation of sleep() - issue #434
  • The libevent2 and Win32 event drivers now outputs proper error messages for socket errors
  • Changed setTaskEventCallback to take a delegate with a Task parameter instead of Fiber
  • Added a Task.taskCounter property
  • AutoFreeListAllocator.realloc can now reuse blocks of memory and uses realloc on the base allocator if possible
  • HTML forms now support multiple values per key
  • Inverted the no_dns parameter of EventDriver.resolveHost to use_dns to be consistent with - issue #430
  • Task doesn't alias this to TaskFiber anymore, but forwards just a selected set of methods
  • Added `vibe.core.args.readRequiredOption - issue #442
  • NetworkAddress is now fully pure nothrow
  • Refactored the Redis client to use much less allocations and a much shorter source code
  • Added Bson.toString() (by David Nadlinger aka klickverbot) - pull #468
  • Added connectTCP(NetworkAddress) and NetworkAddress.toString() (by Stefan Koch aka Uplink_Coder) - pull #485
  • Added NetworkAddress.toAddressString to output only the address portion (without the port number)
  • Added compileDietFileIndent to generate indented HTML output
  • Added Travis CI integration (by Martin Nowak) - pull #486
  • Added appendToFile to conveniently append to a file without explicitly opening it (by Stephan Dilly aka extrawurst) - pull #489
  • Tasks started before starting the event loop are now deferred until after the loop has been started
  • Worker threads are started lazily instead of directly on startup
  • Added MongoCursor.limit() to limit the amount of documents returned (by Damian Ziemba aka nazriel) - pull #499
  • The HTTP client now sets a basic-auth header when the request URL contains a username/password (by Damian Ziemba aka nazriel) - issue #481, pull #501
  • Added RedisClient.redisVersion (by Fabian Wallentowitz aka fabsi88) - pull #502
  • Implemented handling of doctypes other than HTML 5 in the Diet compiler (by Damian Ziemba aka nazriel) - issue #505, pull #509
  • Boolean attributes in Diet templates are now written without value for HTML 5 documents (by Damian Ziemba aka nazriel) - issue #475, pull #512
  • Empty "class" attributes in Diet templates are not written to the final HTML output (by Damian Ziemba aka nazriel) - issue #372, pull #519
  • Implemented PUB/SUB support for the Redis client (by Michael Eisendle with additional fixes by Etienne Cimon aka etcimon)
  • The logging functions take now any kind of string instead of only string (by Mathias Lang aka Geod24) - pull #532
  • Added SMTPClientSettings.peerValidationMode (by Stephan Dilly aka Extrawurst) - pull #528
  • Diet templates that are set to null are now omitted in the HTML output (by Damian Ziemba aka nazriel) - issue #520, pull #521
  • Extended the REST interface generator to cope with any type of error response and to always throw a RestException on error (by Stephan Dilly aka Extrawurst) - pull #533
  • Added support for text blocks in Diet templates (by Damian Ziemba aka nazriel) - issue #510, pull #518
  • Added RedisClient.blpop and changed all numbers to long to be in line with Redis (by Etienne Cimon aka etcimon) - pull #527
  • Changed WebSocket.receiveBinary and WebSocket.receiveText to strictly expect the right type by default (by Martin Nowak) - pull #543
  • Avoid using an exception to signal HTTP 404 errors for unprocessed requests, resulting in a large performance increas for that case
  • Modernized the Diet templates used for the example projects (by Damian Ziemba aka nazriel) - pull #551
  • Added WebDAV HTTP status codes to the HTTPStatusCode enum (by Dmitry Mostovenko aka TrueBers) - pull #574
  • Added support for multiple recipient headers (including "CC" and "BCC") in sendMail (by Stephan Dilly aka Extrawurst) - pull #582
  • Added support for comma separated recipients in sendMail
  • Added SSL support for the MongoDB client (by Daniel Killebrew aka gittywithexcitement) - issue #575, pull #587
  • Made all overloads of listenHTTPPlain private (as they were supposed to be since a year)
  • Added using -version=VibeDisableCommandLineParsing to disable default command line argument interpretation
  • Added using -version=VibeNoSSL to disable using OpenSSL and added free functions to create SSL contexts/streams
  • Functions in now throw a JSONException instead of a bare Exception (by Luca Niccoli aka lultimouomo) - pull #590
  • Functions in vibe.http.websocket now throw a WebSocketException instead of a bare Exception (by Luca Niccoli aka lultimouomo) - pull #590
Bug fixes
  • Fixed a condition under which a WebSocket could still be used after its handler function has thrown an exception - issue #407
  • Fixed a null pointer dereference in Libevent2TCPConnection when trying to read from a closed connection
  • Fixed the HTTP client to still properly shutdown the connection when an exception occurs during the shutdown
  • Fixed SSLStream to perform proper locking for multi-threaded servers
  • Fixed the signature of TaskLocal.opAssign - issue #432
  • Fixed thread shutdown in cases where multiple threads are used - issue #419
  • Fixed SIGINT/SIGTERM application shutdown - issue #419
  • Fixed HashMap to properly handle null keys
  • Fixed processing WebSocket requests sent from IE 10 and IE 11
  • Fixed the HTTP client to assume keep-alive for HTTP/1.1 connections that do not explicitly specify something else (by Daniel Killebrew aka gittywithexcitement) - issue #448, pull #450
  • Fixed Win32FileStream to report itself as readable for FileMode.createTrunc
  • Fixed a possible memory corruption bug for an assertion in AllocAppender
  • Fixed clearing of cookies on old browsers - issue #453
  • Fixed handling of yield()ed tasks so that events are guaranteed to be processed
  • Fixed Libevent2EventDriver.resolveHost to take the local hosts file into account (by Daniel Killebrew aka gittywithexcitement) - issue #289, pull #460
  • Fixed RedisClient.zcount to issue the right command (by David Nadlinger aka klickverbot) - pull #467
  • Fixed output of leading white space in the HTMLLogger - now replaced by  
  • Fixed serialization of AAs with const(string) or immutable(string) keys (by David Nadlinger aka klickverbot) - pull #473
  • Fixed double-URL-decoding of path parameters in URLRouter
  • Fixed URL.toString() to output username/password, if set
  • Fixed a crash caused by a double-free when an SSL handshake had failed
  • Fixed Libevent2UDPConnection.recv to work inside of a Task
  • Fixed handling of "+" in the path part of URLs (is not replaced by a space) - issue #498
  • Fixed handling of <style> tags with inline content in the Diet compiler - issue #507
  • Fixed some possible sources for stale TCP sockets when an error occurred in the close sequence
  • Fixed the Win64 build (using the "win32" driver) that failed due to user32.dll not being linked
  • Fixed URLRouter to expose all overloads of match() - see also pull #535
  • Fixed deserialization of unsigned integers in the BSON serializer (by Anton Gushcha aka NCrashed) - issue #538, pull #539
  • Fixed deserialization of unsigned integers in the JSON serializer
  • Fixed serialization of nested composite types in the JSON serializer
  • Fixed two bogus assertions in the win32 event driver (one in the timer code and one for socket events after a socket has been closed)
  • Fixed WebSocket.waitForData to always obey the given timeout value (by Martin Nowak) - issue #544, pull #545
  • Fixed the high level tests in the "tests/" directory (by Mathias Lang aka Geod24) - pull #541
  • Fixed HashMap to always use the supplied Traits.equals for comparison
  • Fixed the example projects and switched from "package.json" to "dub.json" (by Mathias Lang aka Geod24) - pull #552
  • Fixed emitting an idle event when using processEvents to run the event loop
  • Fixed Path.relativeTo to retain a possible trailing slash
  • Fixed image links with titles in the Markdown compiler (by Mike Wey) - pull #563
  • Fixed a possible stale TCP connection after finalizing a HTTP client request had failed
  • Fixed makeIsolated to work for structs
  • Fixed listenHTTP to throw an exception if listening on all supplied bind addresses has failed
  • Fixed a possible crash or false pointers in HashMap due to a missing call to GC.removeRange - issue #591
  • Fixed non-working disconnect of keep-alive connections in the HTTP server (by Stephan Dilly aka Extrawurst) - pull #597
  • Fixed a possible source for orphaned TCP connections in the libevent driver
  • Fixed exitEventLoop to work when called in a task that has been started just before runEventLoop was called
  • Fixed isWeaklyIsolated to work properly for interface types (by Luca Niccoli aka lultimouomo) - pull #602
  • Fixed the BsonSerializer to correctly serialize SysTime as a BsonDate instead of as a string

Note that some fixes have been left out because they are related to changes within the development cycle of this release.


Posted at 19:39:59 +0100 by Sönke Ludwig 0 comments

New ApplyYourDLang channel on YouTube

Header image
Thu, 20 Feb 2014 A new tutorial channel for D has been started recently by Simen Endsjø and Rikki Cattermole. It contains beginner friendly step-by-step introductions to everything from system setup to the language ecosystem and the language itself, including an example of using DUB and vibe.d.

Find the full list of videos and playlists on the ApplyYourDLang channel. The following video has been recorded by Simen Endsjø, starting off by giving a general overview of the language's ecosystem and concludes with a simple vibe.d based web application. An additional setup tutorial that goes into a little more detail regarding the tools installation has been recorded by Rikki Cattermole.

Posted at 11:53:28 +0100 by Sönke Ludwig 3 comments

Pages: 1 2 3 4 5 6