Re: Social chat in the forums

2021-08-01 Thread Brian Tiffin via Digitalmars-d-learn

On Sunday, 1 August 2021 at 21:35:05 UTC, rikki cattermole wrote:

On 02/08/2021 9:19 AM, Brian Tiffin wrote:
Question, or suggestion.  In the Community forums, there is 
General and Announce.


Announce is only for announcements.

General is used sometimes for OT stuff, like I've congratulated 
Andrei on the birth of one of his kids (I asked prior). Or some 
stuff about COVID preparation.


Where is the preferred place to *shoot the breeze*?  D 
adjacent, but off-topic and mostly social (with the 
*desirable* assumption that the audience is all D programmers 
and openly nerd minded).


Generally speaking, not here.

You might want to try Discord instead, long term searchable and 
we do have an off topic channel that has been used for 
discussions about things like electrical engineering. Although 
we do try to discourage stuff like political discussion in 
there due to the potential conflict it can create.


Thanks, rikki.

Yeah, I guess it's Discord then.  I joined a group there a while 
back (Hercules mainframe emulation of old MVS and VM/370) and 
have figured out most of the settings to turn off the incessant 
flashing, beeping, and utter distractions to peripheral vision 
and perceptions; so, ok (typed in a remorseful sad face defeated 
mode).  ;-)


Have good.


Re: Social chat in the forums

2021-08-01 Thread rikki cattermole via Digitalmars-d-learn

On 02/08/2021 9:19 AM, Brian Tiffin wrote:
Question, or suggestion.  In the Community forums, there is General and 
Announce.


Announce is only for announcements.

General is used sometimes for OT stuff, like I've congratulated Andrei 
on the birth of one of his kids (I asked prior). Or some stuff about 
COVID preparation.


Where is the preferred place to *shoot the breeze*?  D adjacent, but 
off-topic and mostly social (with the *desirable* assumption that the 
audience is all D programmers and openly nerd minded).


Generally speaking, not here.

You might want to try Discord instead, long term searchable and we do 
have an off topic channel that has been used for discussions about 
things like electrical engineering. Although we do try to discourage 
stuff like political discussion in there due to the potential conflict 
it can create.


Social chat in the forums

2021-08-01 Thread Brian Tiffin via Digitalmars-d-learn
Question, or suggestion.  In the Community forums, there is 
General and Announce.


Where is the preferred place to *shoot the breeze*?  D adjacent, 
but off-topic and mostly social (with the *desirable* assumption 
that the audience is all D programmers and openly nerd minded).


Within the forums that is, for the threads and being searchable 
in the near and far future.


Have good, make well.


Re: Registering-unregistering threads

2021-08-01 Thread WebFreak001 via Digitalmars-d-learn

On Friday, 30 July 2021 at 23:48:41 UTC, solidstate1991 wrote:
I'm doing some audio-related work, and one thing I need is to 
unregister from (and maybe later temporarily re-register to) 
the GC, since it would cause some issues, and it would be nice 
if I still could use the GC during disk operations, etc.


Info on it is quite scarce and a bit confusing. If I unregister 
from the RT, will that mean it'll be GC independent, or will 
have other consequences too?


There is an idiom on d-idioms that probably fits what you needs: 
https://p0nce.github.io/d-idioms/#The-impossible-real-time-thread


Additional documentation:
- 
https://github.com/dlang/druntime/blob/c3a4c51773e88c68dc3efa73335befdb74d17242/src/core/thread/threadbase.d#L827
- 
https://github.com/dlang/druntime/blob/078cb3cdafda875a9893574fc53437908f3dfd26/src/core/thread/osthread.d#L1267


Re: GREETINGS FROM iSTANBUL

2021-08-01 Thread Salih Dincer via Digitalmars-d-learn

On Sunday, 1 August 2021 at 18:22:05 UTC, Paul Backus wrote:


A common solution to this in other languages is to have a 
version of toUpper that takes a locale as an argument. Some 
examples:


- Javascript: 
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/toLocaleUpperCase


I did not know that; exactly that I want to talk about.  So clean 
code...


Thank you Paul.


Re: GREETINGS FROM iSTANBUL

2021-08-01 Thread Salih Dincer via Digitalmars-d-learn

On Sunday, 1 August 2021 at 18:22:05 UTC, Paul Backus wrote:
On Sunday, 1 August 2021 at 17:56:00 UTC, rikki cattermole 
wrote:

It appears you are using the wrong lowercase character.


I think so too, here's the proof:
```d
import std.string, std.stdio;

void main()
{
  auto istanbul = "\u0131stanbul";
  enum capitalized = "Istanbul";
  assert(istanbul.capitalize == capitalized);
  assert("istanbul".capitalize == capitalized);
}
```
Different characters but same and seamless results...


Re: GREETINGS FROM iSTANBUL

2021-08-01 Thread Paul Backus via Digitalmars-d-learn

On Sunday, 1 August 2021 at 17:56:00 UTC, rikki cattermole wrote:

It appears you are using the wrong lowercase character.

https://en.wikipedia.org/wiki/Dotted_and_dotless_I

From a quick experiment, it appears std.uni is treating the 
upper case dotted I's lower case as a grapheme. Which it 
probably shouldn't be as there is an actual character for that.


We might need to update our unicode database... or something.


It's not the wrong lower-case character. Turkish uses U+0069 
(a.k.a. ASCII 'i') for lower-case dotted I, but has a non-default 
case mapping that pairs U+0069 with U+0130 ('İ') rather than 
U+0049 (ASCII 'I'). Phobos' std.uni uses the default case mapping 
for its toUpper function, so it does not produce the correct 
result for Turkish text.


Source: https://www.unicode.org/faq/casemap_charprop.html#1

A common solution to this in other languages is to have a version 
of toUpper that takes a locale as an argument. Some examples:


- Javascript: 
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/toLocaleUpperCase

- Go: https://pkg.go.dev/strings#ToUpperSpecial
- Java: 
https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/String.html#toUpperCase(java.util.Locale)
- C#: 
https://docs.microsoft.com/en-US/dotnet/api/system.string.toupper?view=net-5.0


Re: Two major problems with dub

2021-08-01 Thread rikki cattermole via Digitalmars-d-learn



On 02/08/2021 5:18 AM, Alain De Vos wrote:
A simple and small wrapper around for instance the C-library libpq 
should be part of the language itself and should not pull in more than 
libpq itself.


Just so that we are all using the same terminology.

A binding defines the functions and types as per the external libraries 
headers.
It may be dynamically loaded and require a loader also, there is no 
bloat for this.


A wrapper uses a binding but makes it more D friendly or even @safe. I 
think based upon your description that you are looking for a binding not 
a wrapper.


The only binding I could find was derelictpq which hasn't been updated 
to bindbc (not that it should matter too much). 
https://github.com/DerelictOrg/DerelictPQ


Re: GREETINGS FROM iSTANBUL

2021-08-01 Thread rikki cattermole via Digitalmars-d-learn

It appears you are using the wrong lowercase character.

https://en.wikipedia.org/wiki/Dotted_and_dotless_I

From a quick experiment, it appears std.uni is treating the upper case 
dotted I's lower case as a grapheme. Which it probably shouldn't be as 
there is an actual character for that.


We might need to update our unicode database... or something.


Re: Two major problems with dub

2021-08-01 Thread evilrat via Digitalmars-d-learn

On Sunday, 1 August 2021 at 17:25:26 UTC, Alain De Vos wrote:

A simple example, dub package dpq2 pulls in,
money,vide-d,stdx-allocator,derelict-pq,derelict-util
This all for a handfull of C-functions.


let's see

Money - fits pretty ok, cause your average SQL has decimal type 
for that purpose but there is no built-in one in D


vibe-d - probably because it handles DB connection and/or keep 
things async way, sure you probably can do it with Phobos but it 
will be much more PITA and less performant


stdx-allocator - memory management, and it is also possible to 
reduce GC pauses it is probably uses malloc'ed buffers


derelict-pg - C API wrapper for PostgreSQL

derelict-util - handles function pointers loading for that wrapper


That's it. Why do you think this is bloat? You know, D coders are 
very careful when it comes to using dependencies, it's not like 
in JS where shit got imported just because it exists, so I don't 
get your complains on that.


Re: Two major problems with dub

2021-08-01 Thread Paul Backus via Digitalmars-d-learn

On Sunday, 1 August 2021 at 17:18:39 UTC, Alain De Vos wrote:
A simple and small wrapper around for instance the C-library 
libpq should be part of the language itself and should not pull 
in more than libpq itself.


I don't disagree. The question is, who will volunteer to create 
and maintain this wrapper?


Re: Two major problems with dub

2021-08-01 Thread Alain De Vos via Digitalmars-d-learn

A simple example, dub package dpq2 pulls in,
money,vide-d,stdx-allocator,derelict-pq,derelict-util
This all for a handfull of C-functions.


Re: Two major problems with dub

2021-08-01 Thread Adam D Ruppe via Digitalmars-d-learn

On Sunday, 1 August 2021 at 17:18:39 UTC, Alain De Vos wrote:
A simple and small wrapper around for instance the C-library 
libpq should be part of the language itself and should not pull 
in more than libpq itself.


i have one of those in two files: database.d for the interface 
and postgres.d for the impl found in here 
https://github.com/adamdruppe/arsd


are you suggesting some kind of mandatory review to be featured 
on dub? that might not be a bad idea actually.


Re: Two major problems with dub

2021-08-01 Thread Alain De Vos via Digitalmars-d-learn
A simple and small wrapper around for instance the C-library 
libpq should be part of the language itself and should not pull 
in more than libpq itself.


Re: Two major problems with dub

2021-08-01 Thread Paul Backus via Digitalmars-d-learn

On Sunday, 1 August 2021 at 15:38:32 UTC, Alain De Vos wrote:

Dub has two big problems.
1. Unmaintained dub stuff.
2. Let's say you need bindings to postgresql library and you 
will see dub pulling in numerous of libraries, which have 
nothing at all to do with postgresql.
More like a framework stuff. This creates unneeded complexity, 
bloatware, dependency hell, maintainability, in my humble 
opinion. Dub should do one thing and do it good.

Feel free to elaborate.


It seems to me like these are not really problems with the dub 
package manager or the dub archive itself, but with the quality 
of individual packages.


There is a community-maintained list of high-quality D resources 
(including dub packages) available on github:


https://github.com/dlang-community/awesome-d

Ideally, something like this would be integrated into 
code.dlang.org itself, so that users could see at a glance which 
packages are considered high-quality by the D community.


Re: Two major problems with dub

2021-08-01 Thread evilrat via Digitalmars-d-learn

On Sunday, 1 August 2021 at 15:38:32 UTC, Alain De Vos wrote:
2. Let's say you need bindings to postgresql library and you 
will see dub pulling in numerous of libraries, which have 
nothing at all to do with postgresql.
More like a framework stuff. This creates unneeded complexity, 
bloatware, dependency hell, maintainability, in my humble 
opinion. Dub should do one thing and do it good.

Feel free to elaborate.


Wait, you don't use isOdd package in your frontend? No way...

(also for that "bloat" part, this is where the linker comes in 
and strips it all, unless you are talking about accidentally 
added dependencies on "just in case" basis which is a sign of 
design issues)


Re: Two major problems with dub

2021-08-01 Thread Alain De Vos via Digitalmars-d-learn

Is there a security review for dub packages ?


Two major problems with dub

2021-08-01 Thread Alain De Vos via Digitalmars-d-learn

Dub has two big problems.
1. Unmaintained dub stuff.
2. Let's say you need bindings to postgresql library and you will 
see dub pulling in numerous of libraries, which have nothing at 
all to do with postgresql.
More like a framework stuff. This creates unneeded complexity, 
bloatware, dependency hell, maintainability, in my humble 
opinion. Dub should do one thing and do it good.

Feel free to elaborate.


GREETINGS FROM iSTANBUL

2021-08-01 Thread Salih Dincer via Digitalmars-d-learn

Greetings from istanbul...

In our language, the capital letter 'i' is used, similar to the 
lower case.  But in this example:

```d
// D 2.0.83

import std.stdio, std.uni;

void main()
{
  auto message = "Greetings from istanbul"d;

  message.asUpperCase.writeln; // GREETINGS FROM ISTANBUL

  /* D is very talented at this,
   * except for one letter: 'i'
   * ref: https://en.m.wikipedia.org/wiki/Istanbul
   */
}
```
I've to code a custom solution.  Is it possible to solve the 
problem from within std.uni?


We are discussing the issue in our own community.  I also saw: 
https://forum.dlang.org/post/vxnnykllgxsghllud...@forum.dlang.org


Thanks...