Re: How do I display unicode characters in D on standard (english) Windows 10 console window?

2019-07-30 Thread Martin Krejcirik via Digitalmars-d-learn
On Monday, 29 July 2019 at 22:31:01 UTC, kinke wrote: Switching the console code page to UTF-8, and then restoring the original one before termination. See https://github.com/ldc-developers/ldc/pull/3086/commits/5915534530fa095e7e5d58bcfb4ad100d249bbca#diff-c59e7716a40a08ce42f141c738f2c311. You

Re: How to debug long-lived D program memory usage?

2019-04-17 Thread Martin Krejcirik via Digitalmars-d-learn
On Wednesday, 17 April 2019 at 16:27:02 UTC, Adam D. Ruppe wrote: Each individual process eats ~30-100 MB, but that times 60 = trouble. They start off small, like 5 MB, and grow over weeks or months, so it isn't something I can easily isolate in a Do you run GC.minimize ?

Re: how to localize console and GUI apps in Windows

2018-01-03 Thread Martin Krejcirik via Digitalmars-d-learn
On Friday, 29 December 2017 at 11:14:39 UTC, zabruk70 wrote: AFAIK, Windows GUI have no ANSI/OEM problem. You can use Unicode. Be advised there are some problems with console UTF-8 input/output in Windows. The most usable is Win10 new console window but I recommend to use Windows API

Re: GDB behaves strange with DMD

2017-07-07 Thread Martin Krejcirik via Digitalmars-d-debugger
Dne 4. 7. 2017 v 13:46 Gorthad napsal(a): As you see, GDB seems to have wrong info about line numbers. This is acually a regression since 2.072. I'll file a bug report. -- mk

regressions

2017-06-30 Thread Martin Krejcirik via Digitalmars-d
DMD, Phobos and Druntime open regressions over time: http://bid.iline.cz/~mk/tmp/regs.png Used to be stable, but seems to be getting worse since 2016.

Re: The program exits unexpectedly

2016-12-09 Thread Martin Krejcirik via Digitalmars-d-learn
On Friday, 9 December 2016 at 16:50:05 UTC, unDEFER wrote: And in mini program it works and shows diagnostic message. Where my diagnostic message in more complicate program??? Try redirecting stdout and stderr to a file(s). There are cases when the console itself can crash.

Re: About debugging (again)

2016-10-17 Thread Martin Krejcirik via Digitalmars-d-learn
On Monday, 17 October 2016 at 15:45:56 UTC, ANtlord wrote: GDB 7.7.1 Use latest GDB, 7.10 has got much better D support.

Re: Old bugs

2016-10-16 Thread Martin Krejcirik via Digitalmars-d
Digital Mars C++ bug reports can be filed here: http://bugzilla.digitalmars.com/issues/ It's awfully slow.

Re: Old bugs

2016-10-14 Thread Martin Krejcirik via Digitalmars-d
I'm not sure we should be documenting bugs in C standard library implementation internals. Users just don't expect broken console output. There should be a note in writeln docs.

Re: Old bugs

2016-10-13 Thread Martin Krejcirik via Digitalmars-d
For example, https://issues.dlang.org/show_bug.cgi?id=1448 should be addressable. Either we should provide a translation function for outputting things and recommend it, or document that codepages that D runs on Windows etc - there's got to be a What is IMHO needed to fix this bug, is to add

Re: Any relation?

2016-10-12 Thread Martin Krejcirik via Digitalmars-d
Then maybe this isn't photoshopped: https://twitter.com/stamcd/status/742563964656062464 Why would be ? It's a screenshot from Forza Motorsport game.

Re: Any relation?

2016-10-11 Thread Martin Krejcirik via Digitalmars-d
On Tuesday, 11 October 2016 at 18:13:53 UTC, Andrei Alexandrescu wrote: http://indianautosblog.com/2016/10/most-powerful-suzuki-swift-produces-350-hp-25 -- Andrei There is no Kenji Hara in the team, so I would say no :)

Re: How to correctly display accented characters at the Windows prompt?

2016-10-10 Thread Martin Krejcirik via Digitalmars-d-learn
Windows. You can try command cp 65001 in the console window chcp 65001

Re: How to correctly display accented characters at the Windows prompt?

2016-10-10 Thread Martin Krejcirik via Digitalmars-d-learn
On Monday, 10 October 2016 at 19:31:14 UTC, Cleverson Casarin Uliana wrote: Hi Martin, indeed, here in my workplace Windows machine there is no "CP_UTF_8" codepage, nor there is 65001. I was waiting to codepage 65001 (UTF8) should be available on all modern Windows. You can try command cp

Re: How to correctly display accented characters at the Windows prompt?

2016-10-10 Thread Martin Krejcirik via Digitalmars-d-learn
Thanks, Cleverson Call SetConsoleOutputCP(CP_UTF8). No, this may appear to to work, but in reality, it's broken. The only reliable way is to convert to the native windows codepage.

Re: Beta 2.072.0-b1

2016-10-02 Thread Martin Krejcirik via Digitalmars-d-announce
https://issues.dlang.org/show_bug.cgi?id=16578

Re: Diet-NG 1.0.0 released

2016-09-28 Thread Martin Krejcirik via Digitalmars-d-announce
Sönke, I am your biggest fan, but you never reply me. Hm, definitely sorry about that! I miss a certain percentage of issues/forum messages these days because of the limited time I have left for processing them. But if you have a link, I'll try to reply ASAP! Is this guy a bot ? Seems so

Re: Mysql-native with LAMPP

2016-09-12 Thread Martin Krejcirik via Digitalmars-d-learn
# netstat -npl | grep mysql unix 2 [ ACC ] STREAM LISTENING 239449 6293/mysqld /opt/lampp/var/mysql/mysql.sock Mysql defaults to unix socket, you need to add bind-address=127.0.0.1 to my.cnf [mysqld] section.

Re: Horrible DMD startup performance on Windows

2016-05-31 Thread Martin Krejcirik via Digitalmars-d
On Tuesday, 31 May 2016 at 18:13:05 UTC, Bruno Medeiros wrote: performance on Windows has become horrible. Takes over 3 seconds on my machine just to display the version. Doesn't happen to me. I doubt the problem is in dmd itself. Maybe deep path search, antivirus, or something like that ?

Re: Killing the comma operator

2016-05-10 Thread Martin Krejcirik via Digitalmars-d
I'd prefer just adding a warning where appropriate.

Re: Windows vs UTF-8 (issue 15845)

2016-04-03 Thread Martin Krejcirik via Digitalmars-d
Dne 4. 4. 2016 v 2:22 Adam D. Ruppe napsal(a): On Monday, 4 April 2016 at 00:08:54 UTC, Martin Krejcirik wrote: Probably not, it dont't work with pipes. Oh well ... It is easy to detect that though and branch accordingly. I think it not woth it. If Phobos just converted automatically from

Re: Windows vs UTF-8 (issue 15845)

2016-04-03 Thread Martin Krejcirik via Digitalmars-d
Dne 4. 4. 2016 v 2:03 Adam D. Ruppe napsal(a): ReadConsoleW works fine though in all my attempts, we should prolly just change the library to use it. Probably not, it dont't work with pipes. Oh well ... -- mk

Re: Windows vs UTF-8 (issue 15845)

2016-04-03 Thread Martin Krejcirik via Digitalmars-d
Dne 4. 4. 2016 v 0:52 ag0aep6g napsal(a): reading UTF-8 is broken in Windows and there's no workaround, then issue 15845 can't be fixed, and we should stop telling people to use `chcp 65001` (and don't forget to change the font). I think ReadConsole and WriteConsole API functions work with

Re: Windows vs UTF-8 (issue 15845)

2016-04-03 Thread Martin Krejcirik via Digitalmars-d
Dne 4. 4. 2016 v 0:11 ag0aep6g napsal(a): On 04.04.2016 00:07, Martin Krejcirik wrote: I'm under the impression that ReadFile is a Windows API function. Is that not so? If it isn't, what is the corresponding Windows API function? Sorry, I missed that in your post. Anyway, after years of

Re: Windows vs UTF-8 (issue 15845)

2016-04-03 Thread Martin Krejcirik via Digitalmars-d
And convert to non-unicode codepage (OEMCP) ...

Re: Windows vs UTF-8 (issue 15845)

2016-04-03 Thread Martin Krejcirik via Digitalmars-d
On Sunday, 3 April 2016 at 21:55:39 UTC, ag0aep6g wrote: Does this make sense to anyone? Using UTF8 console via C api is broken in many ways on Windows. The problem is in C library. The only sensible way is to use Windows API. Related issues: https://issues.dlang.org/show_bug.cgi?id=1448

Re: Running DMD tests on Windows / build requirements

2016-02-21 Thread Martin Krejcirik via Digitalmars-d
Dne 21. 2. 2016 v 17:56 kinke napsal(a): > Anyway, the latest linking errors are due to some heavy changes in > Microsoft's C runtime with VS 2015. Phobos v2.068 doesn't support it > yet, so you may want to try the latest version instead. Thanks, you are right, 2.070 works. No other changes

Re: Running DMD tests on Windows / build requirements

2016-02-21 Thread Martin Krejcirik via Digitalmars-d
Dne 21. 2. 2016 v 15:56 Nick Sabalausky napsal(a): > I don't know whether MSVC works, but the traditional way to compile the > C++ parts on Windows is using the Digital Mars C++ compiler, DMC. So > even if MSVC doesn't work, DMC definitely should. To by more precise: I need a receipe, how to

Re: Running DMD tests on Windows / build requirements

2016-02-21 Thread Martin Krejcirik via Digitalmars-d
Dne 21. 2. 2016 v 15:56 Nick Sabalausky napsal(a): > On 02/19/2016 07:25 PM, Martin Krejcirik wrote: > Unless things have changed since I last looked, DMD's Windows makefiles > are written for Digital Mars Make, not gmake. The gmake makefiles are Unfortunately, there is just one Makefile in the

Re: Running DMD tests on Windows / build requirements

2016-02-20 Thread Martin Krejcirik via Digitalmars-d
Dne 20. 2. 2016 v 13:40 kinke napsal(a): > You may want to have a look at > http://wiki.dlang.org/Building_and_hacking_LDC_on_Windows_using_MSVC#Running_the_dmd-testsuite_tests > for some tools prerequisites. I have gnu make, but it doesn't work: D:\prac4\dmd\test>make -f Makefile Creating

Running DMD tests on Windows / build requirements

2016-02-19 Thread Martin Krejcirik via Digitalmars-d
How do I run DMD tests on Windows ? I'm not able to, even with gmake. Also, is it possible to compile DMD with MSVC ? And third question, what are the minimal (by size, not by version) VS/VC/SDK requirements to compile Phobos with -m64 and -m32mscoff ? Currently I have installed MS Visual C++

SList and DList init doesn't work in global variable

2015-09-28 Thread Martin Krejcirik via Digitalmars-d-learn
Is this intended or known issue ? It works with 2.066. SList!int gslist = [1,2,3,4,5,6]; // broken since 2.067 // Error: reinterpreting cast from NodeWithoutPayload* to Node* is not supported in CTFE DList!int gdlist = [1,2,3,4,5,6]; // broken since 2.067 // Error: non-constant expression ...

Re: Debugging D shared libraries

2015-09-20 Thread Martin Krejcirik via Digitalmars-d-learn
Dne 19. 9. 2015 v 18:41 Russel Winder via Digitalmars-d-learn napsal(a): > Indeed, it works well. Well for LDC. DMD and GDC are still broken. My > GDC problems are deeper that this code: Debian packages seem to have > weird problems and Fedora do not package GDC. All I need to do to make your

Re: Identifying and dealing with deprecated/removed language features

2015-09-20 Thread Martin Krejcirik via Digitalmars-d-learn
Dne 20. 9. 2015 v 11:55 Jacob Carlborg napsal(a): > I guess I can use __traits(compiles) to check if typedef and then insert > the "static if" with a string mixing. But is there a better way to do this? __VERSION__ ? -- mk

Re: foreach(line; f.byLine) produces core.exception.InvalidMemoryOperationError@(0) in 2.067 but not 2.066

2015-09-15 Thread Martin Krejcirik via Digitalmars-d-learn
For reference, it was this PR: https://github.com/D-Programming-Language/phobos/pull/3089 which fixed the same issue for me.

Re: foreach(line; f.byLine) produces core.exception.InvalidMemoryOperationError@(0) in 2.067 but not 2.066

2015-09-15 Thread Martin Krejcirik via Digitalmars-d-learn
On Tuesday, 15 September 2015 at 15:28:23 UTC, Andrew Brown wrote: A very naive question: would it be possible in this case to backport it into gdc/ldc by copying the pull request and building the compiler from source, or would this get me into a world of pain? Cherry-picking should work and

Re: foreach(line; f.byLine) produces core.exception.InvalidMemoryOperationError@(0) in 2.067 but not 2.066

2015-09-15 Thread Martin Krejcirik via Digitalmars-d-learn
On Tuesday, 15 September 2015 at 13:56:37 UTC, Andrwe Brown wrote: I'm trying to read a file line by line, and I get a core.exception.InvalidMemoryOperationError@(0), even after https://issues.dlang.org/show_bug.cgi?id=13856 Try DMD 2.068, it has got fixed byLine implementation.

Re: dmd makes D appear slow

2015-05-29 Thread Martin Krejcirik via Digitalmars-d
IMHO all what is needed is to update the download page with some description of deferences between the compilers, like: dmd - reference compiler, Digital Mars backend - best for latest dlang features, fast compile times gdc - GNU gcc backend based compiler - best for portability and

Re: Phobos master broken ?

2015-05-05 Thread Martin Krejcirik via Digitalmars-d
I think I read something (bugzilla issue, source comment, ...) that hinted at libc having to do with it, but I can't find it now. But CentOS 6's libc is indeed behind that of my usual Ubuntu 14.10 (2.12 vs 2.19). Yeah, upgrading Debian from wheezy to jessie solved the issue.

Phobos master broken ?

2015-05-04 Thread Martin Krejcirik via Digitalmars-d
I can't seem to build phobos master on linux, unless I revert pull #3014 unittests DMD v2.067-devel-b9dee9e DEBUG std/math.d(2702): Error: number '0x1p-1024' is not representable std/math.d(2705): Error: number '0x1p-1024' is not representable std/math.d(2708): Error: number '0x1p-1024' is not

Re: Phobos master broken ?

2015-05-04 Thread Martin Krejcirik via Digitalmars-d
You list DMD v2.067-devel-b9dee9e DEBUG. Does that mean that you're not using the latest dmd? Make sure that you're using I've tried making a fresh clone of dmd, druntime, phobos on a different computer, compiling: make -f posix.mak MODEL=32 Still the same error. I've no problem compiling

Re: Phobos master broken ?

2015-05-04 Thread Martin Krejcirik via Digitalmars-d
You might need to put DMD=path/to/dmd in front of make and give it the path to the dmd from master so that it uses that rather than the one installed on your system. It picks up dmd from ../dmd/src by default, making it explicit makes no difference. I've tried 2.067.1 binary too.

Re: switch case expressions

2015-04-23 Thread Martin Krejcirik via Digitalmars-d
https://github.com/D-Programming-Language/dmd/pull/2887 Ugh... at the VERY LEAST, the error message should be fixed, as can't be read at compile time is clearly not the issue. Looks like this issue surfaces periodically. Somehow I've missed it so far. Anyway, either the spec is wrong or

switch case expressions

2015-04-23 Thread Martin Krejcirik via Digitalmars-d
void main(string[] args) { int a = 1; int b = to!int(args[1]); uint c = 2; switch (a) { case b: break; // OK case c: break; // Error: variable c cannot be read at compile time default: break; } } Switch spec says: The case expressions must all

Re: Reminder, use stable branches for important bug fixes

2015-04-12 Thread Martin Krejcirik via Digitalmars-d
On Friday, 10 April 2015 at 22:55:19 UTC, Martin Nowak wrote: A small reminder, as the next point release isn't that far away, we're now using stable branches to incorporate important bug fixes. Stable is broken on autotester.

Re: The dmd.conf rant

2015-04-01 Thread Martin Krejcirik via Digitalmars-d
On Wednesday, 1 April 2015 at 02:29:05 UTC, Martin Nowak wrote: The lookup order for the config file should be changed to the following. - next to dmd binary (highest precedence so that I can have multiple installations) - per-user conf folder (HOME) (to override the system-wide config) -

Re: DMD compilation speed

2015-03-30 Thread Martin Krejcirik via Digitalmars-d
Here is one example: Orange d5b2e0127c67f50bd885ee43a7dd61dd418b1661 https://github.com/jacob-carlborg/orange.git make 2.065.0 real0m9.028s user0m7.972s sys 0m0.940s 2.066.1 real0m10.796s user0m9.629s sys 0m1.056s 2.067.0 real0m13.543s user0m12.097s sys

DMD compilation speed

2015-03-29 Thread Martin Krejcirik via Digitalmars-d
It seems like every DMD release makes compilation slower. This time I see 10.8s vs 7.8s on my little project. I know this is generally least of concern, and D1's lighting-fast times are long gone, but since Walter often claims D's superior compilation speeds, maybe some profiling is in order ?

Re: Novel list

2015-03-25 Thread Martin Krejcirik via Digitalmars-d
On Wednesday, 25 March 2015 at 12:01:15 UTC, wobbles wrote: The DOES POORLY AT... column is good reading here for how D could improve ( though some of the comments are stupid. D has an annoying syntax!?) doeas poorly at annoying syntax = not annoying syntax

Re: Incorrect display in Cyrillic Windows

2015-03-04 Thread Martin Krejcirik via Digitalmars-d-learn
On Wednesday, 4 March 2015 at 11:32:40 UTC, Dennis Ritchie wrote: Hi. It's normal for Windows? You have to set your console encoding to UTF-8 first. You can do it by command chcp 65001 or by calling Windows API function: extern(Windows) BOOL SetConsoleOutputCP( UINT ); SetConsoleOutputCP(

Re: Will D have a serious dedicated well supported IDE like Visual Studio or Eclipse?

2015-02-27 Thread Martin Krejcirik via Digitalmars-d-learn
On Friday, 27 February 2015 at 07:08:26 UTC, Ali Çehreli wrote: What version of gdb is needed and is that version easy to install? Something from late 2014 or newer is the best (7.8.50-cvs or 7.9.50-cvs) as it has got Ian's patches merged, but even an old stock Debian gdb (7.4.1) works

Re: @trust is an encapsulation method, not an escape

2015-02-06 Thread Martin Krejcirik via Digitalmars-d
If I understand it correctly, Walter is against adding trusted blocks (trusted {...}) into @safe functions. But what about having safe blocks in @trusted functions ? int somefunc() @trusted { int a = systemfunc(); int b; @safe { b = safefunc(); // calling systemfunc() not

Re: 2.067 should modify writeln function, make it display correctly ANSI characters in CMD. Exe

2015-01-25 Thread Martin Krejcirik via Digitalmars-d
Windows console is broken, I recommend using API functions (WriteConsole) instead.

Re: Czech D community

2015-01-25 Thread Martin Krejcirik via Digitalmars-d
Dne 25. 1. 2015 v 19:23 Daniel Kozak napsal(a): je tady nekdo z ceska? Vlastnim domenu dlang.cz a mam v planu tam rozchodit Zdar, to by bylo zasluzne. -- mk --- Tato zpráva byla zkontrolována na viry programem Avast Antivirus. http://www.avast.com

Re: forum.dlang.org is now using DCaptcha

2014-12-03 Thread Martin Krejcirik via Digitalmars-d-announce
For an idea of what sort of questions DCaptcha asks, you can demo it on the following page, so you don't have to clutter the I think all code fragments should have just one exact answer (like number or single word) a any programmer without specific D knowledge should be able to answer them

Re: assert semantic change proposal

2014-08-03 Thread Martin Krejcirik via Digitalmars-d
On 3.8.2014 21:47, David Bregman wrote: Walter has proposed a change to D's assert function as follows [1]: The compiler can make use of assert expressions to improve optimization, even in -release mode. Couldn't this new assert behaviour be introduced as a new optimization switch ? Say

Re: Open source Windows debugger

2014-07-27 Thread Martin Krejcirik via Digitalmars-d
On Sunday, 27 July 2014 at 20:50:14 UTC, francesco cattoglio wrote: Yep, I have to agree. Or well, probably it's good enough for Walter, but I would be utterly unable to debug even 50 lines of code with that :-P It should be usable, if you convert your debug information to PDB format using

Re: The Comma Operator's Deprecation Can't Come Soon Enough

2014-07-15 Thread Martin Krejcirik via Digitalmars-d
On Tuesday, 15 July 2014 at 08:01:40 UTC, Meta wrote: I'll give you a hint: the bug causes flattenedType!R to always returned uint. What is unexpected about that ?

Re: The Comma Operator's Deprecation Can't Come Soon Enough

2014-07-15 Thread Martin Krejcirik via Digitalmars-d
The reason for getting rid of it is because it's borderline useless. It causes more accidental bugs than it enables deliberate uses. I find the comma op useful somemtimes. This example shows absolutely nothing of comma wrongdoing. If anything, there could be a warning for passing signed

Re: The Comma Operator's Deprecation Can't Come Soon Enough

2014-07-15 Thread Martin Krejcirik via Digitalmars-d
Example? For loop with multiple variables and various one liners of questionable utility aside: import std.stdio; bool funk() { static int count; return ++count 1 ? true : false; } void main() { bool flag = false; if (flag funk) writeln(a); else if

Re: The Comma Operator's Deprecation Can't Come Soon Enough

2014-07-15 Thread Martin Krejcirik via Digitalmars-d
On Tuesday, 15 July 2014 at 18:50:08 UTC, John Colvin wrote: and not just because I don't like the comma. I'd say it's generally bad practice to hide that write to `flag` inside the You are right for the 'final' code, but the point of my example is, that I can move the flag to another if and

Re: What is the Go/NoGo gauge for releases?

2014-07-13 Thread Martin Krejcirik via Digitalmars-d
What is essential, is to keep fixing bugs _after_ the release, i.e. do point releases. It's shame we don't have one for 2.065 already. Part of the problem is tracking which bugs are actually affecting a release branch. Another is a need to backport later discovered bugs. IMHO all regressions

Re: Time to rename D to @D !?

2014-06-23 Thread Martin Krejcirik via Digitalmars-d
Plaese no.

Re: Why no contracts for release build?

2014-06-04 Thread Martin Krejcirik via Digitalmars-d
What I really want is a switch stable, which contains all safety relevant features like Contracts/Asserts and so on. But Just compile _without_ -release -debug -g -unittest options.

Re: Why no contracts for release build?

2014-06-04 Thread Martin Krejcirik via Digitalmars-d
On Wednesday, 4 June 2014 at 13:48:04 UTC, Andre wrote: I currently wonder what is included by adding no switch to DMD? default (no switch) = asserts, contracts, boundscheck=all -debug = include code marked with debug keyword -unittest = include unittests -g = include debug info -release = do

floating point conversion

2014-06-01 Thread Martin Krejcirik via Digitalmars-d-learn
import std.conv; void main() { float a = 1.23f; double b = to!float(1.23); assert (a == b); // ??? } Should the assert fail or not ? (Please reply without trying first). If your reply is yes, should assert (a == to!float(1.23)) fail or not ? I'm bringing this up, because dmd and

Re: floating point conversion

2014-06-01 Thread Martin Krejcirik via Digitalmars-d-learn
On 1.6.2014 14:45, bearophile wrote: It's a bad question. Generally to compare floating point values for equality use std.math.feqrel. So it's just a coincidence, that GDC, LDC x86 and also DMD x86_64 doesn't fail ? And this bug https://issues.dlang.org/show_bug.cgi?id=12831 should be marked

Re: floating point conversion

2014-06-01 Thread Martin Krejcirik via Digitalmars-d-learn
On 1.6.2014 16:42, Famous wrote: from string should be the same, exacly, always. Casting a float to double should be deterministic as well. void main() { float a = 1.234f; double b = 1.234; assert (a == cast(float) b); // fails in DMD x86, works in GDC, LDC } Maybe enhancement

Re: floating point conversion

2014-06-01 Thread Martin Krejcirik via Digitalmars-d-learn
On 1.6.2014 18:02, Famous wrote: This is different. The decimal 1.234 cannot be exacly represented as radix-2 floating-point number. In your example above, a and b are not equal. They are both approximations to 1.234 but the value of b is Still feels iffy to me. If you add: