Re: std.typecons rebindable + tuple with const class gives warning

2021-02-17 Thread Saurabh Das via Digitalmars-d-learn
On Thursday, 4 February 2021 at 20:40:43 UTC, tsbockman wrote: TLDR; Either make `c` mutable, or override/overload the `C` associative array support methods `toHash` and `opEquals` to support `const(C)` objects. This solved my issue. I finally understood why this was happening after

std.typecons rebindable + tuple with const class gives warning

2021-02-04 Thread Saurabh Das via Digitalmars-d-learn
This code: void main() { import std.typecons : rebindable, tuple; const c = new C(); auto t = tuple(c.rebindable); } class C { } When compiled with DMD 2.095.0 gives a warning: Warning: struct Rebindable has method toHash, however it cannot be called with

Re: dmd -O causes incorrect output

2021-01-25 Thread Saurabh Das via Digitalmars-d-learn
On Monday, 25 January 2021 at 19:18:47 UTC, H. S. Teoh wrote: On Mon, Jan 25, 2021 at 06:45:43PM +, Saurabh Das via Digitalmars-d-learn wrote: On Monday, 25 January 2021 at 18:19:24 UTC, H. S. Teoh wrote: [...] > It's probably a bug. File a bug on bugzilla: > https://issues.dla

Re: dmd -O causes incorrect output

2021-01-25 Thread Saurabh Das via Digitalmars-d-learn
On Monday, 25 January 2021 at 18:19:24 UTC, H. S. Teoh wrote: On Mon, Jan 25, 2021 at 06:07:46PM +, Saurabh Das via Digitalmars-d-learn wrote: [...] [...] [...] It's probably a bug. File a bug on bugzilla: https://issues.dlang.org [...] [...] DMD's backend is known to have

dmd -O causes incorrect output

2021-01-25 Thread Saurabh Das via Digitalmars-d-learn
I'm seeing what appears to be a bug with the -O flag in dmd. Here is a reduced test case: struct SomeStruct { long value; } bool isNumberOne(int i) { SomeStruct l; if(i == 1) l = SomeStruct(10); return (l == SomeStruct(10)); } void main() { if

Re: Surprising behaviour of std.experimental.allocator

2020-12-27 Thread Saurabh Das via Digitalmars-d-learn
On Saturday, 26 December 2020 at 19:36:24 UTC, ag0aep6g wrote: On 26.12.20 13:59, ag0aep6g wrote: Looks like a pretty nasty bug somewhere in std.experimental.allocator or (less likely) the GC. Further reduced code: [...] Apparently, something calls deallocateAll on a Mallocator

Re: Surprising behaviour of std.experimental.allocator

2020-12-24 Thread Saurabh Das via Digitalmars-d-learn
On Thursday, 24 December 2020 at 23:58:45 UTC, Elronnd wrote: On Thursday, 24 December 2020 at 23:46:58 UTC, Elronnd wrote: reduced version: Further reduction: Alloc1 can just be ‘AllocatorList!(n => Region!Mallocator(MB))’. Thank you for the reduced test case. A small change to the test

Surprising behaviour of std.experimental.allocator

2020-12-24 Thread Saurabh Das via Digitalmars-d-learn
This causes a segfault when run with rdmd -gx: void main() { import std.experimental.allocator : allocatorObject, expandArray; import std.experimental.allocator.building_blocks.allocator_list : AllocatorList; import std.experimental.allocator.building_blocks.region : Region;

Re: core.atomic.atomicStore and structs

2020-03-03 Thread Saurabh Das via Digitalmars-d-learn
On Tuesday, 3 March 2020 at 11:35:35 UTC, MoonlightSentinel wrote: On Tuesday, 3 March 2020 at 11:04:53 UTC, Saurabh Das wrote: PS: Any chance this will make it into DMD 2.091.0? Yes, this fix will be in the upcoming release. Excellent. Thank you so much! :) Saurabh

Re: core.atomic.atomicStore and structs

2020-03-03 Thread Saurabh Das via Digitalmars-d-learn
On Tuesday, 3 March 2020 at 10:57:36 UTC, MoonlightSentinel wrote: On Tuesday, 3 March 2020 at 09:12:40 UTC, Saurabh Das wrote: Is this supposed to not work anymore? Or is this a bug? That is a bug, see https://issues.dlang.org/show_bug.cgi?id=20629 Oh wow you fixed it already! Amazing!

core.atomic.atomicStore and structs

2020-03-03 Thread Saurabh Das via Digitalmars-d-learn
Hi, Consider this code: ``` import core.atomic; struct MyStruct { uint a, b; } static assert(MyStruct.sizeof == ulong.sizeof); void main() { shared MyStruct ms1; MyStruct ms2 = atomicLoad(ms1); // This is fine MyStruct ms3; cas(, ms2, ms3);// This is

Re: Is it possible to use DMD as a library to compile strings at runtime?

2020-02-03 Thread Saurabh Das via Digitalmars-d-learn
On Sunday, 2 February 2020 at 06:03:01 UTC, H. S. Teoh wrote: On Sun, Feb 02, 2020 at 03:16:46AM +, Saurabh Das via Digitalmars-d-learn wrote: [...] [...] > [...] [...] [...] [...] It's very simple. Let's say you have your code in some string called 'code'. Since dmd nowadays

Re: Is it possible to use DMD as a library to compile strings at runtime?

2020-02-01 Thread Saurabh Das via Digitalmars-d-learn
On Saturday, 1 February 2020 at 20:37:03 UTC, H. S. Teoh wrote: On Sat, Feb 01, 2020 at 08:01:34PM +, Andre Pany via Digitalmars-d-learn wrote: [...] Another approach: - include the dmd compiler package with your application - within your app call the compiler executable and compile the

Re: Unexpected issue with std.format

2020-02-01 Thread Saurabh Das via Digitalmars-d-learn
On Saturday, 1 February 2020 at 15:16:41 UTC, Steven Schveighoffer wrote: On 2/1/20 8:39 AM, Saurabh Das wrote: I faced this issue while working with custom formatting for a struct. I have reduced the error down to this test program: import std.format, std.stdio, std.array; struct Test1 {   

Re: Unexpected issue with std.format

2020-02-01 Thread Saurabh Das via Digitalmars-d-learn
On Saturday, 1 February 2020 at 13:39:34 UTC, Saurabh Das wrote: I faced this issue while working with custom formatting for a struct. I have reduced the error down to this test program: [...] PS: Currently using DMD64 D Compiler v2.090.0

Unexpected issue with std.format

2020-02-01 Thread Saurabh Das via Digitalmars-d-learn
I faced this issue while working with custom formatting for a struct. I have reduced the error down to this test program: import std.format, std.stdio, std.array; struct Test1 { void toString(W, C)(ref W w, scope const ref FormatSpec!C fmt) { pragma(msg, "Test1 function

Re: Is it possible to use DMD as a library to compile strings at runtime?

2020-01-31 Thread Saurabh Das via Digitalmars-d-learn
On Friday, 31 January 2020 at 14:25:30 UTC, Basile B. wrote: On Friday, 31 January 2020 at 11:19:37 UTC, Saurabh Das wrote: [...] Fundamentally DMD as a library is a front-end. Jitting is to the backend side. You'll be able to lex and parse the source to get an AST, to perform the semantic

Is it possible to use DMD as a library to compile strings at runtime?

2020-01-31 Thread Saurabh Das via Digitalmars-d-learn
I see that DUB has DMD as a library package, but I was not able to understand how to use it. Is it possible to use DMD as a library within a D program to compile a string to machine code and run the compiled code at runtime? Thanks, Saurabh

Is there any implementation of a 128bit integer?

2019-08-19 Thread Saurabh Das via Digitalmars-d-learn
The cent and ucent types are reserved for the future. Is there any knowledge/timeline on when they might be implemented? Currently, is there a useable 128bit integer type in DMD/LDC/GDC? Or perhaps a library that implements 128bit integers? I've come across gfm:integers

Re: Add D front-end, libphobos library, and D2 testsuite... to GCC

2018-10-28 Thread Saurabh Das via Digitalmars-d-announce
On Monday, 29 October 2018 at 03:43:49 UTC, Mike Parker wrote: Congratulations are in order for Iain Buclaw. His efforts have been rewarded in a big way. Last Friday, he got the greenlight to move forward with submitting his changes into GCC:

Re: Bug with writeln?

2018-09-09 Thread Saurabh Das via Digitalmars-d-learn
Thank you for explaining all this. It is frustrating because the behaviour is very counterintuitive. I will use a workaround for now. Saurabh

Bug with writeln?

2018-09-06 Thread Saurabh Das via Digitalmars-d-learn
Is this a bug with writeln? void main() { import std.stdio, std.range, std.algorithm; auto a1 = sort([1,3,5,4,2]); auto a2 = sort([9,8,9]); auto a3 = sort([5,4,5,4]); pragma(msg, typeof(a1)); pragma(msg, typeof(a2)); pragma(msg, typeof(a3)); auto b = [a1, a2,

Scalars in ndslice?

2017-11-25 Thread Saurabh Das via Digitalmars-d-learn
I've been using ndslice for some timeseries work and it's incredibly good. One question which I couldn't find an answer to: Can ndslice behave as a scalar (ie: 0-dimensional slice)? It would be convenient if that is possible since then I won't have to write different functions for scalars

Re: Huge increase in UT compile time

2017-10-14 Thread Saurabh Das via Digitalmars-d-learn
On Saturday, 14 October 2017 at 09:03:05 UTC, Joakim wrote: On Saturday, 14 October 2017 at 04:36:25 UTC, Saurabh Das wrote: [...] I can reproduce on linux/x64, looks like a memory leak, as dmd balloons out to eat up all available memory until it's killed. I see it with this minimal

Re: Huge increase in UT compile time

2017-10-13 Thread Saurabh Das via Digitalmars-d-learn
On Wednesday, 11 October 2017 at 08:11:37 UTC, Jonathan M Davis wrote: On Wednesday, October 11, 2017 06:25:19 Dhananjay via Digitalmars-d-learn wrote: Hello, I am upgrading to DMD 2.076.1 from DMD 2.069.2 (similar results on 2.075.1), and seeing a huge increase in unittest compilation time

Re: Funny issue with casting double to ulong

2017-07-02 Thread Saurabh Das via Digitalmars-d-learn
On Monday, 3 July 2017 at 03:57:25 UTC, Basile B wrote: On Monday, 3 July 2017 at 03:50:14 UTC, Saurabh Das wrote: [...] 6.251 has no perfect double representation. It's real value is: 6.215099962483343551867E0 Hence when you cast to ulong after the product by 10_000, this is

Funny issue with casting double to ulong

2017-07-02 Thread Saurabh Das via Digitalmars-d-learn
Consider this snippet: void main() { import std.stdio; auto a = 6.2151; auto b = a * 1; auto c = cast(ulong)b; writeln("a: ", typeof(a).stringof, " ", a); writeln("b: ", typeof(b).stringof, " ", b); writeln("c: ", typeof(c).stringof, " ", c); auto x =

Re: excel-d v0.0.1 - D API to write functions callable from Excel

2017-03-21 Thread Saurabh Das via Digitalmars-d-announce
On Monday, 20 March 2017 at 20:09:58 UTC, Atila Neves wrote: http://code.dlang.org/packages/excel-d This dub package allows D code to be called from Excel. It uses compile-time reflection to register the user's code in an XLL (a DLL loaded by Excel) so no boilerplate is necessary. Not even

Re: WebAssembly design is done?

2017-03-01 Thread Saurabh Das via Digitalmars-d
I'm not so up-to-date about the mechanics of WebAssembly, but it would be pretty exciting to run D code in the browser. Is this now possible or have I completely misunderstood what WebAssembly allows for?

Re: Need some help understanding PyD

2017-01-08 Thread Saurabh Das via Digitalmars-d-learn
PS: Noticed something off. My python installation is 3.4.3: Python 3.4.3 (default, Sep 14 2016, 12:36:27) [GCC 4.8.4] on linux However when I run: context.py_stmts("import sys"); context.py_stmts("print(sys.version)"); I get: 3.4.0 (default, Apr 11 2014, 13:08:40) [GCC 4.8.2] Also,

Need some help understanding PyD

2017-01-08 Thread Saurabh Das via Digitalmars-d-learn
I've been giving PyD a try. It's really nice and mostly everything works out of the box. I'm trying to use TensorFlow in D via Pytho, so I need to call Python functions in D. When I try to do: auto context = new InterpContext(); context.py_stmts("import tensorflow"); I get this

Re: Many documentation examples can now be run online

2016-12-25 Thread Saurabh Das via Digitalmars-d-announce
On Saturday, 24 December 2016 at 06:55:37 UTC, Seb wrote: On Saturday, 24 December 2016 at 06:08:49 UTC, Saurabh Das wrote: [...] Thanks for your feedback :) [...] Sure - that should be fairly trivial. [...] Yes, that would be pretty nice to have. Unfortunately the maintainer of

Re: Many documentation examples can now be run online

2016-12-23 Thread Saurabh Das via Digitalmars-d-announce
On Saturday, 24 December 2016 at 00:04:54 UTC, Seb wrote: On Friday, 23 December 2016 at 23:52:48 UTC, Johan Engelen wrote: On Tuesday, 20 December 2016 at 07:04:38 UTC, Seb wrote: https://github.com/dlang/dlang.org/pull/1527 Nice. It's pretty awesome! When clicking the "edit" button, a

Re: Vibe.D - log requests and responses

2016-11-24 Thread Saurabh Das via Digitalmars-d-learn
On Thursday, 24 November 2016 at 07:57:47 UTC, Jacob Carlborg wrote: On 2016-11-24 07:29, Saurabh Das wrote: [...] Yes. You can configure the logging on the HTTPServerSettings [1] instance. If you look at the documentation, the first four fields are related to logging. Use "accessLogFile"

Vibe.D - log requests and responses

2016-11-23 Thread Saurabh Das via Digitalmars-d-learn
Hi, Is there an easy way to log all incoming requests and outgoing responses (and perhaps processing time, wait time, etc) in Vibe.D? Thanks, Saurabh

Re: Concatenate 2 ranges

2016-11-11 Thread Saurabh Das via Digitalmars-d-learn
On Friday, 11 November 2016 at 13:30:17 UTC, RazvanN wrote: I am trying to concatenate 2 ranges of the same type (SortedRange in my case). I have tried merge, join and chain, but the problem is that the result is not an object of the type of the initial ranges. For example: 1. If I use

Re: Release vibe.d 0.7.30

2016-11-01 Thread Saurabh Das via Digitalmars-d-announce
On Tuesday, 1 November 2016 at 09:09:05 UTC, Saurabh Das wrote: On Monday, 31 October 2016 at 20:30:22 UTC, Sönke Ludwig wrote: [...] I'm going to try this out today! :) How can I find out more information about the 'runApplication' change? What does "slowly fading out" mean?

Re: Release vibe.d 0.7.30

2016-11-01 Thread Saurabh Das via Digitalmars-d-announce
On Monday, 31 October 2016 at 20:30:22 UTC, Sönke Ludwig wrote: Main changes over 0.7.29: - Compiles on the latest DMD version (2.068.x-2.072.0) - Added a new authorization framework for the web/REST interface generators - Extended the serialization framework with more hooks and

Re: Neural Networks / ML Libraries for D

2016-10-25 Thread Saurabh Das via Digitalmars-d-learn
On Tuesday, 25 October 2016 at 14:31:39 UTC, bachmeier wrote: On Tuesday, 25 October 2016 at 13:58:33 UTC, Saurabh Das wrote: [...] Installation amounts to installing a couple of R packages that I have on Bitbucket, as described on the project page. I have basic usage examples there as

Re: Neural Networks / ML Libraries for D

2016-10-25 Thread Saurabh Das via Digitalmars-d-learn
On Tuesday, 25 October 2016 at 13:26:49 UTC, bachmeier wrote: On Tuesday, 25 October 2016 at 11:17:29 UTC, Saurabh Das wrote: Hello, Are there any good ML libraries for D? In particular, looking for a neural network library currently. Any leads would be appreciated. Thanks, Saurabh I

Re: Neural Networks / ML Libraries for D

2016-10-25 Thread Saurabh Das via Digitalmars-d-learn
(a C library) together with D and it worked very well. 2016-10-25 13:17 GMT+02:00 Saurabh Das via Digitalmars-d-learn < digitalmars-d-learn@puremagic.com>: Hello, Are there any good ML libraries for D? In particular, looking for a neural network library currently. Any leads

Neural Networks / ML Libraries for D

2016-10-25 Thread Saurabh Das via Digitalmars-d-learn
Hello, Are there any good ML libraries for D? In particular, looking for a neural network library currently. Any leads would be appreciated. Thanks, Saurabh

Re: Repeat and chunks

2016-10-24 Thread Saurabh Das via Digitalmars-d-learn
On Monday, 24 October 2016 at 15:59:05 UTC, Meta wrote: On Monday, 24 October 2016 at 15:28:50 UTC, Saurabh Das wrote: [...] Yes, that's correct. This is the overload of `repeat` in question: https://dlang.org/phobos/std_range.html#.repeat.2 Take!(Repeat!T) repeat(T)(T value, size_t n);

Re: Repeat and chunks

2016-10-24 Thread Saurabh Das via Digitalmars-d-learn
On Monday, 24 October 2016 at 15:28:50 UTC, Saurabh Das wrote: On Monday, 24 October 2016 at 14:25:46 UTC, Dorian Haglund wrote: Hey, The following code crashes with DMD64 D Compiler v2.071.2: import std.algorithm; import std.stdio; import std.range; int main() { repeat(8,

Re: Repeat and chunks

2016-10-24 Thread Saurabh Das via Digitalmars-d-learn
On Monday, 24 October 2016 at 14:25:46 UTC, Dorian Haglund wrote: Hey, The following code crashes with DMD64 D Compiler v2.071.2: import std.algorithm; import std.stdio; import std.range; int main() { repeat(8, 10).chunks(3).writeln(); return 0; } Error message: pure nothrow @nogc

Re: Vibe.d compilation error: backend/cgelem.c 5018 dmd failed with exit code 1.

2016-09-22 Thread Saurabh Das via Digitalmars-d-learn
On Thursday, 22 September 2016 at 10:44:29 UTC, llaine wrote: On Wednesday, 21 September 2016 at 21:32:02 UTC, Rene Zwanenburg wrote: On Wednesday, 21 September 2016 at 20:22:42 UTC, llaine wrote: Yes, but it may take some time. For large projects, running it on a server is advisable. 3K LOC

Re: Vibe.d compilation error: backend/cgelem.c 5018 dmd failed with exit code 1.

2016-09-21 Thread Saurabh Das via Digitalmars-d-learn
On Wednesday, 21 September 2016 at 14:15:30 UTC, llaine wrote: Using dmd every day and since one day I'm getting this error when I'm compiling using the -b release flag (dub build -b release). I'm compiling a vibe.d application that has roughly 3k LoC. Removing the -b flag solves the

Re: What blogs about D do you read?

2016-09-20 Thread Saurabh Das via Digitalmars-d-learn
On Monday, 19 September 2016 at 19:36:22 UTC, Karabuta wrote: On Monday, 19 September 2016 at 19:29:25 UTC, A D dev wrote: On Monday, 19 September 2016 at 17:42:51 UTC, A D dev wrote: Hi list, What blogs about D do you read? To be more clear: - what blogs that include posts on D, would you

Re: ggplotd version 1.0.0 released

2016-08-21 Thread Saurabh Das via Digitalmars-d-announce
On Saturday, 20 August 2016 at 16:37:29 UTC, Edwin van Leeuwen wrote: I just wanted to announce the 1.0.0 version release of ggplotd [1]. The main addition is support for legends. Other than that the release focused on cleaning up/refactoring the code. It should still be backwards compatible

Re: Log in an @nogc function

2016-08-17 Thread Saurabh Das via Digitalmars-d-learn
On Wednesday, 17 August 2016 at 10:47:54 UTC, Guillaume Piolat wrote: On Wednesday, 17 August 2016 at 10:45:01 UTC, Saurabh Das wrote: Is there any way I can log to a terminal or a file from inside an @nogc function? Thanks, Saurabh import core.stdc.stdio; printf("am logging C-style\n");

Log in an @nogc function

2016-08-17 Thread Saurabh Das via Digitalmars-d-learn
Is there any way I can log to a terminal or a file from inside an @nogc function? Thanks, Saurabh

Re: Replace (ie: substitute) a type in varadic args

2016-08-02 Thread Saurabh Das via Digitalmars-d-learn
On Tuesday, 2 August 2016 at 08:16:48 UTC, Sean Campbell wrote: On Tuesday, 2 August 2016 at 07:24:28 UTC, Saurabh Das wrote: [...] Just of the top of my head, using ugly string mixins, this: auto myConverterFunc(Args...)(Args args) { string genCode() { string code

Re: Replace (ie: substitute) a type in varadic args

2016-08-02 Thread Saurabh Das via Digitalmars-d-learn
On Tuesday, 2 August 2016 at 08:20:22 UTC, Saurabh Das wrote: On Tuesday, 2 August 2016 at 08:16:48 UTC, Sean Campbell wrote: [...] Thanks. Yes that is one approach. I figured out another approach that seems decent: auto targetFunctionProxy(Args...)(Args args) { import std.meta;

Replace (ie: substitute) a type in varadic args

2016-08-02 Thread Saurabh Das via Digitalmars-d-learn
How can I substitute the type of an argument received via a varadic template? For example say I want to generalise this scenario: auto myConverterFunction1(bool arg1, bool arg2, ubyte arg3, int arg4) { return targetFunction(cast(ubyte)arg1, cast(ubyte)arg2, arg3, arg4); } So I'll have

Re: Default implementations in inherited interfaces

2016-07-25 Thread Saurabh Das via Digitalmars-d-learn
On Sunday, 24 July 2016 at 07:54:11 UTC, Jonathan Marler wrote: On Thursday, 21 July 2016 at 13:37:30 UTC, Saurabh Das wrote: On Thursday, 21 July 2016 at 12:42:14 UTC, Adam D. Ruppe wrote: On Thursday, 21 July 2016 at 09:41:27 UTC, Saurabh Das wrote: Java 8 has a 'default' keyword that allows

Re: Default implementations in inherited interfaces

2016-07-21 Thread Saurabh Das via Digitalmars-d-learn
On Thursday, 21 July 2016 at 12:42:14 UTC, Adam D. Ruppe wrote: On Thursday, 21 July 2016 at 09:41:27 UTC, Saurabh Das wrote: I have an interface A which declares a certain function. A second interface B inherits from A and wishes to provide a default implementation for that function. You

Default implementations in inherited interfaces

2016-07-21 Thread Saurabh Das via Digitalmars-d-learn
I have an interface A which declares a certain function. A second interface B inherits from A and wishes to provide a default implementation for that function. How can I achieve this? I'm facing an error when I try this: interface A { int func(int); } interface B : A { final int

Atila Neves: "C IS NOT MAGICALLY FAST, PART 2"

2016-07-18 Thread Saurabh Das via Digitalmars-d
Posted on Atila's blog yesterday: https://atilanevesoncode.wordpress.com/2016/07/18/c-is-not-magically-fast-part-2/

Re: Release vibe.d 0.7.29

2016-07-05 Thread Saurabh Das via Digitalmars-d-announce
On Monday, 4 July 2016 at 08:24:40 UTC, Sönke Ludwig wrote: [...] That's fantastic! I shall definitely check both out. Saurabh

Re: Release DUB 1.0.0

2016-06-21 Thread Saurabh Das via Digitalmars-d-announce
On Monday, 20 June 2016 at 15:52:46 UTC, Sönke Ludwig wrote: I'm pleased to announce the release of the first stable version of the DUB package manager. Stable in this case means that the API, the command line interface and the package recipe format will only receive fully backwards compatible

Re: Beta release DUB 1.0.0-beta.1

2016-06-13 Thread Saurabh Das via Digitalmars-d-announce
On Tuesday, 7 June 2016 at 09:54:19 UTC, Sönke Ludwig wrote: DUB 1.0.0 is nearing completion. The new feature over 0.9.25 is support for single-file packages, which can be used to write shebang-style scripts on Posix systems: [...] That is really useful! Thanks again for all the work you

Re: Mono-D for the new Xamarin Studio

2016-06-10 Thread Saurabh Das via Digitalmars-d-learn
On Friday, 10 June 2016 at 13:36:43 UTC, Alex Bothe wrote: On Friday, 10 June 2016 at 12:51:34 UTC, Saurabh Das wrote: I have foolishly updated my Xamarin Studio and now the D Language Binding no longer works. Is there an update to fix this? Or should I downgrade? Thanks, Saurabh Hi there,

Mono-D for the new Xamarin Studio

2016-06-10 Thread Saurabh Das via Digitalmars-d-learn
I have foolishly updated my Xamarin Studio and now the D Language Binding no longer works. Is there an update to fix this? Or should I downgrade? Thanks, Saurabh

Re: Free the DMD backend

2016-05-30 Thread Saurabh Das via Digitalmars-d
On Monday, 30 May 2016 at 14:51:48 UTC, Matthias Klumpp wrote: On Sunday, 29 May 2016 at 10:56:57 UTC, Russel Winder wrote: On Sun, 2016-05-29 at 04:08 +, Joakim via Digitalmars-d wrote: […] It would be nice if that happened, but Walter has said Symantec isn't interested.  Aren't ldc

Re: Is there a 128-bit integer in D?

2016-05-22 Thread Saurabh Das via Digitalmars-d-learn
On Sunday, 22 May 2016 at 09:07:32 UTC, Guillaume Piolat wrote: On Sunday, 22 May 2016 at 07:40:08 UTC, Nicholas Wilson wrote: On Saturday, 21 May 2016 at 09:43:38 UTC, Saurabh Das wrote: I see that 'cent' and 'ucent' are reserved for future use but not yet implemented. Does anyone have a

Re: Is there a 128-bit integer in D?

2016-05-21 Thread Saurabh Das via Digitalmars-d-learn
On Saturday, 21 May 2016 at 21:51:34 UTC, Jonathan M Davis wrote: On Saturday, May 21, 2016 09:43:38 Saurabh Das via Digitalmars-d-learn wrote: I see that 'cent' and 'ucent' are reserved for future use but not yet implemented. Does anyone have a working implementation of these types

Is there a 128-bit integer in D?

2016-05-21 Thread Saurabh Das via Digitalmars-d-learn
I see that 'cent' and 'ucent' are reserved for future use but not yet implemented. Does anyone have a working implementation of these types? Alternatively, is there an any effort towards implementation of arbitrary-sized integers in Phobos? Thanks, Saurabh

Re: The D language online tour - tour.dlang.org

2016-05-17 Thread Saurabh Das via Digitalmars-d-announce
On Monday, 16 May 2016 at 17:32:06 UTC, André wrote: Hi, after another round of polishing, bug fixing, very useful user contributions and suggestions, I'd like to present the new home of the D language online tour: http://tour.dlang.org/ Thank you very much to the D foundation for hosting

Re: Using shorthand *= leads to unexpected result?

2016-05-15 Thread Saurabh Das via Digitalmars-d-learn
On Sunday, 15 May 2016 at 13:25:42 UTC, Michael wrote: Well I'm pretty sure the code was working just fine earlier in the week at the office, but running the code at home with the newest version of DMD started producing these odd results. Typing this function into asm.dlang.org shows a minor

Re: Using shorthand *= leads to unexpected result?

2016-05-15 Thread Saurabh Das via Digitalmars-d-learn
On Sunday, 15 May 2016 at 13:01:45 UTC, Michael wrote: It may be that I'm doing something wrong here, but after updating DMD to the latest version, my simulations started producing some very odd results and I think I've pinpointed it to a sign inversion that I was making. Here is some code

Re: Upcoming appearance

2016-03-27 Thread Saurabh Das via Digitalmars-d-announce
On Saturday, 26 March 2016 at 20:45:49 UTC, Andrei Alexandrescu wrote: I'll be at ACCU teaching a day-long tutorial on D (http://accu.org/index.php/conferences/accu_conference_2016/accu2016_sessions#The_D_Language,_or_The_Art_of_Going_Meta) and delivering a keynote

Re: std.database

2016-03-05 Thread Saurabh Das via Digitalmars-d
On Tuesday, 1 March 2016 at 21:00:30 UTC, Erik Smith wrote: I'm back to actively working on a std.database specification & implementation. It's still unstable, minimally tested, and there is plenty of work to do, but I wanted to share an update on my progress. [...] A little late to the

Re: nanosecond time

2016-02-14 Thread Saurabh Das via Digitalmars-d-learn
On Saturday, 13 February 2016 at 19:24:44 UTC, ishwar wrote: I am stumped on need finding interval between two events in a program execution in nanoseconds. Any sample code will be appreciated (along with imports needed to make it work): - time in nanoseconds-now - do-some processing - time

Re: Is this a bug in std.typecons.Tuple.slice?

2016-02-09 Thread Saurabh Das via Digitalmars-d-learn
On Wednesday, 10 February 2016 at 00:24:56 UTC, tsbockman wrote: [...] `Tuple.slice` is corrupting data *right now*. Some sort of short-term fix should be merged in the next release of D. +1

Re: Does anyone care if Tuple.slice() returns by ref?

2016-02-07 Thread Saurabh Das via Digitalmars-d
On Sunday, 7 February 2016 at 13:13:21 UTC, Ola Fosheim Grøstad wrote: On Sunday, 7 February 2016 at 13:01:14 UTC, tsbockman wrote: That is essentially what my PR does. But, some people are unhappy with the thought of a slice's type not matching the type of the equivalent standard Tuple:

Re: New D book available for pre-order: D Web Development

2016-02-06 Thread Saurabh Das via Digitalmars-d-announce
On Wednesday, 22 July 2015 at 15:29:20 UTC, Kai Nacke wrote: Hi all! Did you notice that development of LDC has been a bit slowly in the past? The reason is my book D Web Development, available now for pre-order: https://www.packtpub.com/web-development/d-web-development [...]

Re: Is this a bug in std.typecons.Tuple.slice?

2016-02-06 Thread Saurabh Das via Digitalmars-d-learn
On Sunday, 7 February 2016 at 02:51:49 UTC, tsbockman wrote: On Sunday, 7 February 2016 at 02:11:15 UTC, Marco Leise wrote: I understand that. We just have a different perspective on the problem. Your priorities: - don't break what's not broken - .slice! lends on opSlice and should return by

Re: Does anyone care if Tuple.slice() returns by ref?

2016-02-06 Thread Saurabh Das via Digitalmars-d
On Sunday, 7 February 2016 at 03:16:48 UTC, tsbockman wrote: (If we go with Saurabh Das' approach, we'll deprecate the old slice() by ref method, so it there won't be any *silent* breakage either way.) Can we keep the old by ref slice() method, but add guards to disallow cases where the

Re: Is this a bug in std.typecons.Tuple.slice?

2016-02-06 Thread Saurabh Das via Digitalmars-d-learn
On Saturday, 6 February 2016 at 08:01:20 UTC, tsbockman wrote: On Saturday, 6 February 2016 at 06:34:05 UTC, Marco Leise wrote: [...] I should also point out that, since there is no way to actually find out whether anyone is using the `ref`-ness of the return type in the wild, the approach

Re: Is this a bug in std.typecons.Tuple.slice?

2016-02-05 Thread Saurabh Das via Digitalmars-d-learn
On Friday, 5 February 2016 at 19:16:11 UTC, Marco Leise wrote: Am Fri, 05 Feb 2016 05:31:15 + schrieb Saurabh Das : [...] That is enlightening. I have updated the PR at https://github.com/D-Programming-Language/phobos/pull/3975 to incorporate these changes.

Is this a bug in std.typecons.Tuple.slice?

2016-02-04 Thread Saurabh Das via Digitalmars-d-learn
This code: void main() { import std.typecons; auto tp = tuple!("a", "b", "c")(10, false, "hello"); auto u0 = tp.slice!(0, tp.length); auto u1 = tp.slice!(1, tp.length); auto u2 = tp.slice!(2, tp.length); static assert(is(typeof(u0) == Tuple!(int, "a", bool, "b",

Re: Is this a bug in std.typecons.Tuple.slice?

2016-02-04 Thread Saurabh Das via Digitalmars-d-learn
On Thursday, 4 February 2016 at 17:52:16 UTC, Marco Leise wrote: https://issues.dlang.org/show_bug.cgi?id=15645 Thank you. I understood why this is happening from your explanation in the bug report.

Re: Is this a bug in std.typecons.Tuple.slice?

2016-02-04 Thread Saurabh Das via Digitalmars-d-learn
On Thursday, 4 February 2016 at 12:28:39 UTC, Saurabh Das wrote: This code: [...] Update: Simplified, this also doesn't work: void main() { import std.typecons; auto tp = tuple(10, false, "hello"); auto u0 = tp.slice!(0, tp.length); auto u1 = tp.slice!(1, tp.length); auto

Re: Is this a bug in std.typecons.Tuple.slice?

2016-02-04 Thread Saurabh Das via Digitalmars-d-learn
On Thursday, 4 February 2016 at 17:52:16 UTC, Marco Leise wrote: https://issues.dlang.org/show_bug.cgi?id=15645 Is this a possible fixed implementation? : @property Tuple!(sliceSpecs!(from, to)) slice(size_t from, size_t to)() @trusted const if (from <= to && to <=

Re: Is this a bug in std.typecons.Tuple.slice?

2016-02-04 Thread Saurabh Das via Digitalmars-d-learn
On Friday, 5 February 2016 at 05:18:01 UTC, Saurabh Das wrote: [...] Apologies for spamming. This is an improved implementation: @property Tuple!(sliceSpecs!(from, to)) slice(size_t from, size_t to)() @safe const if (from <= to && to <= Types.length) {

Re: Is this a bug in std.typecons.Tuple.slice?

2016-02-04 Thread Saurabh Das via Digitalmars-d-learn
On Friday, 5 February 2016 at 05:18:01 UTC, Saurabh Das wrote: [...] PS: Additionally, '@trusted' can now be substituted with '@safe'.

Re: std.typecons.Proxy requires a nothrow destructor and toHash?

2016-02-03 Thread Saurabh Das via Digitalmars-d-learn
On Wednesday, 3 February 2016 at 12:10:01 UTC, Marc Schütz wrote: On Wednesday, 3 February 2016 at 10:16:56 UTC, Saurabh Das wrote: [...] It used to work in 2.066.1; bisecting points to this PR: https://github.com/D-Programming-Language/phobos/pull/3043 When bisecting between 2.066 and

Re: D vs Rust

2016-01-28 Thread Saurabh Das via Digitalmars-d
On Thursday, 28 January 2016 at 22:30:51 UTC, nbro wrote: I have loved C++ when I first started learning it a pair of years ago (then I stopped for some time for some work reasons), and quite recently I have discovered D, which seems apparently a better language from the design point of view,

Re: How should I do object serialization?

2016-01-27 Thread Saurabh Das via Digitalmars-d-learn
On Thursday, 28 January 2016 at 04:27:31 UTC, Enjoys Math wrote: I'm not looking for anything advanced, just serialization of some of my own types (classes & structs). I've seen: http://wiki.dlang.org/Review/std.serialization However, I don't see std.serialization in my dmd source tree:

Re: Speed of csvReader

2016-01-21 Thread Saurabh Das via Digitalmars-d-learn
On Thursday, 21 January 2016 at 14:32:52 UTC, Saurabh Das wrote: On Thursday, 21 January 2016 at 13:42:11 UTC, Edwin van Leeuwen wrote: On Thursday, 21 January 2016 at 09:39:30 UTC, data pulverizer wrote: StopWatch sw; sw.start(); auto buffer =

Re: Speed of csvReader

2016-01-21 Thread Saurabh Das via Digitalmars-d-learn
On Thursday, 21 January 2016 at 13:42:11 UTC, Edwin van Leeuwen wrote: On Thursday, 21 January 2016 at 09:39:30 UTC, data pulverizer wrote: StopWatch sw; sw.start(); auto buffer = std.file.readText("Acquisition_2009Q2.txt"); auto records = csvReader!row_type(buffer, '|').array;

Re: Speed of csvReader

2016-01-21 Thread Saurabh Das via Digitalmars-d-learn
On Thursday, 21 January 2016 at 17:10:39 UTC, data pulverizer wrote: On Thursday, 21 January 2016 at 16:01:33 UTC, wobbles wrote: Interesting that reading a file is so slow. Your timings from R, is that including reading the file also? Yes, its just insane isn't it? It is insane. Earlier

Rust's website is really good

2016-01-15 Thread Saurabh Das via Digitalmars-d
I saw it via Reddit. Since the dlang.org website has been under discussion on this forum, I thought I would bring it up: https://www.rust-lang.org/faq.html https://www.rust-lang.org/ I admire the clean, modern look, simple colours and focus on what's important. The content is very good and

Re: [dlang.org] new forum design - preview

2016-01-15 Thread Saurabh Das via Digitalmars-d
On Friday, 15 January 2016 at 20:33:32 UTC, anonymous wrote: On 13.01.2016 18:13, Saurabh Das wrote: +1 for Sans-serif fonts! I find them much easier to read too :) (anonymous has assured me that this font will grow on me though). I only said it grew on me :) The page is too white. The

Re: [dlang.org] new forum design - preview

2016-01-13 Thread Saurabh Das via Digitalmars-d
On Wednesday, 13 January 2016 at 16:40:20 UTC, Andrei Alexandrescu wrote: On 01/13/2016 11:38 AM, Dmitry wrote: On Wednesday, 13 January 2016 at 14:51:12 UTC, Andrei Alexandrescu wrote: Could you please post a screenshot and also your particulars (OS, browser)? Thx! -- Andrei I don't meant

Using std.conv.to with std.typecons.Typedef

2016-01-11 Thread Saurabh Das via Digitalmars-d-learn
I am trying to create 2 types which contain integral values but should not be compatible with each other. std.typecons.Typedef seems perfect for this: alias QuestionId = Typedef!(long, long.init, "QuestionId"); alias StudentId = Typedef!(long, long.init, "StudentId"); However I'm failing to

Re: Using std.conv.to with std.typecons.Typedef

2016-01-11 Thread Saurabh Das via Digitalmars-d-learn
On Monday, 11 January 2016 at 12:01:30 UTC, Tobi G. wrote: On Monday, 11 January 2016 at 08:03:19 UTC, Saurabh Das wrote: How can I get std.conv to understand std.typecons.Typedef? You can do something like this: QuestionId q = to!(TypedefType!QuestionId)("43"); In general, is there a

Re: Using std.conv.to with std.typecons.Typedef

2016-01-11 Thread Saurabh Das via Digitalmars-d-learn
On Monday, 11 January 2016 at 12:59:05 UTC, Tobi G. wrote: On Monday, 11 January 2016 at 12:15:55 UTC, Saurabh Das wrote: Any ideas? Yes. Because Typedef is introducing new Types, which csvReader doesn't know what they are, you'll need a little workaround and cast the values yourself.

Re: [dlang.org] getting the redesign wrapped up

2016-01-10 Thread Saurabh Das via Digitalmars-d
On Sunday, 10 January 2016 at 22:11:51 UTC, anonymous wrote: On 10.01.2016 19:04, Saurabh Das wrote: What is the canonical way to report bugs on the website? Website bugs go into the same bug tracker as compiler and library bugs: https://issues.dlang.org/ Select "dlang.org" for component.

[your code here]

2016-01-10 Thread Saurabh Das via Digitalmars-d
The D code part on the front page has only 2 examples currently. I thought we should add to that. As per the instructions, I'm posting one sample here for approval: // Find anagrams of words void main() { import std.stdio, std.algorithm; string[][string] anagram_info;

  1   2   >