vibe.d and my first web service

Pierce Ng pierce at samadhiweb.com
Sun Aug 23 06:41:03 UTC 2020


On Thursday, 20 August 2020 at 18:13:46 UTC, ddcovery wrote:
> Last month I decided it was time to start a new project (my own 
> company) and I reviewed some languages/frameworks for web 
> development (REST services, image processing, PDF generation, 
> ...):  Java based ones (I'm experienced with 
> scala/playframework and spring/java, and Kotlin is really 
> nice), c# and Net core, Node/Typescript (Last 6 years I have 
> been mainly a node backend developer) and,  finally, native 
> ones (GO, Rust and D... I developed some windows apps in 90's 
> using Symantec C++ but 20 years are a really long time).
> [...]
> Finally I'm using Rust (with Rocket and Diesel):  it's my money 
> folks :).

Recently I too started to look at web frameworks for compiled 
languages. Currently playing with Free Pascal - fast compiler, 
several web frameworks to evaluate, and Object Pascal is easy to 
pick up. At the same time I checked out D and Vibe, and was put 
off by the control-c thing.

I prefer to deploy my programs as Alpine Linux Docker containers. 
Good that D is already available for Alpine. For the hello world 
Vibe example, on my Ubuntu 20.04 laptop:

% ls -l helloworld.*
-rwxr-xr-x 3 pierce pierce 8664832 Aug 23 14:04 helloworld.dmd*
-rwxr-xr-x 3 pierce pierce 2858944 Aug 23 14:04 helloworld.ldc*

The Docker images created by multistage builds:

% sudo docker images | egrep hellow
helloworld    ldc                   86be59503802        6 hours 
ago         114MB
helloworld    dmd                   d377c0ab97ec        6 hours 
ago         19.6MB

Is the huge size difference to be expected?

For both DMD and LDC, the Docker image building process took 
long. Does the following mean that everything was downloaded and 
built each time? Possible to structure the Dockerfile so that 
some bits get cached, as per "the Docker way"? (For Free Pascal, 
executables built on Ubuntu run on Alpine as is with the 
libc6-compat package, so building Docker images is really fast 
since it just involves copying a few files and reuses some cached 
Docker layers.)

  ---> Running in a95e6ef7a8c1
Fetching vibe-core 1.9.3 (getting selected version)...
Fetching botan-math 1.0.3 (getting selected version)...
Fetching taggedalgebraic 0.11.16 (getting selected version)...
Fetching vibe-d 0.9.0 (getting selected version)...
Fetching memutils 1.0.4 (getting selected version)...
Fetching stdx-allocator 2.77.5 (getting selected version)...
Fetching botan 1.12.18 (getting selected version)...
Fetching diet-ng 1.7.2 (getting selected version)...
Fetching openssl 1.1.6+1.0.1g (getting selected version)...
Fetching eventcore 0.9.7 (getting selected version)...
Fetching mir-linux-kernel 1.0.1 (getting selected version)...
Fetching libasync 0.8.6 (getting selected version)...
Running pre-generate commands for vibe-d:tls...
Performing "release" build using ldc2 for x86_64.
taggedalgebraic 0.11.16: building configuration "library"...
eventcore 0.9.7: building configuration "epoll"...
stdx-allocator 2.77.5: building configuration "library"...
vibe-core 1.9.3: building configuration "epoll"...
vibe-d:utils 0.9.0: building configuration "library"...
vibe-d:data 0.9.0: building configuration "library"...
mir-linux-kernel 1.0.1: building configuration "library"...
vibe-d:crypto 0.9.0: building configuration "library"...
diet-ng 1.7.2: building configuration "library"...
vibe-d:stream 0.9.0: building configuration "library"...
vibe-d:textfilter 0.9.0: building configuration "library"...
vibe-d:inet 0.9.0: building configuration "library"...
vibe-d:tls 0.9.0: building configuration "openssl"...
vibe-d:http 0.9.0: building configuration "library"...
/usr/include/d/std/conv.d(4614,38): Deprecation: constructor 
`vibe.stream.wrapper.ProxyStream.this` is deprecated - Use 
createProxyStream instead.
/usr/include/d/std/conv.d(4618,21): Deprecation: constructor 
`vibe.stream.wrapper.ProxyStream.this` is deprecated - Use 
createProxyStream instead.
/usr/include/d/std/range/primitives.d(174,38): Deprecation: 
`alias byKeyValue this` is deprecated - Iterate over .byKeyValue 
instead.
/usr/include/d/std/range/primitives.d(176,27): Deprecation: 
`alias byKeyValue this` is deprecated - Iterate over .byKeyValue 
instead.
/usr/include/d/std/range/primitives.d(174,38): Deprecation: 
`alias byKeyValue this` is deprecated - Iterate over .byKeyValue 
instead.
/usr/include/d/std/range/primitives.d(176,27): Deprecation: 
`alias byKeyValue this` is deprecated - Iterate over .byKeyValue 
instead.
vibe-d:mail 0.9.0: building configuration "library"...
vibe-d:mongodb 0.9.0: building configuration "library"...
/usr/include/d/std/format.d(3645,26): Deprecation: function 
`std.typecons.Nullable!string.Nullable.get_` is deprecated - 
Implicit conversion with `alias Nullable.get this` will be 
removed after 2.096. Please use `.get` explicitly.
/usr/include/d/std/format.d(3645,26): Deprecation: function 
`std.typecons.Nullable!(Alternate).Nullable.get_` is deprecated - 
Implicit conversion with `alias Nullable.get this` will be 
removed after 2.096. Please use `.get` explicitly.
/usr/include/d/std/format.d(3645,26): Deprecation: function 
`std.typecons.Nullable!(MaxVariable).Nullable.get_` is deprecated 
- Implicit conversion with `alias Nullable.get this` will be 
removed after 2.096. Please use `.get` explicitly.
/usr/include/d/std/format.d(3645,26): Deprecation: function 
`std.typecons.Nullable!string.Nullable.get_` is deprecated - 
Implicit conversion with `alias Nullable.get this` will be 
removed after 2.096. Please use `.get` explicitly.
/usr/include/d/std/format.d(3645,26): Deprecation: function 
`std.typecons.Nullable!(Alternate).Nullable.get_` is deprecated - 
Implicit conversion with `alias Nullable.get this` will be 
removed after 2.096. Please use `.get` explicitly.
/usr/include/d/std/format.d(3645,26): Deprecation: function 
`std.typecons.Nullable!(MaxVariable).Nullable.get_` is deprecated 
- Implicit conversion with `alias Nullable.get this` will be 
removed after 2.096. Please use `.get` explicitly.
vibe-d:redis 0.9.0: building configuration "library"...
vibe-d:web 0.9.0: building configuration "library"...
vibe-d 0.9.0: building configuration "vibe-core"...



More information about the Digitalmars-d-learn mailing list