←back to thread

147 points teleforce | 6 comments | | HN request time: 1.408s | source | bottom
Show context
Defletter ◴[] No.43800784[source]
Really wanted to like Dlang but I just did not have a good time with it.

One of my projects has a really simple server written in nodejs that's basically (in terms of complexity) just an auth'd chatroom, and I wanted to switch it from using raw tcp sockets to websockets. And since the server is so simple, why not refactor it to another language and see if there's no some performance gains from that? I ended up doing something pretty similar to that "Comparing 10 programming languages. I built the same app in all of them." video from Tom Delalande (https://www.youtube.com/watch?v=-MbTj8DGOP0). I had several working versions of the server in:

- Bun, using Bun APIs (https://bun.sh/docs/api/websockets)

- Dart, using Dart APIs (https://api.dart.dev/stable/latest/dart-io/WebSocket-class.h...)

- Java, using Java-WebSocket (https://github.com/TooTallNate/Java-WebSocket)

- Kotlin, using Ktor (https://start.ktor.io/p/ktor-websockets)

- Rust, using tokio-tungstenite (https://docs.rs/tokio-tungstenite/latest/tokio_tungstenite/i...)

- Zig, using websocket.zig (https://zigistry.dev/packages/karlseguin/websocket.zig/)

- D, using serverino (https://code.dlang.org/packages/serverino)

And Dlang was, by far, the worst experience out of the lot. Firstly is the lack of adequate, comprehensive, and centralised tooling. I almost gave up when dmd could not even compile a freshly init'd project. The impression I got is that you're not really meant to use dmd directly, you're meant to use dub, like how you compile Java projects with Maven/Gradle, not javac. Except that there's also apparently three competing compilers (https://wiki.dlang.org/Compilers)? And good luck remembering the names of the tooling because they're all some random three-letter combination.

Serverino makes heavy use of mixins and attributes (think Java annotations), which is not ideal. But what really killed the deal was (despite using the recommended intellij plugin (https://wiki.dlang.org/IDEs) with the recommended tools installed and setup) not being able to inspect[1] serverino's mixin or its attributes. So I look at serverino's source code, except its source also has mixins... which I can't inspect. I'm not going to use something when I cannot easily ascertain its control flow. And while, yes, I probably should have gone with vibe-d (https://code.dlang.org/packages/vibe-d%3Ahttp) in the first place, mixins and attributes are nonetheless part of the language and the tooling should be able to tell me about them.

- [1] When I say "inspect" I mean requesting the IDE to show me the source/definition so I can see what it is, what it does, and where it's known to be used.

replies(5): >>43801245 #>>43801515 #>>43805149 #>>43805510 #>>43807969 #
trikko ◴[] No.43807969[source]
Hi there. I'm the serverino's author.

Could you please explain better what's wrong with it?

It could be useful to improve newcomers experience.

How did you choose serverino over other frameworks?

replies(1): >>43809720 #
1. Defletter ◴[] No.43809720[source]
Oh the issue isn't with serverino itself but with the lack of tooling-support for the language features that serverino makes heavy use of. And while serverino is open source, so one can ultimately view its source code, not having access to modern IDE type inspection adds a lot of unnecessary friction.
replies(1): >>43810332 #
2. trikko ◴[] No.43810332[source]
Still curious: How did you choose Serverino among the many servers?
replies(1): >>43811056 #
3. Defletter ◴[] No.43811056[source]
Might seem silly, but the choice just came from looking at (https://code.dlang.org/search?q=websockets) and seeing that serverino is the only one maintained. vibe-d isn't listed there, I only learned about that later. Basically, serverino has good SEO.
replies(1): >>43811710 #
4. trikko ◴[] No.43811710{3}[source]
Thanks, good to know. Also the fact that you searched directly on the site is a clue for me :)
replies(1): >>43811835 #
5. Defletter ◴[] No.43811835{4}[source]
How so, if I may ask?
replies(1): >>43814880 #
6. trikko ◴[] No.43814880{5}[source]
Well, you might have searched for GitHub or got there from some page where serverino was mentioned (forum, ...) or maybe someone suggested it to you in the community. Once a program of mine was mentioned in a telegram channel and I started seeing a lot of stars on github and I didn't understand why.