www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - Exceptional News

reply "David Nadlinger" <see klickverbot.at> writes:
Looks like we are finally getting somewhere. :)

---
version (Windows) {} else static assert(false);
void main() {
     try {
     	throw new Exception("This exception...");
     } catch (Exception e) {
     	import std.stdio;
     	writeln(e.msg, " ... has been caught for you by ", 
__VENDOR__, ".");
     }
}
---
This exception... ... has been caught for you by LDC.
---

David
Feb 11 2013
next sibling parent Iain Buclaw <ibuclaw ubuntu.com> writes:
On 11 February 2013 13:00, David Nadlinger <see klickverbot.at> wrote:

 Looks like we are finally getting somewhere. :)

 ---
 version (Windows) {} else static assert(false);
 void main() {
     try {
         throw new Exception("This exception...");
     } catch (Exception e) {
         import std.stdio;
         writeln(e.msg, " ... has been caught for you by ", __VENDOR__,
 ".");
     }
 }
 ---
 This exception... ... has been caught for you by LDC.
 ---

 David
Rather amusing. :-) -- Iain Buclaw *(p < e ? p++ : p) = (c & 0x0f) + '0';
Feb 11 2013
prev sibling next sibling parent reply Andrei Alexandrescu <SeeWebsiteForEmail erdani.org> writes:
On 2/11/13 8:00 AM, David Nadlinger wrote:
 Looks like we are finally getting somewhere. :)

 ---
 version (Windows) {} else static assert(false);
 void main() {
 try {
 throw new Exception("This exception...");
 } catch (Exception e) {
 import std.stdio;
 writeln(e.msg, " ... has been caught for you by ", __VENDOR__, ".");
 }
 }
 ---
 This exception... ... has been caught for you by LDC.
 ---

 David
Awesome!!! Andrei
Feb 11 2013
parent reply Iain Buclaw <ibuclaw ubuntu.com> writes:
On 11 February 2013 13:29, Andrei Alexandrescu <
SeeWebsiteForEmail erdani.org> wrote:

 On 2/11/13 8:00 AM, David Nadlinger wrote:

 Looks like we are finally getting somewhere. :)

 ---
 version (Windows) {} else static assert(false);
 void main() {
 try {
 throw new Exception("This exception...");
 } catch (Exception e) {
 import std.stdio;
 writeln(e.msg, " ... has been caught for you by ", __VENDOR__, ".");
 }
 }
 ---
 This exception... ... has been caught for you by LDC.
 ---

 David
Awesome!!! Andrei
This feature has been around for some time (somewhere in lexer.c iirc) - have you really only just added LDC into it David? -- Iain Buclaw *(p < e ? p++ : p) = (c & 0x0f) + '0';
Feb 11 2013
parent "Jesse Phillips" <Jessekphillips+D gmail.com> writes:
On Monday, 11 February 2013 at 13:33:28 UTC, Iain Buclaw wrote:
 This feature has been around for some time (somewhere in 
 lexer.c iirc) -
 have you really only just added LDC into it David?
LLVM hasn't had support for Exceptions in Windows, Hence the begining version (Windows) {} else static assert(false);
Feb 14 2013
prev sibling next sibling parent =?UTF-8?B?U8O2bmtlIEx1ZHdpZw==?= <sludwig outerproduct.org> writes:
Am 11.02.2013 14:00, schrieb David Nadlinger:
 Looks like we are finally getting somewhere. :)
 
 ---
 version (Windows) {} else static assert(false);
 void main() {
     try {
         throw new Exception("This exception...");
     } catch (Exception e) {
         import std.stdio;
         writeln(e.msg, " ... has been caught for you by ", __VENDOR__, ".");
     }
 }
 ---
 This exception... ... has been caught for you by LDC.
 ---
 
 David
Great news! How is it implemented? SEH? Did LLVM get any recent additions in this area?
Feb 11 2013
prev sibling next sibling parent reply Dmitry Olshansky <dmitry.olsh gmail.com> writes:
11-Feb-2013 17:00, David Nadlinger пишет:
 Looks like we are finally getting somewhere. :)

 ---
 version (Windows) {} else static assert(false);
 void main() {
      try {
          throw new Exception("This exception...");
      } catch (Exception e) {
          import std.stdio;
          writeln(e.msg, " ... has been caught for you by ", __VENDOR__,
 ".");
      }
 }
 ---
 This exception... ... has been caught for you by LDC.
 ---
Nice one! There got to be size_t.sizeof printed somewhere ... :) -- Dmitry Olshansky
Feb 11 2013
parent "David Nadlinger" <see klickverbot.at> writes:
On Monday, 11 February 2013 at 17:19:16 UTC, Dmitry Olshansky 
wrote:
 Nice one!

 There got to be size_t.sizeof printed somewhere ... :)
It would be 4; MinGW for Win64 uses SEH, and LLVM still doesn't support that (although there is hope). David
Feb 14 2013
prev sibling parent reply Nick Sabalausky <SeeWebsiteToContactMe semitwist.com> writes:
On Mon, 11 Feb 2013 14:00:17 +0100
"David Nadlinger" <see klickverbot.at> wrote:

 Looks like we are finally getting somewhere. :)
 
 ---
 version (Windows) {} else static assert(false);
 void main() {
      try {
      	throw new Exception("This exception...");
      } catch (Exception e) {
      	import std.stdio;
      	writeln(e.msg, " ... has been caught for you by ", 
 __VENDOR__, ".");
      }
 }
 ---
 This exception... ... has been caught for you by LDC.
 ---
 
 David
I took my mind a minute to process the point of that ("Is __VENDOR__ a new thing? Is it something about nested exceptions? What's with the version(Windows)...?") ...and then my thoughts jumped straight to: Holy shit!! :) Fantastic news!
Feb 11 2013
parent reply "David Nadlinger" <see klickverbot.at> writes:
On Monday, 11 February 2013 at 21:50:35 UTC, Nick Sabalausky 
wrote:
 ...and then my thoughts jumped straight to: Holy shit!!

 :)

 Fantastic news!
Don't get too excited. ;) There is still a lot to do, several test cases/unit tests still fail (mainly FP precision and ABI related). But, yes, now there is a real chance of Windows being a "first-class target" for LDC in the near future. I would very much appreciate any help on crushing the remaining bugs (it's not rocket science), see http://wiki.dlang.org/Building_LDC_on_MinGW_x86 for build instructions. David
Feb 14 2013
next sibling parent reply "bearophile" <bearophileHUGS lycos.com> writes:
David Nadlinger:

 I would very much appreciate any help on crushing the remaining 
 bugs (it's not rocket science), see 
 http://wiki.dlang.org/Building_LDC_on_MinGW_x86 for build 
 instructions.
Why don't you create one zip or rar, that a user unpacks, adds a path, and tries the compiler? Bye, bearophile
Feb 14 2013
parent reply "David Nadlinger" <see klickverbot.at> writes:
On Thursday, 14 February 2013 at 23:19:38 UTC, bearophile wrote:
 David Nadlinger:

 I would very much appreciate any help on crushing the 
 remaining bugs (it's not rocket science), see 
 http://wiki.dlang.org/Building_LDC_on_MinGW_x86 for build 
 instructions.
Why don't you create one zip or rar, that a user unpacks, adds a path, and tries the compiler?
Because it's not ready for general consumption yet. For binary packages for the other platforms, see the last release announcement: http://forum.dlang.org/thread/yxklohfbaltbcdnkpnqw forum.dlang.org. David
Feb 14 2013
parent reply "bearophile" <bearophileHUGS lycos.com> writes:
David Nadlinger:

 Because it's not ready for general consumption yet.
If trying the compiler is so complex/hard/time consuming as it looks, I will probably not try it. And maybe other people will do the same. So it will take even more time to find its bugs. Bye, bearophile
Feb 14 2013
parent "David Nadlinger" <see klickverbot.at> writes:
On Friday, 15 February 2013 at 00:02:00 UTC, bearophile wrote:
 David Nadlinger:

 Because it's not ready for general consumption yet.
If trying the compiler is so complex/hard/time consuming as it looks, I will probably not try it. And maybe other people will do the same. So it will take even more time to find its bugs.
If you don't want to contribute to LDC development, you shouldn't try it on MinGW yet. Simple as that. When the test suite has turned green or near-green, we will of course release binary packages. David
Feb 14 2013
prev sibling next sibling parent Andrej Mitrovic <andrej.mitrovich gmail.com> writes:
On 2/14/13, David Nadlinger <see klickverbot.at> wrote:
 I would very much appreciate any help on crushing the remaining
 bugs (it's not rocket science), see
 http://wiki.dlang.org/Building_LDC_on_MinGW_x86 for build
 instructions.
I suppose I'll give this a try tonight. However these steps should really be part of a nice and simple D script that does this automatically. Only then can we be sure the instructions are up to date, + it will save time for potential contributors. If I get a working build done I'll try writing such a script. I'm eager to escape the wrath of Optlink on win32. :p
Feb 14 2013
prev sibling parent reply "jerro" <a a.com> writes:
 http://wiki.dlang.org/Building_LDC_on_MinGW_x86 for build 
 instructions.
It seems there is a bug in the MinGW TLS support patch linked from that page. This line: + DAG.getExternalSymbol("_tls_array"), getPointerTy()); should be + DAG.getExternalSymbol("_tls_array", getPointerTy()));
Feb 14 2013
parent "David Nadlinger" <see klickverbot.at> writes:
On Friday, 15 February 2013 at 02:41:47 UTC, jerro wrote:
 http://wiki.dlang.org/Building_LDC_on_MinGW_x86 for build 
 instructions.
It seems there is a bug in the MinGW TLS support patch linked from that page. This line: + DAG.getExternalSymbol("_tls_array"), getPointerTy()); should be + DAG.getExternalSymbol("_tls_array", getPointerTy()));
Yes, always those last-minute refactorings… I fixed the Gist an hour or so ago. David
Feb 14 2013