@fugger If stdin is closed such as from a ctrl-d read() returns 0 immediately so you get an empty string, otherwise you always have at least a \n
Idk how the rust code handles that
>not a fan of garbage collectors
I thought you liked Go, it's garbage collected. You can disable it in D but then you have to write things a bit more like rust
@fugger The symbol soup is hard for me to type because Icelandic keyboards move all the programmer symbols to altgr combinations
I see you're learning Jap and Русскйи, you American?
@fugger Well, rust yells at you because 1 isnt a bool
@fugger I think variable shadowing is in basically everything
I dislike immutable by default because it's an extra keyword for the majority of variables while I've never had a bug ever occur from accidentally changing a variable that should have been const, plus, you'd probably define it mut out of habbit anyway. It feels like something mainly made for corporations with a billion people working on one codebase
You mean that every statement is an expression? Seems cool and useful but also a bit confusing. Seeing an if statement and not knowing whether it's "doing" or "returning" something
DUB package manager. It's pretty similar to cargo. dub add package, dub run
cent and ucent types
Generally with DMD too, bit less so with the clang and GCC versions
The ecosystem is the main thing that D really lacks. It's made by Walter Bright whereas rust is made by Mozilla and Go by google so it's hard to compete for attention
D lets you use @safe and they're introducing @live for borrow-checking
@fugger It's mainly a bug and readability thing. Compilers can always check if you're changing the value or not
@fugger Yeah, I can respect that
For simple things like this I'd actually just use Lua. When I need very fast parallel processing I use C and OpenMP. When I need something simple but low-level it's D. When I need something async It's JS or Luvit
@fugger There was a time I even added them to if statements in Lua. Now I'm pretty used to either. I still add them when I do rust though