digitalmars.D - Funny way to crash dmd and brick the whole computer
- Zardoz (11/11) Sep 28 2018 CTE fib :
- Stefan Koch (4/15) Sep 28 2018 to be fair, that function is incredibly inefficient.
- Norm (9/20) Sep 28 2018 This isn't a brick, this is your OS not handling lack of
- bauss (2/13) Sep 29 2018 What exactly did you expect?
- Basile B. (5/16) Oct 01 2018 don't try to compile this one linux:
- Basile B. (2/22) Oct 01 2018 Actually no, it's an IDE issue triggered by this code.
- Joakim (3/14) Oct 01 2018 I tried it on Android with LDC, it eventually just kills the
CTE fib : module fib_cte; import std.stdio; long fib(long n) { if (n <= 1) return 1; return fib(n - 1) + fib(n - 2); } static immutable valueFib = fib(46); void main() { writeln(valueFib); }
Sep 28 2018
On Friday, 28 September 2018 at 11:58:25 UTC, Zardoz wrote:CTE fib : module fib_cte; import std.stdio; long fib(long n) { if (n <= 1) return 1; return fib(n - 1) + fib(n - 2); } static immutable valueFib = fib(46); void main() { writeln(valueFib); }to be fair, that function is incredibly inefficient. when you write an iterative fibonacci-series generator, it'll work.
Sep 28 2018
On Friday, 28 September 2018 at 11:58:25 UTC, Zardoz wrote:CTE fib : module fib_cte; import std.stdio; long fib(long n) { if (n <= 1) return 1; return fib(n - 1) + fib(n - 2); } static immutable valueFib = fib(46); void main() { writeln(valueFib); }This isn't a brick, this is your OS not handling lack of resources. A brick is when the machine will no longer boot without some physical intervention like JTAGing or replacing parts. DMD sacrifices memory for speed so it is not surprising given that code abomination. bye, norm
Sep 28 2018
On Friday, 28 September 2018 at 11:58:25 UTC, Zardoz wrote:CTE fib : module fib_cte; import std.stdio; long fib(long n) { if (n <= 1) return 1; return fib(n - 1) + fib(n - 2); } static immutable valueFib = fib(46); void main() { writeln(valueFib); }What exactly did you expect?
Sep 29 2018
On Friday, 28 September 2018 at 11:58:25 UTC, Zardoz wrote:CTE fib : module fib_cte; import std.stdio; long fib(long n) { if (n <= 1) return 1; return fib(n - 1) + fib(n - 2); } static immutable valueFib = fib(46); void main() { writeln(valueFib); }don't try to compile this one linux: ``` void main(){ asm{ db cast(ubyte[]) "é"; } } ```
Oct 01 2018
On Monday, 1 October 2018 at 09:24:18 UTC, Basile B. wrote:On Friday, 28 September 2018 at 11:58:25 UTC, Zardoz wrote:Actually no, it's an IDE issue triggered by this code.CTE fib : module fib_cte; import std.stdio; long fib(long n) { if (n <= 1) return 1; return fib(n - 1) + fib(n - 2); } static immutable valueFib = fib(46); void main() { writeln(valueFib); }don't try to compile this one linux: ``` void main(){ asm{ db cast(ubyte[]) "é"; } } ```
Oct 01 2018
On Monday, 1 October 2018 at 10:18:48 UTC, Basile B. wrote:On Monday, 1 October 2018 at 09:24:18 UTC, Basile B. wrote:In what world should an IDE ever have an issue with the code you write?On Friday, 28 September 2018 at 11:58:25 UTC, Zardoz wrote:Actually no, it's an IDE issue triggered by this code.CTE fib : module fib_cte; import std.stdio; long fib(long n) { if (n <= 1) return 1; return fib(n - 1) + fib(n - 2); } static immutable valueFib = fib(46); void main() { writeln(valueFib); }don't try to compile this one linux: ``` void main(){ asm{ db cast(ubyte[]) "é"; } } ```
Oct 02 2018
On Tuesday, 2 October 2018 at 07:18:32 UTC, bauss wrote:It's a dparse bug : https://github.com/dlang-community/libdparse/issues/278. In the IDE when I execute the action "Compile module and run" several things happen which require to lex and parse the "runnable" module with dparse. 1. AST is visited to determine if "-main" have to be passed or not to the compiler: https://github.com/BBasile/Coedit/blob/master/dastworx/src/mainfun.d#L22 2. Imports are enumerated : https://github.com/BBasile/Coedit/blob/master/dastworx/src/imports.d#L23. The list is used to get their matching source path and static library file, which are passed to the compiler automatically (https://github.com/BBasile/Coedit/blob/master/src/ce_libman.pas#L125). <mode |= Mode.arrogant> Have you ever dreamed to have a system that solve dependencies without specifying them in a DUB embedded receipt or JSON/SDL ? I did it. <mode &= ~Mode.arrogant>In what world should an IDE ever have an issue with the code you write?don't try to compile this one linux: ``` void main(){ asm{ db cast(ubyte[]) "é"; } } ```Actually no, it's an IDE issue triggered by this code.
Oct 02 2018
On Friday, 28 September 2018 at 11:58:25 UTC, Zardoz wrote:CTE fib : module fib_cte; import std.stdio; long fib(long n) { if (n <= 1) return 1; return fib(n - 1) + fib(n - 2); } static immutable valueFib = fib(46); void main() { writeln(valueFib); }I tried it on Android with LDC, it eventually just kills the process. You need to get a real OS. ;)
Oct 01 2018