Re: I can has @nogc and throw Exceptions?

2018-07-19 Thread timotheecour via Digitalmars-d-learn
On Friday, 13 February 2015 at 19:03:10 UTC, Jonathan Marler wrote: This question comes from wanting to be able to throw an exception in code that is @nogc. https://dlang.org/changelog/2.079.0.html#dip1008 ```d void main() @nogc { throw new Exception("I'm @nogc now"); } ```

D_vs_nim: git repo to compare features of D vs nim and help migrating code bw them. PRs welcome

2018-03-26 Thread timotheecour via Digitalmars-d-announce
D and nim are both very promising. I created this git repo to compare them: https://github.com/timotheecour/D_vs_nim/ Goal: up to date and objective comparison of features between D and nim (to help deciding what language to use), and 1:1 map of features and libraries to help D users learn

Re: D vs nim

2018-03-26 Thread timotheecour via Digitalmars-d
On Wednesday, 22 April 2015 at 06:03:07 UTC, Timothee Cour wrote: On Mon, Apr 13, 2015 at 10:28 AM, Timothee Cour wrote: I would like to refocus this thread on feature set and how it compares to D, not on flame wars about brackets or language marketing issues.

Re: Vision document for H1 2018

2018-03-15 Thread timotheecour via Digitalmars-d-announce
On Thursday, 15 March 2018 at 09:05:52 UTC, Kagamin wrote: On Sunday, 11 March 2018 at 04:06:13 UTC, Nick Sabalausky (Abscissa) wrote: First of all, betterC is about far more than interfacing with C. In fact, interop with C isn't really what betterC is about at all - that's a separate aspect

Re: how to pass -pie flag to dmd(or rdmd or ldc) ?

2018-03-13 Thread timotheecour via Digitalmars-d
On Thursday, 26 January 2017 at 07:38:50 UTC, Jacob Carlborg wrote: On 2017-01-26 04:43, Timothee Cour via Digitalmars-d wrote: Can we do this is 1 step? ``` rdmd -offoo.o -c foo.d g++ -o foo foo.o -pie -Wl,--export-dynamic ``` Ideally something like this would be great: ``` rdmd -offoo

Re: why not use git rebase instead of git merge in dlang repos?

2018-03-07 Thread timotheecour via Digitalmars-d
On Wednesday, 7 March 2018 at 22:28:26 UTC, ketmar wrote: H. S. Teoh wrote: I've pestered Brad about it before, but the real trouble is the Mailman software. If you feel motivated enough, pestering the upstream Mailman authors about it might actually get us closer to fixing this problem, as

Re: I have a patch to let lldb demangle D symbols ; help welcome to improve it

2018-02-27 Thread timotheecour via Digitalmars-d
On Tuesday, 27 February 2018 at 05:28:41 UTC, Timothee Cour wrote: https://github.com/llvm-mirror/lldb/pull/3 + https://github.com/timotheecour/dtools/blob/master/dtools/lldbdplugin.d on OSX, it works great except when encountering large symbols which cause segfault when GC does a collection

I have a patch to let lldb demangle D symbols ; help welcome to improve it

2018-02-26 Thread timotheecour via Digitalmars-d-debugger
[this is cross posted from https://forum.dlang.org/post/mailman.288.1519709357.3374.digitalmar...@puremagic.com for reference only; please reply to orginal thread]

Re: Tuple DIP

2018-02-19 Thread timotheecour via Digitalmars-d
On Friday, 12 January 2018 at 22:44:48 UTC, Timon Gehr wrote: As promised [1], I have started setting up a DIP to improve tuple ergonomics in D: https://github.com/tgehr/DIPs/blob/tuple-syntax/DIPs/DIP1xxx-tg.md This DIP aims to make code like the following valid D: ... Would this DIP

Re: how to get typeid of extern(C++) classes?

2018-02-16 Thread timotheecour via Digitalmars-d
On Friday, 16 February 2018 at 00:42:02 UTC, Timothee Cour wrote: is there a way to get typeid of extern(C++) classes (eg for ones in dmd/astbase.d but not limited to that) ? as a workaround, could the compiler insert (eg, depending on a version(insert_typeid)) a virtual method in each

Re: proposal: heredoc comments to allow `+/` in comments, eg from urls or documented unittests

2018-02-12 Thread timotheecour via Digitalmars-d
On Tuesday, 13 February 2018 at 04:16:22 UTC, Nick Sabalausky (Abscissa) wrote: On 02/09/2018 07:11 AM, Kagamin wrote: On Friday, 9 February 2018 at 11:16:01 UTC, Nick Sabalausky (Abscissa) wrote: On 02/09/2018 05:31 AM, Kagamin wrote: version(none)q{ FOO }; is likely to work for most stuff

Re: dub should be more command-line oriented

2018-02-12 Thread timotheecour via Digitalmars-d
On Thursday, 11 January 2018 at 15:37:20 UTC, Seb wrote: On Wednesday, 10 January 2018 at 15:07:40 UTC, Luís Marques It's not well documented, but you can always overwrite DUB with DFLAGS: DFLAGS="-dw" dub It will give you a warning though, but it's justified as you might have `DFLAGS`

Re: proposal: heredoc comments to allow `+/` in comments, eg from urls or documented unittests

2018-02-11 Thread timotheecour via Digitalmars-d
On Monday, 12 February 2018 at 01:27:19 UTC, Walter Bright wrote: Know what is a heavyweight problem worth our while? Having dmd be able to directly read C .h files, so the poor user does not have to manually translate them. read directly C++ header files instead of C .h files is what we

Re: proposal: heredoc comments to allow `+/` in comments, eg from urls or documented unittests

2018-02-11 Thread timotheecour via Digitalmars-d
On Monday, 12 February 2018 at 01:39:31 UTC, Walter Bright wrote: Easy: mixin template comment(string s) { } mixin comment!q"EOS This is a multi-line heredoc comment allowing /+ documented unittests containing nesting comments +/ and weird urls like

Re: -cov LOC is inadequate for 1 liner branching; need a metric based on branching

2018-02-11 Thread timotheecour via Digitalmars-d
On Monday, 5 February 2018 at 19:32:37 UTC, Timothee Cour wrote: just filed https://issues.dlang.org/show_bug.cgi?id=18377: @wilzbach It probably makes sense to have a look at how other languages are dealing with this. Seems to be a common problem some links: *

Re: cast overly permissive with extern(C++ ) classes; should cast through `void*`

2018-02-06 Thread timotheecour via Digitalmars-d
On Tuesday, 6 February 2018 at 21:13:50 UTC, timotheecour wrote: On Tuesday, 6 February 2018 at 20:39:09 UTC, Timothee Cour wrote: should we force force casting through `void*` for extern(C++) classes ? i.e. `cast(Derived) cast(void*) base_instance;` currently, `cast(A) unrelad_cpp_instance`

Re: Casts

2018-02-06 Thread timotheecour via Digitalmars-d
On Wednesday, 22 October 2008 at 18:43:15 UTC, Denis Koroskin wrote: On Wed, 22 Oct 2008 22:39:10 +0400, bearophile wrote: [...] You can use the following short-cut to avoid double casting: if (auto foo = cast(Foo)obj) { ... } else if (auto bar =

Re: cast overly permissive with extern(C++ ) classes; should cast through `void*`

2018-02-06 Thread timotheecour via Digitalmars-d
On Tuesday, 6 February 2018 at 20:39:09 UTC, Timothee Cour wrote: should we force force casting through `void*` for extern(C++) classes ? i.e. `cast(Derived) cast(void*) base_instance;` currently, `cast(A) unrelad_cpp_instance` happily compiles but shouldn't, it's very error prone even though

Re: The delang is using merge instead of rebase/squash

2018-02-02 Thread timotheecour via Digitalmars-d
On Sunday, 19 November 2017 at 04:44:24 UTC, Meta wrote: On Friday, 24 March 2017 at 16:34:46 UTC, Martin Nowak wrote: On Tuesday, 21 March 2017 at 20:16:00 UTC, Atila Neves wrote: git rebase master my_branch git checkout master git merge --no-ff my_branch Yes, that's about what we aim for,

Re: String Switch Lowering

2018-01-27 Thread timotheecour via Digitalmars-d
On Saturday, 27 January 2018 at 10:38:46 UTC, Kagamin wrote: dmd see also this horrendous stacktrace when calling getopt with a bad argument: full stacktrace: https://gist.github.com/timotheecour/d6b623bd3d223f5d958cd86adffd7807 just 1 line of this stacktrace: ``` 28 dscanner

Re: DMD as a library package can now run through all semantic phases

2018-01-26 Thread timotheecour via Digitalmars-d
On Friday, 26 January 2018 at 18:40:23 UTC, Seb wrote: Want to know what it prints? Run the file! Spoiler: it's similar to new the AST feature at run.dlang.io: prettyPrint produces valid D code except for template instantiations: ``` writeln!int { @safe void writeln(int _param_0)

Re: DMD as a library package can now run through all semantic phases

2018-01-26 Thread timotheecour via Digitalmars-d
On Saturday, 27 January 2018 at 01:10:35 UTC, timotheecour wrote: On Saturday, 27 January 2018 at 00:47:01 UTC, timotheecour the bug is that homebrew dmd installs dmd.conf in /Users/timothee/homebrew/etc/dmd.conf; findDMDConfig should instead look for dmd.conf by calling `dmd -v|grep 'Config

Re: DMD as a library package can now run through all semantic phases

2018-01-26 Thread timotheecour via Digitalmars-d
On Saturday, 27 January 2018 at 00:47:01 UTC, timotheecour wrote: on OSX: chmod u+x main.d ./main.d WARNING: A deprecated branch based version specification is used for the dependency dmd. Please use numbered versions instead. Also note that you can still use the dub.selections.json file to

Re: DMD as a library package can now run through all semantic phases

2018-01-26 Thread timotheecour via Digitalmars-d
On Saturday, 27 January 2018 at 01:36:17 UTC, Seb wrote: On Saturday, 27 January 2018 at 01:25:18 UTC, timotheecour Agreed, but prettyPrint: https://github.com/dlang/dmd/blob/master/src/dmd/frontend.d#L275 is just a nice wrapper around the existing PrettyPrintVisitor:

Re: Possible dmd 2.078 regression ?

2018-01-26 Thread timotheecour via Digitalmars-d-learn
On Friday, 12 January 2018 at 18:51:31 UTC, Basile B. wrote: On Friday, 12 January 2018 at 18:50:10 UTC, Basile B. wrote: On Friday, 12 January 2018 at 17:58:30 UTC, Stefan Koch wrote: On Friday, 12 January 2018 at 14:13:22 UTC, Basile B. wrote: I have a simple program that only compiles if

Re: reduce mangled name sizes via link-time symbol renaming

2018-01-26 Thread timotheecour via Digitalmars-d
On Friday, 26 January 2018 at 08:44:26 UTC, Seb wrote: What is the benefit of using link-time renaming (a linker specific feature) instead of directly renaming the symbol in the compiler? We could be quite radical and hash all symbols > a certain threshold. As long as we have a hash function

Re: DMD as a library package can now run through all semantic phases

2018-01-26 Thread timotheecour via Digitalmars-d
On Friday, 26 January 2018 at 18:40:23 UTC, Seb wrote: In case someone wants to play with DMD as a library, it got a lot easier as of today. Here's an example: ``` #!/usr/bin/env dub /+dub.sdl: dependency "dmd" version="~master" +/ void main() { import dmd.frontend; import

Re: Is it possible to obtain textual representation of an arbitary code?

2018-01-26 Thread timotheecour via Digitalmars-d-learn
On Friday, 26 January 2018 at 11:18:21 UTC, Oleksii Skidan wrote: Hi, I wonder if it's possible to convert D language code into a string at compile time? C/C++ preprocessor has this feature built-in: `#` preprocessing operator allows converting a macro argument into a string constant. See

functions allowed to overload on const int vs int vs immutable int? + spec is not accurate

2018-01-26 Thread timotheecour via Digitalmars-d
this compiles, but equivalent in C++ (const int vs int) would give a compile error (error: redefinition of 'fun'); what's the rationale for allowing these overloads? ``` void fun(int src){ writeln2(); } void fun(immutable int src){ writeln2(); } void fun(const int src){ writeln2(); } void

Re: Relocatable objects and internal pointers

2018-01-20 Thread timotheecour via Digitalmars-d-learn
On Saturday, 30 January 2016 at 03:13:59 UTC, Matt Elkins wrote: std.typecons.Unique seems to require heap allocation, which makes it a far cry from std::unique_ptr. isn't unique_ptr typically for heap allocation? eg:

Re: Release D 2.078.0

2018-01-10 Thread timotheecour via Digitalmars-d-announce
On Wednesday, 10 January 2018 at 21:42:38 UTC, Nathan S. wrote: When I remove the "inline" option the build + test time becomes <10 seconds. So the weirdly slow part is related to inlining. filed so we don't forget: https://issues.dlang.org/show_bug.cgi?id=18221

Re: Understanding how dub works

2017-12-12 Thread timotheecour via Digitalmars-d-learn
On Wednesday, 13 December 2017 at 00:43:31 UTC, rikki cattermole wrote: You don't need to change this and if you think you do, you're wrong :) Except when you need to: https://github.com/dlang/dub/issues/1305 dub build --compiler=ldmd2 overwrites files in ~/.dub written by dub build #1305

Re: workaround for `The module 'foo.bar' is already defined` when recompiling objects?

2017-06-11 Thread timotheecour via Digitalmars-d
On Sunday, 11 June 2017 at 07:09:33 UTC, timotheecour wrote: On Sunday, 11 June 2017 at 05:21:23 UTC, Timothee Cour wrote: [...] NOTE: this is on linux, and the above simple case doesn't reproduce the error, but my test case is similar albeit from a larger program that's hard to reduce.

Re: workaround for `The module 'foo.bar' is already defined` when recompiling objects?

2017-06-11 Thread timotheecour via Digitalmars-d
On Sunday, 11 June 2017 at 05:21:23 UTC, Timothee Cour wrote: ``` NOTE: this is on linux, and the above simple case doesn't reproduce the error, but my test case is similar albeit from a larger program that's hard to reduce. the code that crashes is in druntime: /** * Check for module

Re: Time from timestamp?

2017-04-08 Thread timotheecour via Digitalmars-d-learn
Might I suggest that you simply define an enum for UnixEpoch that's a SysTime. Then you can do whatever you want. ping on this.

Re: dirEntries with ** (recursive) globbing

2017-04-02 Thread timotheecour via Digitalmars-d
On Wednesday, 13 November 2013 at 13:34:37 UTC, Jacob Carlborg wrote: On 2013-11-13 13:20, Timothee Cour wrote: alas, no, I posted on exactly this some times ago: glob is non-recursive in D: http://forum.dlang.org/post/mailman.2367.1382320537.1719.digitalmars-d-le...@puremagic.com Hmm, right,

Re: syntax sugar: std.path::buildPath instead of from!"std.path".buildPath

2017-02-16 Thread timotheecour via Digitalmars-d
On Wednesday, 15 February 2017 at 20:21:45 UTC, Nick Treleaven wrote: On Wednesday, 15 February 2017 at 20:09:46 UTC, Timothee Cour wrote: This thread completely diverged from the original post, which was propsing `::` instead of `from!`: ``` void fun(T)(std.stdio::File input, T value) if

Re: The module 'foo' is already defined in 'libmylib.so'

2016-12-09 Thread timotheecour via Digitalmars-d-learn
On Saturday, 10 December 2016 at 02:39:33 UTC, timotheecour wrote: Have a look at what `trace -E d_executable args` and `trace -E c++_executable args` print on startup and grep for dlopen calls and the like. do you mean strace? I have trace on OSX but I'm asking for linux. Looking at the

Re: The module 'foo' is already defined in 'libmylib.so'

2016-12-09 Thread timotheecour via Digitalmars-d-learn
Have a look at what `trace -E d_executable args` and `trace -E c++_executable args` print on startup and grep for dlopen calls and the like. do you mean strace? I have trace on OSX but I'm asking for linux.

Re: how to debug exceptions/asserts thrown in module constructors?

2016-11-27 Thread timotheecour via Digitalmars-d-learn
UPDATE: * b Loader.d:123 didn't help either: error: parsing line table prologue at 0x (parsing ended around 0x Breakpoint 1: where = mybinary.temp`D4gtkc6Loader6Linker12_staticDtor3FZv, address = 0x000100315410 (process exited despite breakpoint); dmd's dwarf debug info

Re: Help test Google flatbuffers

2016-10-15 Thread timotheecour via Digitalmars-d
On Sunday, 15 May 2016 at 14:08:57 UTC, Joseph Rushton Wakeling wrote: (2) It's probably more idiomatic to use `void[]` for buffers of binary data, although I imagine you may have some reasons for using `ubyte[]` ... ? curious about this. https://dlang.org/phobos/std_outbuffer.html defines:

Re: grpc

2016-09-23 Thread timotheecour via Digitalmars-d
On Monday, 30 November 2015 at 14:55:53 UTC, yawniek wrote: would anyone be interested in doing the work for adding D / vibe.d to https://github.com/grpc/grpc ? we currently lack the manpower but would be able to sponsor it (or parts, depending on the effort needed). grpc is probably going

Re: DMD diagnostic - any way to remove identical lines from final dmd error log?

2015-08-10 Thread timotheecour via Digitalmars-d
On Friday, 17 August 2012 at 13:10:52 UTC, Timon Gehr wrote: On 08/17/2012 02:17 PM, Marco Leise wrote: Am Tue, 14 Aug 2012 12:15:35 +0200 schrieb Don Clugstond...@nospam.com: Seriously, if you are finding ANY error messages for things which are not real errors, that is a bug. What about

Re: make std/concurrency.test fails but others don't... why?

2015-07-26 Thread timotheecour via Digitalmars-d
On Sunday, 12 April 2015 at 04:08:47 UTC, Andrei Alexandrescu wrote: On 4/11/15 12:25 AM, Vladimir Panteleev wrote: [...] The actual command line generated by is: ../dmd/src/dmd -conf= -I../druntime/import -w -dip25 -m64 -g -debug -main -unittest generated/osx/debug/64/libphobos2.a

Re: deserialization: creating a class instance without calling constructor

2015-05-25 Thread timotheecour via Digitalmars-d-learn
On Thursday, 21 May 2015 at 19:06:35 UTC, Jacob Carlborg wrote: On 2015-05-21 11:06, Timothee Cour via Digitalmars-d-learn wrote: Can I create an instance of A without calling a constructor? (see below) Use case: for generic deserialiaztion, when the deserialization library encounters a class

Re: Serialization library with support for circular references?

2015-05-23 Thread timotheecour via Digitalmars-d-learn
On Saturday, 10 November 2012 at 22:09:07 UTC, Andrej Mitrovic wrote: On 11/10/12, nixda b...@or.de wrote: You can try vibe.d bson serialization. http://vibed.org/api/vibe.data.bson/serializeToBson It doesn't handle them either. Anyway I've implemented it for msgpack (took a whole of 30

Re: Serialization library with support for circular references?

2015-05-23 Thread timotheecour via Digitalmars-d-learn
On Saturday, 23 May 2015 at 08:01:28 UTC, timotheecour wrote: On Saturday, 10 November 2012 at 22:09:07 UTC, Andrej Mitrovic wrote: On 11/10/12, nixda b...@or.de wrote: You can try vibe.d bson serialization. http://vibed.org/api/vibe.data.bson/serializeToBson It doesn't handle them either.

Re: 'with(Foo):' not allowed, why?

2014-08-08 Thread timotheecour via Digitalmars-d-learn
On Wednesday, 6 August 2014 at 17:03:23 UTC, Timothee Cour via Digitalmars-d-learn wrote: Is there a reason why 'with(Foo):' is not allowed, and we have to use with(Foo){...} ? It would be more in line with how other scope definitions work (extern(C) etc) ping, anyone?

Re: alias with lambda syntax: alias fun2=a=fun(a);

2014-06-05 Thread timotheecour via Digitalmars-d-learn
On Thursday, 5 June 2014 at 06:58:50 UTC, Timothee Cour via Digitalmars-d-learn wrote: Is there a way to do this? import std.algorithm; auto fun(T)(T a){return a;} template fun2(T){auto fun2(T a){return fun(a);}}//OK but heavy syntax and cannot be nested inside test() void main(){