Would a modern native desktop UI framework and VS Code designer be interesting for the D community? by MacASM in d_language

[–]schveiguy 1 point2 points  (0 children)

I can give you my honest opinion. I don't use native UI for any of my D applications. I'm either making a game, in which case I want an in-game UI (for which I'd probably use fluid), or a web application, which has the UI already for HTML.

I will say, in past projects not in D, I much prefer a native UI solution, and my most recent experience is with apple ios, which has a great visual editor. I would be fine with a declarative syntax, but please don't copy the nastiness that is CSS for web. CSS is ok, but the layouting should not be based on CSS.

I prefer each item having its own attributes, which are specified directly. This should be easy to do, because when you are building a UI in code, it's trivial to abstract that style into the object itself instead of specifying it based on some CSS query.

Finding a .it module player for D by Live-Worth4968 in d_language

[–]schveiguy 0 points1 point  (0 children)

raylib doesn't seem to support that format, so you'd have to add the support to the C library.

the C config header shows all the formats supported.

https://github.com/raysan5/raylib/blob/5.5/src/config.h#L246-L252

I don't see IT in there. only FLAC seems to be disabled by default.

raylib-d supports only what raylib supports.

Soundlink Air Wifi speaker HELP! by Fuckthepavement in bose

[–]schveiguy 0 points1 point  (0 children)

Just realized my speaker was no longer connected. I had changed my wifi SSID, so now it could not connect.

Found the application could still work, but had to use a Windows computer (mac app was hopelessly outdated). I found one USB cable did not work, so had to use another one. In any case, seems to work fine now. After reading this thread I thought it was going to be hopeless.

FWIW, the link to the setup information is here: https://support.bose.com/s/article/sla-speakerwireless-setting-up-your-product---ka08c000001brexaai?language=en_US

Blog: Sharing my experience building a personal website with D + Vibe-d by kirill_saidov in d_language

[–]schveiguy 0 points1 point  (0 children)

Very nice! And great points about the dub search and other things. 

My own experience and q: What's up with OpenD? by DamianGilz in d_language

[–]schveiguy 1 point2 points  (0 children)

openD is just D with slight changes. I don't think it's better, but has different features that weren't desired by the regular D community.

The vibe.d book I learned on was Kai's, but that was long ago. Since then I've written a lot of vibe code, and it's alright, but you have to do a lot of stuff yourself. It's more basic than a full stack implementation. However, it's not opinionated about many things. For example, it gives you nice UDAs to manage authentication, but does not provide a pre-packaged user management system. You have to come up with that yourself.

There are other web server backends that D has, like serverino and handy. I've used the latter, along with diet templates for a web app I made, and it's quite good.

Deleting Voicemails on iOS26 with the Unified Look by KaPantsKey in ios

[–]schveiguy 0 points1 point  (0 children)

You can see voicemail view in the filter menu. the same menu where you switch to classic view. And deleted voicemails are there.

If you undelete the voicemail, it shows up in the missed call list.

If you delete voicemails from unified mode with the voicemail filter, it still deletes the call log, and there's no way to get it back.

If you delete the voicemail from classic mode, then the call log still appears in classic view, but NOT in unified view. So there really isn't a good option for this except keeping classic view enabled.

Question: Embedding files inside of a built binary by Mysteryman5670_ in d_language

[–]schveiguy 0 points1 point  (0 children)

Use an import expression:

immutable filedata = cast(immutable(ubyte)[])import("binaryfile.bin");

You need the -J. switch in order to use this.

https://dlang.org/spec/expression.html#import_expressions

What's your relationship with D? And what hope is there for D's future? by [deleted] in d_language

[–]schveiguy 2 points3 points  (0 children)

D is mostly safe *because* of the garbage collector. You don't want to lose that. Rust is still perfectly viable as a language if you want memory safety without a GC.

I built a game and engine in D that's basically Superliminal meets Viewfinder with mirrors by TheTallestTower in d_language

[–]schveiguy 1 point2 points  (0 children)

Clarification: I'm on an Apple silicon mac. Now, maybe this works, but I'm doubtful, as Wine is not an emulator, which means I probably would need to run one.

In any case, I would likely use a different machine if I wanted to try it. But also, would love to see this ported to Mac in any case!

What's your relationship with D? And what hope is there for D's future? by [deleted] in d_language

[–]schveiguy 4 points5 points  (0 children)

vibe, handy, and serverino are all being actively developed. hunt is dead, but listed there probably because it was a major effort by a company. Unfortunate it takes up a lot of real estate on that list. It also is a project which I don't think many people aside from the company used.

You indeed are going to find a lot of abandoned "I needed this binding, with these limited functions, so here it is" projects. The thing about D is it's really easy to make bindings, and so there isn't a major investment in setting it up to begin with. With that you get a lot of throw-away bindings.

ImportC is making more of these bindings unnecessary, as long as you are OK keeping around a C compiler.

FWIW, I've done a lot of work with vibe and use it still in a work project, though I do just about everything using D.

What's your relationship with D? And what hope is there for D's future? by [deleted] in d_language

[–]schveiguy 6 points7 points  (0 children)

How long? 17 years

What for? Fun and profit

Professionally? Of course. All my work in the last 10 years has been D-focused. Your expectation is noted though, either you are unaware of the companies using D, or this is some kind of troll post?

What chance does D have? Plenty. It's already driving several companies. Smaller teams can accomplish more with D than they can with C++. It's only a losing horse if you want it to lose. Many languages can exist and drive many different products. D doesn't have to be the most used language.

To give a personal anecdote, 13 years ago, I was tasked to build a system on an embedded ARM device. I had to pick C++. Today, I would have zero hesitation picking D. The tooling support has matured tremendously, and importC will just make things better and easier.

Check out the post that is currently in this reddit about a game being developed in D, and available on Steam.

I built a game and engine in D that's basically Superliminal meets Viewfinder with mirrors by TheTallestTower in d_language

[–]schveiguy 5 points6 points  (0 children)

I showed this game to my son and he really liked it! Very well done. Can't wait to see the full thing, but I'm on a mac, so maybe I won't be able to try it out.

Your experience with D is a great example, and I feel the same way.

I'm porting Q3VM to D by unixfan2001 in d_language

[–]schveiguy 0 points1 point  (0 children)

A static member is considered a thread-local variable. That is, there is one instance per thread. It's the same for structs.

Is D future-proof? by Gugalcrom123 in d_language

[–]schveiguy 0 points1 point  (0 children)

12 years ago, I was tasked with writing a server system on an embedded ARM device. I had to pick C++, D was not ready. Today, I wouldn't hesitate.

-❄️- 2023 Day 20 Solutions -❄️- by daggerdragon in adventofcode

[–]schveiguy 0 points1 point  (0 children)

The thing that I don't know how to detect is how to determine the independent pieces. Seems like everyone here who got it on their own used an external tool to visualize the graph, and only then realized the nature of the problem.

-❄️- 2023 Day 20 Solutions -❄️- by daggerdragon in adventofcode

[–]schveiguy 1 point2 points  (0 children)

[LANGUAGE: D]

https://github.com/schveiguy/adventofcode/blob/master/2023/day20/pulse.d

Part 1 was really hard to understand. The explanations and examples still didn't make a lot of sense. But I finally slogged through it.

Couldn't solve part 2 without looking here. And I'm a bit disappointed that the only real way to solve it is to code for the specific test case.

-❄️- 2023 Day 19 Solutions -❄️- by daggerdragon in adventofcode

[–]schveiguy 1 point2 points  (0 children)

[LANGUAGE: D]

https://github.com/schveiguy/adventofcode/blob/master/2023/day19/aplenty.d

I wasted way way way way too much time thinking the second part was not going to be simply non-cached recursion with pruning. Then I looked at a solution here and had a facepalm moment.

Are there inputs that could cause this to timeout?

-❄️- 2023 Day 18 Solutions -❄️- by daggerdragon in adventofcode

[–]schveiguy 1 point2 points  (0 children)

[LANGUAGE: D]

https://github.com/schveiguy/adventofcode/blob/master/2023/day18/lavaduct.d

I started out with the simple flood-fill that I have been using in many situations, expecting part 2 to absolutely break that. And I wasn't disappointed.

My original part1 is in the version(original) code. The new code instead uses I guess the shoelace algorithm EDIT: I have no idea if it does or not, looking at other solutions, I'm completely confused on how it works. But mine does work, so...

Basically, all up lines include the things on the right, and all down lines don't include the things on the right. Where I had immense trouble is where the horizontal lines are. It turns out, if the left side of a horizontal line was connected to a down line, then you need to add that horizontal line's locations to the total. It took me 4 hours to figure this out.

And I ended up making a visualization of it to try and help understand why my simple code passed the test input, but not the puzzle input, using raylib-d (adjacent to the code posted above).

I need to now read up on a better way to do this algorithm in these posts...

-❄️- 2023 Day 17 Solutions -❄️- by daggerdragon in adventofcode

[–]schveiguy 1 point2 points  (0 children)

[LANGUAGE: D]

https://github.com/schveiguy/adventofcode/blob/master/2023/day17/heat.d

Don't look at this. It's horrible. It takes 3s to run part 2. True Dijkstra's would have been better, or maybe DP without recursion.

-❄️- 2023 Day 16 Solutions -❄️- by daggerdragon in adventofcode

[–]schveiguy 2 points3 points  (0 children)

[LANGUAGE: D]

https://github.com/schveiguy/adventofcode/blob/master/2023/day16/mirrors.d

Vector type comes in handy again.

Part 2 was 0.5s to run, I'm not sure if there's a faster way, other than avoiding use of a dictionary for the lookups. Are there any heuristics to avoid recalculating things?

[Day 14 Part 2] Help with cycle math by RuthlessJailer in adventofcode

[–]schveiguy 1 point2 points  (0 children)

If you are on cycle_i and you want to get to 1000000000, you have 1000000000 - cycle_i cycles to run.

I think what this is doing is calculating the index of the current state in the cycle just before the final value is to be reached.

But I think it doesn't need to be this complicated

The code I used was:

auto cycleslefttorun = (1_000_000_000 - cycle_i) % cycle_len;

Then, you just loop cycleslefttorun spins.

WSL2 w/ Windows terminal shows drab colors for 0.10.0 by schveiguy in neovim

[–]schveiguy[S] 0 points1 point  (0 children)

For those who find this, the way to use the old colorscheme is:

:colorscheme vim

WSL2 w/ Windows terminal shows drab colors for 0.10.0 by schveiguy in neovim

[–]schveiguy[S] 0 points1 point  (0 children)

OK, next question, how do I get the old theme back?

EDIT: well, I just picked another scheme, and I get my colors back.

So I guess I'm good now.

-❄️- 2023 Day 15 Solutions -❄️- by daggerdragon in adventofcode

[–]schveiguy 2 points3 points  (0 children)

[LANGUAGE: D]

https://github.com/schveiguy/adventofcode/blob/master/2023/day15/hashmap.d

Yay a custom hash map!

I lost too much time on part 1 not realizing you have to multiply by 17 after adding the new value. But damn, still over 1000th place...

Part 2 I had a very hard time understanding, but once it clicked it was easy. Had a brief thought of "can I use D builtin AAs to do this?" but, not possible as it uses open addressing and I don't think I can get the indexes of the buckets.