Post 9oOaXaeZFdotYMUKmW by samir@bsd.network
(DIR) More posts by samir@bsd.network
(DIR) Post #9oMSMlFgJlGLI0FmRk by trevdev@mastodon.technology
2019-10-27T19:42:35Z
0 likes, 0 repeats
I've been eyeballing #golang, #rust and #cpp - I don't necessarily need to learn any of these languages. Python & JS are getting my jobs done...but I definitely want to explore something more low-level.It could be handy one day. I'm more leaning to go or rust. If you're enjoying any of these three languages, let me know which one and why!
(DIR) Post #9oMSMlqu5N2L9RfVSq by toast@toast.cafe
2019-10-27T19:59:02.729770Z
0 likes, 0 repeats
@trevdev Hi there!I used to be a professional C++ developer, and yelled at people because they thought it was like C.If you choose C++, do not write it as if it was C.I don't like Rust, because it does the same thing Ada did - instead of trying to solve a problem, most of your time is spent figuring out how to convince the compiler that the thing you're doing is safe.Go is good, starting with version 1.11.I recommend Go.The short version of stuff that makes Go cool:- It's a very SMALL language (much more reminiscent of C than C++), but fixes a lot of the issues inherent in it (minus nil, but you can't fix that without introducing a lot of complexity).- The module system (as of 1.11) is pretty sane.- It can be bootstrapped without banging your head against a rock until it's easy to mistake it for a piece of modern art.- Its approach towards interfaces is pretty revolutionary.
(DIR) Post #9oMSdF3zFPA8Ngds6i by trevdev@mastodon.technology
2019-10-27T20:01:40Z
1 likes, 0 repeats
@toast Very interesting! I installed a go module on my system recently and was surprised at how easy it was to reason about - so I looked into the source code and felt like I could almost understand what was going on.Which aspects of interfacing do you feel are most revolutionary?
(DIR) Post #9oMSwKjMOuAvSa67Ky by toast@toast.cafe
2019-10-27T20:05:28.922822Z
0 likes, 0 repeats
@trevdev in most languages, interfaces have to be explicitly implemented.In C++ it's done via inheritance, other languages have "implements" and so on.In Go, it's closer to duck typing.If an interface says "this type must have the following functions", and you have a type from somewhere ENTIRELY DIFFERENT that happens to have those functions, it technically implements the interface.One example way of showing this off is logging implementations.Various logging systems exist (like logrus etc).Various projects want to be able to easily swap the logging system they use.Under most languages, this would be done via some form of translation layer.In Go, the projects would simply define an interface that explains how they intend to use the logging interface (e.g it must have a Printf, Infof and Errorf function with these types).Then, as long as the logging project in question has those functions (they usually do), you can just plug and play.It's fairly hard to really explain without trying it or showing code, so I do recommend writing some smallish project just to check it out :)
(DIR) Post #9oMTd1CwrU39MaI6oS by trevdev@mastodon.technology
2019-10-27T20:12:59Z
1 likes, 0 repeats
@toast Then write I shall!
(DIR) Post #9oMvjQB3jgTpG7FUYK by samir@bsd.network
2019-10-28T00:56:01Z
0 likes, 0 repeats
@trevdev I recently went through a similar exercise and while it’s not one of the options you’re considering, I’ve been spending a lot of time with #dlang and have really been enjoying it. The best way I can describe it is as a statically typed version of python. https://samirparikh.com/blog/adventures-in-dlang.html
(DIR) Post #9oMvjQsJ8t4hQFU1xo by trevdev@mastodon.technology
2019-10-28T01:26:21Z
0 likes, 0 repeats
@samir Not a bad resume.https://dlang.org/orgs-using-d.html
(DIR) Post #9oMvjRlFqb1kAfBubo by toast@toast.cafe
2019-10-28T01:28:03.166674Z
0 likes, 0 repeats
@trevdev @samir D is pretty nice, but it has ecosystem problems.Even though it got added into gcc9 as an official language, basically no distro has managed to get gdc9 going.The package manager (dub) is pretty dumb, and doing static linking is usually impossible or really stupid.The people behind the package manager (vibe-d devs) seem to think that leaking connections and sockets on closing is "perfectly fine".Ultimately, the issue with D isn't D, but everything around it :(
(DIR) Post #9oOaXaeZFdotYMUKmW by samir@bsd.network
2019-10-28T20:39:41Z
1 likes, 0 repeats
@toast @trevdev I'm not a professional programmer and use programming just as a hobby to solve math puzzles and such but the challenges you mention are a common refrain in the mailing lists. I do have high hopes for D and really enjoy using it but hope they can resolve some of these issues.
(DIR) Post #9oOabslrpdiAu1wv5c by toast@toast.cafe
2019-10-28T20:40:48.679564Z
0 likes, 0 repeats
@samir @trevdev D has a few other downsides, but if they fix those problems it will certainly be a valid choice for some use-cases :)As is though, I'll just use Go for what I'd normally use D for. (brpaste.xyz will probably be rewritten in Go whenever I get around to it)