3 ms·
I'm doing it this year. In D, because I'm stubborn, enjoy the language, and couldn't immediately get to like Rust. Going by hype, I have a feeling learning Rus
by jordigh 9y ago
I'm doing it this year. In D, because I'm stubborn, enjoy the language, and couldn't immediately get to like Rust.
Going by hype, I have a feeling learning Rust will some day be as inevitable as interacting with git, but for the moment I'm sticking to D.
- mathw 9y agoThat remains to be seen, but I firmly believe you should do AoC in something you enjoy!
- baldfat 9y agoFirst attempt at doing it in Racket this year. I actually got through a bunch just using R last year.
- dom96 9y agoOut of curiosity, what do you enjoy about D?
- jordigh 9y agoIt's essentially the C++ I always wanted, which is more or less its intent. It's fast. The D code I write routinely matches or outperforms the C++ I also write for comparison. D is a much cleaner language. It has obvious C++ inspirations but has thrown out decades of backwards-compatible cruft. As a result, D has some of C++'s best features, like sophisticated metaprogramming, with much nicer language. In fact, this is the part I like the most: compile-time function evaluation. D allows you to evaluate essentially any function at compile time for which all of its inputs are known at compile time. It almost feels like lisp macros, with the slight downside that they work on unstructured strings instead of (minimally) structured sexps. D is safe. It produces stack traces when I mess up instead of segfaults. It won't let me compile the most obvious errors it can catch at compile time. I'm not even sure yet if it's possible to have UB in D. D is flexible. It doesn't impose an opinion on how I should do things. I can do OOP, functional, or procedural as I please and provides useful tools to do all those. OOP is like the familiar classes you know from C++ and Java with interfaces instead of multiple inheritance. Functional programming utilities are useful without being burdensome. You can totally do a for loop in a pure functional function as long as the overall function has no side effects, which is very practical. D has a bunch of other niceties which you can explore in the D's gems section here: https://tour.dlang.org/tour/en/gems/uniform-function-call-syntax-ufcs https://tour.dlang.org/tour/en/gems/uniform-function-call-sy...
- dom96 9y agoThanks for this. I only just read it :) I'm actually one of the core devs of Nim and so probably naturally your description of D sounds a lot like a description of Nim to me. You should check it out if you haven't already.