arsd package updates, forum nonsense
Posted 2019-10-21
Blog
Articles- terminal.d gets clipboard functions, ldc 1.20 out.
- DConf keynote speaker announced: Lua architect Roberto Ierusalimschy, Named args DIP discussed
- February 3, 2020
- Adam's terminal suite explained
- Understanding mixin templates, terminal.d improvements
- My attribute-by-default proposal. Also dmd 2.090 came out.
- DConf 2020 announced: June 17-20 in London. @safe by default debated. Adam did: Android, JNI, WebSocket in arsd libs
- tar.xz, --DRT tip, dom bug fixes, more Android and JNI, link to old phobos docs
- LDC 1.19 - Android, AVR. My rant on tests, update on JNI and COM.
- Walter's string interpolation proposal is OK but not great. My Android thing nearing beta release. dub downtime explained.
- Android project update, introduction to arsd.jni
- New pattern about interface contracts
- Adam shares Windows console secrets - DO NOT USE chcp!!
- Adam's rant on benchmarks
- Socket tutorial
- November 4, 2019
- October 28, 2019
- arsd package updates, forum nonsense
- Update on Android
- Adam does iOS "goodbye world"
- September 30, 2019
- D turns 20, Adam rants on software freedom
- Named arg DIPs and my thoughts on code organization
- September 9, 2019
- I wrote about mixin templates vs string mixins on Stack Overflow
- August 26, 2019
- Bug bounty in D again - my hot take, on reusing code, a fun picture, my tentative plan for the next month
- Time invested is worth a lot
- cgi.d's new scheduler, static this tricks
- July 29, 2019
- July 22, 2019
- Solving vs managing problems
- A big week in the arsd repo
- July 1, 2019
- June 24, 2019
- June 17, 2019
- CRTP thoughts, named arguments DIP review, DConf videos now on youtube
- musings on hybrid CT/RT tests, some more progress on new web framework
- a little more webassembly
- May 20, 2019
- Adam's string interpolation proposal
- DMD 2.086 live, GCC 9 with D support formally released, DConf coming soon, links to posts on builder pattern and disallowing implicit conversions with templates, and 2d array op overloads
- template constraint error improvements coming?
- dmd 2.086 beta, dstep 1.0 released, Adam works on memory usage
- obj-c and webassembly report, tips on is expressions linked.
- new ldc, new dmd, dpp on the blog
- D's future discussed in forums
- LDC beta, DConf blog link, Adam introduces gamehelpers.d
- March 18, 2019
- LDC 1.15.0-beta1, responsive design rant
- dmd 2.085.0 released
- Obj-C interop and D without druntime code to copy/paste
- dmd beta, more info coming next time, demo of new web framework initial prototype
- automatic web interface discussion, reflection tips and tricks
- Adam busy with weather and a move, lots of community announcements
- January 28, 2019
- Working on official blog 2018 retro, C++ new wrapped, dmd reading zips?
- dmd obj-c growing, Adam static foreaches an interface to RPC
- dmd 2.084, hope for future, but busy non-D week for me
- IDE tools released, my cgi.d gets new features
- DConf announced, tip, Adam rants: mouse trap
- This Week in D is back!
arsd-official tagged 4.1.4, my 11 1/2 old library demonstrates compatibility with Slackware's gdc package as well as newest dmd.
Core D Development Statistics
In the community
Community announcements
See more at the announce forum.
On the forums
The forum this week had a monster thread with all kinds of silly stuff, leading to renewed talk about moderation and lots of mudslinging.
Personally, I think most of it was ridiculous, but there is some talk about interfaces and private I found interesting enough to talk about, and I want to mention some thoughts on moderation.
Interfaces and the private keyword
There's some people in the community who dislike D's private meaning private to the module rather than private to the discrete aggregate. I personally like it just the way it is, but I wouldn't fight against adding something like private(class) as an additional level as long as it reflects similarly to regular private so I don't have to add another case to my code :P
But anyway, I'd like to propose a couple alternatives. One is doing privacy like in older Javascript versions: local variables inside a function are your private ones, and a returned object has the private ones. I'm only half serious about that... but that's more than totally not serious, it would work.
My more serious thought though, and keep in mind it is usually OOP users who speak out against D's definition or private, is to leverage interfaces.
If you write a function that only takes an interface, defining the minimum set that makes sense instead of the whole concrete class, you don't have access to the private implementation!
Well, OK, you kinda do, through cast, but that's already iffy OO design, and will not happen by accident, so just... don't do that.
And as a benefit, your function may be more reusable by other classes too. See, that's the real reuse OOP offers: not reusing parent implementations, but reusing consumer functions written against the interface.
It really is pretty decent.
Moderation and NNTP
Another common refrain that came up again this week was that D needs a "modern forum". I disagree for several reasons, but the one I want to write about here is moderation tools are totally possible with the client-agnostic system we have now (whether web, email or newsgroups).
An email or NNTP server doesn't have to accept every message it gets. It is allowed to reject them for a variety of reasons... and using that, we could ban people by rejecting all their messages. We can lock threads by rejecting messages that are in reply to them. (Actually, since this works by referring to parent messages, we could just lock one branch of a conversation while keeping other, more productive branches going.)
Heck, it could even modify messages and insert warnings like "THIS MESSAGE IS IN REPLY TO A POST FROM 2015".
These controls could even be processed from clients, though I imagine the easiest way would be for the moderators to use a special part of the web interface. But for other users, their messages would be rejected by means standard clients already understand and thus do not need special modifications.
Compared to the requests for new post syntaxes and such (which are also possible using mime standards btw!) this is actually pretty easy to do without a major overhaul of the forum architecture.
What Adam is working on
On the Android project, it continues to go very slowly as I work through the IDE and build systems. Probably a couple more weeks until I get around to it all.
In the D open source world, I did some work on dpp to get it to work better on Windows.
And in my repo, I did some work to get better compatibility:
As a consequence of some of these changes, I also updated my adrdox doc generator to be able to read simple mixins, and extract declarations and documentation from inside them too. This new version is now on the dpldocs.info site for dub packages, though I doubt that new thing will affect anyone else.
You might have noticed some dpldocs.info outages this week too. That's in part because there were crashes in the search - naughty me used a __gshared inappropriately - and in part because I did a distro release update on the VM. All should be stable for the near future now.
Adam's rants
Directory layouts
I sometimes have people wanting me to add extra directories to my arsd repo, and I refuse since it would break the layout of my private ~/lib directory on my computer. And I realized this week my layout might be useful to other people too.
With my directory layout, I can go to ~/lib and git clone arsd and boom, just like magic, dmd -i can now find all those modules. I don't have to add additional paths to my compiler invocation nor move any files around. My simplified directory layout works with my simplified build process quite nicely.
I'm actually kinda tempted to make an alternative package manager for D that does something similar: automatically grabs some source and then reorganizes it into filenames and directories that match their module name in the source code. Then, you simply run dmd -i main.d and things just work when you import whatever.is.installed;.
But meh, I've managed to beat dub into working with my code lately, and my layout still works excellently for me, so probably not much use muddying the waters of dub.
Libraries, again
I was in a curious case recently wherein I was asked, for a technical assessment, to determine if a given integer, a is odd. I wrote (a&1) and moved on. When going over the assessment, they wanted to revisit this: how else might I do it?
Well, sure, sometimes I like to write out the ?true:false since I personally don't really like implicit conversions between int and bool and wish the language would restrict them, but no, that wasn't what they were getting at either. I gave up and just asked them for the answer they were looking for.
Their answer? "did you consider using a library?" I kid you not. I was momentarily dumbfounded - was this parody? But instead of saying that out loud, I laid out my philosophy on libraries: they can be useful, but not necessarily. They always come with various costs, including cognitive load (what, exactly does that function do? i have to ask that a lot during debugging sessions), dependency management and associated risks, and library code is still code and thus has a maintenance burden. These costs need to be weighed the benefits, and in this case, it is a clear loser to simply writing the code inline. If they didn't say "integer" originally, I might have done it differently... but they did so this way is pretty reasonable.
At least they accepted that explanation, but still, if this is modern innovation in software engineering, maybe I need to get out of this field.
If D ever had an isodd package, I would know all is lost in my beloved programming language.
wait a minute
http://code.dlang.org/packages/isodd
*insert car crash sound effect here*
Sigh. lol