November 01, 2021
On Mon, Nov 01, 2021 at 08:33:22PM +0000, harakim via Digitalmars-d wrote:
> On Monday, 1 November 2021 at 20:32:04 UTC, harakim wrote:
> > On Saturday, 30 October 2021 at 01:48:25 UTC, harakim wrote:
> > > I'm curious: Is there a poll somewhere that asks what kind of software projects people write in D? If not, what does everyone write using the D Language?
> > 
> > This is definitely not a research-journal-worth analysis but I quickly went through and summarized the usages in this thread
> > 
> > Developer Tools: 7
> > Productivity Tools: 6
> > Multimedia Desktop Applications: 3
> > Other Desktop Apps: 3
> > Games: 3
> > Data Processing (including signals and bioinformatics): 3
> > Web Development: 2
> > Embedded Development : 2
> 
> I made a correction.

Late to this, but I use D for a wide variety of purposes (all personal, unfortunately -- currently I'm unable to use D at work for various reasons).  Here are some of the projects I've used it for:


CLI:

- As a sophisticated substitute for shell scripts (i.e., anything that
  requires more than simple if-then-else shell scripts, D is much more
  suitable, thanks to proper typing, arrays, an awesome std.process,
  etc..).  Various convenience wrappers around backup programs like tar
  and rsync, etc..

- A scheduling program for assigning people to slots in recurring
  events on a rotational basis.

- A simple CLI-based TODO list manager.

- A replacement for the BSD `cal` program that I recently started using
  exclusively (see: https://github.com/quickfur/dcal )


Math-related:

- A geometric calculator for computing convex hulls and other geometric
  operations, for exploration of higher-dimensional geometry and
  generating visualizations, containing:
   - A not-bad double-description convex hull implementation written
     entirely in D;
   - A D implementation of Kaibel's algorithm for face lattice
     enumeration from vertex incidences;
   - A wrapper around the MPFR arbitrary-precision floating point
     library;
   - A fit-to-grid algebraic number identifier / guesser;
   - A permutation factorization utility (for identifying permutation
     sets given a set of n-dimensional points);
   - An external test utility (as a complement to built-in unittests;
     this one uses std.process's awesome convenient API for running
     canned tests on user-specified command-lines, and Phobos' awesome
     Levenshtein distance algorithm for reporting unexpected outputs in
     a minimal way).

- A math exploration tool for rendering images of 2D equations that can
  handle arbitrary equations in 2 variables. Does both PNG output and
  on-the-spot OpenGL rendition.  Contains a minimal wrapper around
  libfreetype for font rendering.

- A Gröbner basis solver (toy version only, though; I lack the skill to
  write an industrial-strength one).

- A simple Monte Carlo springs-and-sticks model solver.

- A library for performing exact computations with quadratic irrationals
  (see: https://github.com/quickfur/qrat )

- Various ad hoc solvers for various geometric problems, counting
  problems, etc..


Music:

- A management program for automating the generation of boilerplate for
  large music typesetting projects in Lilypond.

- A program for dissecting midi files (incomplete).


Web:

- A CGI utility for generating HTML interlinears given text input.

- Various maintenance utilities for managing a website and scripted
  generation of content updates.


Casual games:

- An experimental GLES2 Android game (incomplete) with an on-PC X11 test
  harness. Contains D utilities for auto-generation of GLES boilerplate
  plus the associated D-facing interfaces.

- Various casual text-based games (incomplete; basically they only get
  worked on when I have spare time, which I have rather little of),
  which use an ECS-like object storage system and a minimalistic
  serialization / deserialization module (both with super nice APIs
  thanks for D's compile-time introspection).

- A game simulation program for generating 2D terrains with some degree
  of realism by simulating wind/water erosion over a 2D grid.

- Various puzzle game solvers (sliding block puzzles, etc.).

- A terminal output recorder / replayer for programs that use Adam
  Ruppe's arsd.terminal for output. (Basically, for recording and
  replaying terminal-based game playthroughs.)

//

Basically, anything that needs programming to solve, I reach for D. Except perhaps for trivial (<10-15 line) shell scripts, which are still easier to write in shell than in D.  But anything more complex than trivial shell scripts, I reach for D for better expressivity and control. (The shell's promiscuous tendency to expand variables in strings everywhere it's not wanted is extremely frustrating; I prefer D's much cleaner syntax and predictable semantics.)


T

-- 
Insanity is doing the same thing over and over again and expecting different results.
November 01, 2021
On Monday, 1 November 2021 at 21:51:31 UTC, H. S. Teoh wrote:
> - A math exploration tool for rendering images of 2D equations that can
>   handle arbitrary equations in 2 variables. Does both PNG output and
>   on-the-spot OpenGL rendition.  Contains a minimal wrapper around
>   libfreetype for font rendering.

you should have used my libs for this too, you get font, opengl, and png all in there for you!!!

> - A program for dissecting midi files (incomplete).

i also have midi

and of course cgi modules

my libs do it all
November 01, 2021
On Mon, Nov 01, 2021 at 10:00:27PM +0000, Adam D Ruppe via Digitalmars-d wrote:
> On Monday, 1 November 2021 at 21:51:31 UTC, H. S. Teoh wrote:
> > - A math exploration tool for rendering images of 2D equations that
> >   can handle arbitrary equations in 2 variables. Does both PNG
> >   output and on-the-spot OpenGL rendition.  Contains a minimal
> >   wrapper around libfreetype for font rendering.
> 
> you should have used my libs for this too, you get font, opengl, and png all in there for you!!!

Haha, the font wrapping was pretty easy, the freetype headers have the interesting property that error codes are defined with C macros that are defined externally; by suitably redefining these macros and #include'ing the header file twice, I managed to generate D code from the C header file.  The input file is an abominable mixture of CPP macros and D code snippets. :-D  It was lots of fun.

OpenGL was no problem at all, I already had the DPP-transcribed GL headers from my Android project, so all I needed was to call EGL to initialize the context, then call GL functions away.

PNG output was from a previous iteration of the program that generated the PNG binary representation using purely range-based code.  In retrospect, though, I should've gone with a buffer-based approach, 'cos the range-based implementation is dog-slow. (I *could* insert caches in the UFCS pipelines at strategic points, but at that point it kinda defeats the purpose of using ranges in the first place and I might as well just write a "traditional" implementation instead.)


> > - A program for dissecting midi files (incomplete).
> 
> i also have midi
> 
> and of course cgi modules
> 
> my libs do it all

LOL...  I love your libs 'cos they have like no dependencies, I can just drop the file into my directory and it Just Works(tm).  Having been bitten multiple times by library versioning hell in long-running code, I've come to believe that external dependencies are a net negative in the long run.  Yes, in the short run it lets you get off the ground faster with less effort and less time, but in the long run all sorts of maintenance problems crop up:

1) Upstream abandons the lib that you critically depend on, and now you're stuck having to maintain it yourself. Good luck if it has stopped compiling 2 compiler releases ago and you don't understand the code well enough to know how to fix it.

2) Upstream releases a new version that has an incompatible API, so
you're stuck with the old version. Eventually, you end up in problem
(1).

3) Upstream releases a new version and doesn't change the API, but *does* change the semantics of some obscure use case that you critically depend on.  Maybe they think that particular behaviour is a bug or something they don't want to support.  Goto problem (2).

4) Upstream's new version doesn't change the semantics, but *does* change the performance characteristics of critical functionality (in a very detrimental way). They refuse to fix it, because their brand new features X, Y, Z all depend on the new implementation in an irreplaceable way, and besides, your usage of it is not a supported use case for performance purposes.  Luckily, your program still compiles and works as before.  Unluckily, it has become unusably slow, and customers are angry and leaving by the droves.  Again goto problem (2).

5) Upstream decides that they need to depend on libraries X, Y, Z, all of which potentially suffer from (1), (2), (3), or (4).  As the end user, you of course inherit all of the problems.  The worst of these problems is that any one of the 150 recursive dependencies may suddenly release a new version that breaks critical functionality you depend on, and since you didn't even know that the library depended on such a thing, you haven't the slightest clue which of the 150 recursive dependencies is causing the problem, let alone figure out how to fix it.

6) If you're unlucky enough to depend on a package system that dynamically updates packages from the intarweb, beware: nasty surprises await on the day of your big upcoming release when one of the 150 upstream dependencies suddenly decide to upload a new version that breaks *everything*.

7) Actually, that's if you're lucky. Maybe on that day one of those 150 dependencies mysteriously falls off the face of the internet, leaving your code uncompilable.  Hope and pray that you still have a copy of it somewhere in your cache, and that you haven't conveniently cleared your cache recently because it was growing too big, because you don't know when it's coming back online (if ever!).

8) There's a security hole in one of those 150 dependencies that's making your app today's worldwide favorite 0-day exploit, and you have no idea that your code depended on that vulnerable module, let alone know how to fix it.  Upstream, of course, has conveniently fallen off the face of the internet and aren't responding. (Or they're "working on a fix" but are taking a long time, and you can't wait since customers are leaving by the droves.) Or worse, the entire repo has gone offline (probably pulled because of the 0-day) and all you have now is a cached copy of the stale, and still-vulnerable code.

9) Your code compiled and worked perfectly fine 5 years ago when you last built it, and you have come to depend on the executable for your critical business functionality.  Then today you found a trivial bug with a 1-line fix.  Unfortunately, the code doesn't compile anymore because 37 of the 150 modules have released new, incompatible versions that your code no longer works with, and 17 modules (13 of which you had no idea you even depended on) have vanished into the ether never to be found again.  What you thought would be a 1-line fix turns into days, weeks, months, or, God forbid, *years* of effort to reengineer the now-missing functionality.

10) You're on the road away from any access point, and you want to make a 1-line change to your code.  Of course, you can't recompile, 'cos the intarweb is down...  Enjoy your vacation!


After being burned by the above problems, I have come to the conclusion that any dependencies must:

1) Have source code.  Binary-only libs are a no-no because of all of the above, plus you cannot fix the problem even if by some miracle you have infinite time and energy to invest in fixing it.

2) Exist in a *permanent* form on the local hard drive (caches are not counted because they can be easily lost). Preferably as part of the working source tree (out-of-tree modules are bad because they can disappear, point to the wrong thing, be inadvertently upgraded to an incompatible version, etc.).

3) Have as few other dependencies as possible, preferable none at all.

4) Exist in a compact form (preferably a single file) that can just be copied and dropped into your source tree at will, without a ton of hassles. And easy to upgrade (just copy the new version into the source tree) without running into problems like partial upgrades (forget to copy 1 of 2 files, now they are of incompatible versions and may appear to work but introduce subtle bugs).


Adam's libs fit the bill very nicely indeed.


T

-- 
Unix is my IDE. -- Justin Whear
November 01, 2021
On Mon, Nov 01, 2021 at 10:00:27PM +0000, Adam D Ruppe via Digitalmars-d wrote: [...]
> i also have midi
> 
> and of course cgi modules
[...]

P.S.: FYI, the CGI app I wrote *was* written using your cgi.d. :-) Which is awesome 'cos it can be tested on command-line without starting a webserver, *and* the same binary works inside CGI too.  cgi.d is total awesomeness.


T

-- 
Obviously, some things aren't very obvious.
November 02, 2021

On Saturday, 30 October 2021 at 01:48:25 UTC, harakim wrote:

>

I'm curious: Is there a poll somewhere that asks what kind of software projects people write in D? If not, what does everyone write using the D Language?

We are developing Azure-Sphere High-secure Gateway Router, it's now in the end of development, and will shipping to Microsoft 😎.

Microsoft Azure-Sphere MT3620 is a wifi chip, and as a gateway, we made a Linux based LTE router for MT3620, the gateway's manage software is all-done in D including production factory testing support.

As it's all about linux system programming, D is doing all things great!

Thanks and 👍 to Dlang.

November 02, 2021
On Monday, 1 November 2021 at 20:43:23 UTC, dd wrote:
> On Saturday, 30 October 2021 at 01:48:25 UTC, harakim wrote:
>> I'm curious: Is there a poll somewhere that asks what kind of software projects people write in D? If not, what does everyone write using the D Language?
>
> Currently making a few technical tools for myself with a twist such as:
> - ddh: Hasher with features I like (like mmfile).
> - ddhx: Interactive hex viewer (xxd wasn't enough for me).
> - ddcpuid: CPUID tool in betterC, counts 200+ bits (DMD/GDC/LDC compatible).
> - alicedbg: Debugger and disassembler in betterC (heavy WIP) along with a website. Currently my biggest work.
>
> All cross-platform whenever possible. All personal projects.

I want to know more about alicedbg!
November 02, 2021
On Monday, 1 November 2021 at 20:43:23 UTC, dd wrote:
> - alicedbg: Debugger and disassembler in betterC (heavy WIP) along with a website. Currently my biggest work.

Very interesting!
November 02, 2021
On Monday, 1 November 2021 at 16:09:10 UTC, Sönke Ludwig wrote:
>
> This is using a custom UI library that I started writing 20 years ago (ported from C++ to D around the time D 2.0 was released). Would be nice to release that as open-source one day, but I really want to get some architectural changes done before that happens.

definitely, D needs this.
November 02, 2021

On Saturday, 30 October 2021 at 01:48:25 UTC, harakim wrote:

>

I'm curious: Is there a poll somewhere that asks what kind of software projects people write in D? If not, what does everyone write using the D Language?

Apart from some little libraries, bindings, and ports, I recently ported EPANET (The Water Distribution System Hydraulic and Water Quality Analysis Toolkit) from C++ to D. My wife used EPANET in her PhD thesis, and I decided to play around with it to sharpen some skills. Looks like the original codebase was written in C a long time ago. I noticed that the maintainers are rewriting it using C++ to better achieve the goals defined as "the code to be more modular, extensible, and easier to maintain".

November 02, 2021

On Tuesday, 2 November 2021 at 11:31:00 UTC, Ferhat Kurtulmuş wrote:

>

On Saturday, 30 October 2021 at 01:48:25 UTC, harakim wrote:

>

I'm curious: Is there a poll somewhere that asks what kind of software projects people write in D? If not, what does everyone write using the D Language?

Apart from some little libraries, bindings, and ports, I recently ported EPANET (The Water Distribution System Hydraulic and Water Quality Analysis Toolkit) from C++ to D. My wife used EPANET in her PhD thesis, and I decided to play around with it to sharpen some skills. Looks like the original codebase was written in C a long time ago. I noticed that the maintainers are rewriting it using C++ to better achieve the goals defined as "the code to be more modular, extensible, and easier to maintain".

here: https://github.com/aferust/epanet-d-dev