www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - a new ap and a failure

reply Lars Johansson <lasse 11dim.se> writes:
My 2nd  D app in production. I and my new buddy Claude wrote  a 
log parser for MySql. Simple bread&butter program, but it was 
easy and fun to write, performant and pleasing to the eye.
There are probably a number of MySQL log parsers out there, but I 
wanted to build my own.

I found std.getopt, I like to write small things like that, 
simple useful that saves a lot of time, the problem is to find 
them when you have not written them yourself.

Before this app I tried to write a bare metal program in D 
myself, following an example I found on the net. I could not make 
it work. I asked Claude to create one, he created a working 
example after some fixing.
Claude complaint that BetterC was missing something (I forgot 
what it was) and that made it more difficult, than using C. I 
realised betterC is not a superset of C, but something else.
I also realised D bare metal is to hard for me, native assembler 
is probably a better option for me.

Somewhere I have have a Raspberry Pi4, I will try to find it, and 
write some D code there. I hope that works better than bare metal.
One question is Raspberry Pi a good 'host' for D?
Feb 19
next sibling parent reply Mindy (0xEAB) <desisma heidel.beer> writes:
On Friday, 20 February 2026 at 07:25:58 UTC, Lars Johansson wrote:
 One question is Raspberry Pi a good 'host' for D?
Certain D libraries can be quite memory-intensive to compile. You might want to try the `-lowmem` compiler switch. Also, I’d recommend to look into the 8 GB or 16 GB models. Depending on other processes (IDE, web browser, music player, …) on your system you might quickly run out of memory otherwise.
Feb 20
parent Mindy (0xEAB) <desisma heidel.beer> writes:
On Friday, 20 February 2026 at 09:06:03 UTC, Mindy (0xEAB) wrote:
 Also, I’d recommend to look into the 8 GB or 16 GB models.
But that heavily depends on what you’re doing. The 4/2 GB models can be mighty fine platforms for D development too.
Feb 20
prev sibling parent reply Serg Gini <kornburn yandex.ru> writes:
On Friday, 20 February 2026 at 07:25:58 UTC, Lars Johansson wrote:
 Before this app I tried to write a bare metal program in D 
 myself, following an example I found on the net. I could not
Did you try the second one here? First one maybe an outdated.. https://theartofmachinery.com/2017/02/28/bare_metal_d.html https://zyedidia.github.io/blog/posts/1-d-baremetal/
 Somewhere I have have a Raspberry Pi4, I will try to find it, 
 and write some D code there. I hope that works better than bare 
 metal.
 One question is Raspberry Pi a good 'host' for D?
It should work with LDC
Feb 20
parent reply Lars Johansson <lasse 11dim.se> writes:
On Friday, 20 February 2026 at 10:40:32 UTC, Serg Gini wrote:

 ...
 It should work with LDC
yes I used https://zyedidia.github.io/blog/posts/1-d-baremetal/. but I only followed 1st and last. As usual I skipped the middle part. Now I have redone all steps in order and now it works. I give the bare metal another try. Thank you all for help and advice. Right now I am busy with $job. The guys at the office is working on ending my contract, then I will have more time for D :)
Feb 21
parent reply Lars Johansson <lasse 11dim.se> writes:
On Saturday, 21 February 2026 at 16:04:37 UTC, Lars Johansson 
wrote:
  I give the bare metal another try.
Finally I’m done with my bare metal experiment. Quite a learning experience. If you should do serious bare metal coding I think you need to be proficient in C and assembler (which I’m not). Is betterC the right environment for bare metal? I do not know. BetterC is definitely better than I thought, very easy to use. Still, so far programming in D is a pleasant experience. My biggest problem is, I do not know what I should use D for. And a question - Is BetterC a superset of C?
Feb 27
next sibling parent Kapendev <alexandroskapretsos gmail.com> writes:
On Friday, 27 February 2026 at 14:56:33 UTC, Lars Johansson wrote:
 On Saturday, 21 February 2026 at 16:04:37 UTC, Lars Johansson 
 wrote:
  I give the bare metal another try.
Finally I’m done with my bare metal experiment. Quite a learning experience. If you should do serious bare metal coding I think you need to be proficient in C and assembler (which I’m not). Is betterC the right environment for bare metal? I do not know. BetterC is definitely better than I thought, very easy to use. Still, so far programming in D is a pleasant experience. My biggest problem is, I do not know what I should use D for. And a question - Is BetterC a superset of C?
BetterC is a subset + no D runtime. The no runtime part is the important one when using it.
Feb 27
prev sibling next sibling parent Kapendev <alexandroskapretsos gmail.com> writes:
On Friday, 27 February 2026 at 14:56:33 UTC, Lars Johansson wrote:
 My biggest problem is, I do not know what I should use D for.
Make games!!!1 It's good for the brain 🧠
Feb 27
prev sibling next sibling parent Andy Valencia <dont spam.me> writes:
On Friday, 27 February 2026 at 14:56:33 UTC, Lars Johansson wrote:
 My biggest problem is, I do not know what I should use D for.
FWIW, I no longer code any tools in Python. Having a big chunk of learning curve behind me, it's mostly just as productive, and much higher performance. Andy
Feb 27
prev sibling next sibling parent matheus <matheus gmail.com> writes:
On Friday, 27 February 2026 at 14:56:33 UTC, Lars Johansson wrote:
 ...
 Still, so far programming in D is a pleasant experience.
 My biggest problem is, I do not know what I should use D for.
Shouldn't this be otherwise, first looking for some problem to solve and use a language like D to handle it?
 ...
 And a question - Is BetterC a superset of C?
No. It's a superset of D. More info: https://dlang.org/spec/betterc.html To be honest I don't see advantages of using it, because you lost things that made D a differential like: GC, AA, DA as get go. When I used to program in D more heavily, I used mostly with C mentality but using its features like: GC, AA, DA, exceptions. Matheus.
Mar 02
prev sibling next sibling parent Dejan Lekic <dejan.lekic gmail.com> writes:
On Friday, 27 February 2026 at 14:56:33 UTC, Lars Johansson wrote:
 Still, so far programming in D is a pleasant experience.
 My biggest problem is, I do not know what I should use D for.
I find D to be particularly good for writing desktop applications. Here is one: https://codeberg.org/dejan/dterm . I use it 10+ hours each day. Or the Daphne music player that I also use entire day as I need some music while I code - https://codeberg.org/Kymorphia/daphne . Similar story is DIDE, which I use for all sort of quick D tests - https://codeberg.org/dejan/dide . Just because D is suitable for systems programming does not mean it should only be used for that. It can obviously be used for all sort of "consumer"/enterprise applications. My advice to people is always this - identify need for particular application, even if there is already an implementation in some other language, and implement it in D. Using your own software, or software you heavily contribute to, is extremely rewarding not just mentally, but also there is the valuable learning process...
Mar 02
prev sibling parent reply Sergey <kornburn yandex.ru> writes:
On Friday, 27 February 2026 at 14:56:33 UTC, Lars Johansson wrote:
 Still, so far programming in D is a pleasant experience.
 My biggest problem is, I do not know what I should use D for.
honest answer - nobody knows so its fine :) I believe it is great for hobby programming, when you don't need any serious requirements for performance, support, maintainability, team management and all other important things of production software development.
Mar 02
parent Kapendev <alexandroskapretsos gmail.com> writes:
On Monday, 2 March 2026 at 20:29:19 UTC, Sergey wrote:
 On Friday, 27 February 2026 at 14:56:33 UTC, Lars Johansson 
 wrote:
 Still, so far programming in D is a pleasant experience.
 My biggest problem is, I do not know what I should use D for.
honest answer - nobody knows so its fine :) I believe it is great for hobby programming, when you don't need any serious requirements for performance, support, maintainability, team management and all other important things of production software development.
 when you don't need any serious requirements for performance
Python is a thing and it's mega slow (don't think that's a hot take). If people really cared about those things, then we would have: ![future](https://media1.tenor.com/m/CPppflzCUYYAAAAC/future-ram-ranch.gif) And: ![future2](https://media1.tenor.com/m/dROhaApyMtUAAAAd/digimon-adventure.gif) But sadly, I will never have a Lady Devimon. I still think most people should makes games. Do that.
Mar 02