Reflections on using Go instead of D

SealabJaster sealabjaster at gmail.com
Tue Jul 12 15:56:39 UTC 2022


On Tuesday, 12 July 2022 at 02:42:00 UTC, jfondren wrote:
> Howdy,
>
> I've been using Go recently, for the following reasons:
>
> 1. I want to quickly deploy and run a program across an 
> excessively diverse
> range of Linux systems and also Windows, without needing a 
> build farm.

I definitely wish it were a bit easier to get this done.

>
> 2. I'd like the program to be a completely static binary.

I tried a while back to make a core -betterC library that didn't 
need libc, but kind of dropped it since 1. I had no idea what I 
was doing at the best of times, and 2. I was running into an 
issue I had no idea or willpower to fix.

> 3. I'd like the program to make HTTPS connections and maybe 
> query a local sqlite database.

This is especially true with -betterC. I've taken a strange 
liking to it despite being a GC-fanboy.

I'm currently working on a private -betterC library to handle my 
needs (HTTP client with SSH capabilities; threaded HTTP server 
with a request pipeline; datastructures because hashmaps, arrays, 
and dynamic strings are apparently too high a bar for native 
-betterC support in Phobos...)

> ...

Don't have much else to comment, but just wanted to let you know 
I read the rest :)


I'd like to also add: While I love writing Go, I hate certain 
aspects of it that D might really shine through in:

* I hate that mocking libraries are either external code 
generation tools or just look and feel like hacks.

* Similarly, writing tests in Go, while it's streamlined similar 
to how D has `unittest`, the tests themselves can be quite 
strainful to write. Ginkgo and Gomega make it a lot better, but 
there's still room for improvement.

* While generics have made the issue a lot less painful, it's 
still not nice having to make things an `interface{}/any` just to 
have some form of reusability in algorithms.

Also god I love how easy Goroutines are to use.



More information about the Digitalmars-d mailing list