Re: Interesting synchronization paradigm: flat combining

2016-05-24 Thread Piotr Szturmaj via Digitalmars-d
On 2016-05-21 16:06, Piotr Szturmaj wrote: https://www.cs.bgu.ac.il/~hendlerd/papers/flat-combining.pdf [2010] "Traditional data structure designs, whether lock-based or lock-free, provide parallelism via fine grained synchronization among threads. We introduce a new synchronization par

Re: Idea: swap with multiple arguments

2016-05-24 Thread Piotr Szturmaj via Digitalmars-d
On 2016-05-24 02:16, H. S. Teoh via Digitalmars-d wrote: On Mon, May 23, 2016 at 04:01:08PM -0400, Andrei Alexandrescu via Digitalmars-d wrote: So swap(a, b) swaps the contents of a and b. This could be easily generalized to multiple arguments such that swap(a1, a2, ..., an) arranges things

Interesting synchronization paradigm: flat combining

2016-05-21 Thread Piotr Szturmaj via Digitalmars-d
https://www.cs.bgu.ac.il/~hendlerd/papers/flat-combining.pdf [2010] "Traditional data structure designs, whether lock-based or lock-free, provide parallelism via fine grained synchronization among threads. We introduce a new synchronization paradigm based on coarse locking, which we call flat

Jai - interesting programming language

2016-03-19 Thread Piotr Szturmaj via Digitalmars-d
https://github.com/BSVino/JaiPrimer/blob/master/JaiPrimer.md Looks like it has some features that D has too, for instance CTFE and default value initialization that can be disabled. Not that it's a superior language, but I like its fresh/innovative approach.

Re: Ddb needs a maintainer

2016-02-15 Thread Piotr Szturmaj via Digitalmars-d-announce
On 2016-02-14 20:48, Eugene Wissner wrote: I think may be we should discuss if we can/should change something in ddb. I think there were some interesting and promising ideas in this discussion. Maybe split the PostgreSQL driver and develop it seperately and use an interface more similar to JDBC.

Ddb needs a maintainer

2016-02-12 Thread Piotr Szturmaj via Digitalmars-d-announce
Ddb is a relational database client for D [1]. Currently it only supports PostgreSQL but is not limited to it. It could be extended to support other backends. Built-in postgres client is a native implementation, that is it does not depend on libpq. Instead it communicates directly with the

Re: std.data.json formal review

2015-07-29 Thread Piotr Szturmaj via Digitalmars-d
W dniu 2015-07-29 o 00:37, H. S. Teoh via Digitalmars-d pisze: On Tue, Jul 28, 2015 at 03:29:02PM -0700, Walter Bright via Digitalmars-d wrote: [...] 3. Stepping back a bit, when I think of parsing JSON data, I think: auto ast = inputrange.toJSON(); where toJSON() accepts an input range

Re: Why aren't you using D at work?

2015-07-15 Thread Piotr Szturmaj via Digitalmars-d
By the way.. does anyone know if Sociomantic accepts remote D jobs?

Re: Overload using nogc

2014-11-23 Thread Piotr Szturmaj via Digitalmars-d
W dniu 2014-11-22 o 17:56, Ary Borenszweig pisze: On 11/21/14, 12:36 AM, Jonathan Marler wrote: Has the idea of function overloading via nogc been explored? void func() @nogc { // logic that does not use GC } void func() { // logic that uses GC } void main(string[] args) // @nogc {

Re: Overload using nogc

2014-11-22 Thread Piotr Szturmaj via Digitalmars-d
W dniu 2014-11-21 o 04:36, Jonathan Marler pisze: Has the idea of function overloading via nogc been explored? void func() @nogc { // logic that does not use GC } void func() { // logic that uses GC } void main(string[] args) // @nogc { // if main is @nogc, then the @nogc version

Re: gchunt v0.1.0 is out!

2014-11-20 Thread Piotr Szturmaj via Digitalmars-d-announce
W dniu 2014-11-11 o 23:38, Dmitry Olshansky pisze: gchunt is a tool is to help D developers identify and keep in check the usage of GC in their projects. So far it just postprocesses D compiler's -vgc output into a nice Wiki table. Results looks like this (Phobos):

Re: Challenge: write a really really small front() for UTF8

2014-03-25 Thread Piotr Szturmaj
W dniu 2014-03-25 11:42, dennis luehring pisze: Am 25.03.2014 11:38, schrieb Nick Sabalausky: On 3/25/2014 4:00 AM, Iain Buclaw wrote: On 25 March 2014 00:04, Daniel N u...@orbiting.us wrote: On Monday, 24 March 2014 at 12:21:55 UTC, Daniel N wrote: I'm currently too busy to submit a

Re: GDC ARM beta #1 (with binary releases!)

2014-03-17 Thread Piotr Szturmaj
W dniu 2014-03-17 15:05, Johannes Pfau pisze: I'm happy to announce the first GDC ARM beta on behalf of the GDC team :) ARM support is now at a point where the automated tests (test suite, unit tests) pass and we're ready for feedback from real world usage. All changes have been fully

Re: ddox-generated Phobos documentation is available for review

2014-03-11 Thread Piotr Szturmaj
W dniu 2014-03-10 04:44, Andrei Alexandrescu pisze: Consider it alpha quality. Please don't announce yet before we put it in good shape. https://github.com/D-Programming-Language/dlang.org/pull/516 http://dlang.org/library Great! Altough, I would exchange title order to like std.xxx module

Re: Lots of low hanging fruit in Phobos

2014-03-08 Thread Piotr Szturmaj
W dniu 2014-03-08 02:09, H. S. Teoh pisze: Having a way to auto-generate input range boilerplate, though, would be really, *really* nice. Coroutine-style code would be ideal. https://github.com/pszturmaj/dgenerators

Re: http://www.rust-ci.org/

2014-02-27 Thread Piotr Szturmaj
On 2014-02-26 05:50, Brad Roberts wrote: Later, Brad Now I've received your email but it seems I can't reply :) Instead, I'm receiving mail delivery error: The mail system bra...@puremagic.com: host mail2.puremagic.com[99.179.5.161] said: 451 4.7.1 Please try again later (TEMPFAIL) (in

Re: http://www.rust-ci.org/

2014-02-26 Thread Piotr Szturmaj
On 2014-02-26 05:50, Brad Roberts wrote: Later, Brad Hi, It's kinda hard to reach you by email, I've sent 3 of them :) Would you like to accept ARM board for auto tester? Please contact me on NG email if you wish.

Re: GUI Editors for D

2014-01-25 Thread Piotr Szturmaj
Steve Teale wrote: On Saturday, 25 January 2014 at 18:09:16 UTC, Tofu Ninja wrote: I use monoD and it is by far the best IDE for D that I have tried, I have tried to mess with Visual D on 3 different occasions but I have never got it working properly and I didn't want to use eclipse either as

Re: symmetric signed types

2014-01-25 Thread Piotr Szturmaj
Timon Gehr wrote: On 01/24/2014 11:33 PM, Walter Bright wrote: ... 2. types do not depend on particular runtime values (the whole notion of static typing would fall apart if it did) http://en.wikipedia.org/wiki/Dependent_type http://en.wikipedia.org/wiki/Refinement_type#Refinement_types

Re: ARM support

2014-01-14 Thread Piotr Szturmaj
Johannes Pfau wrote: Am Mon, 13 Jan 2014 12:25:17 +0100 schrieb Piotr Szturmaj bncr...@jadamspam.pl: Iain Buclaw wrote: QEMU testing is quirky. If your lucky and get it working, don't make any system changes. :o) What do you mean exactly? Saying that, ARM is the only emulation that I've

Re: ARM support

2014-01-14 Thread Piotr Szturmaj
Iain Buclaw wrote: On 14 January 2014 22:36, Piotr Szturmaj bncr...@jadamspam.pl wrote: Johannes Pfau wrote: Am Mon, 13 Jan 2014 12:25:17 +0100 schrieb Piotr Szturmaj bncr...@jadamspam.pl: Iain Buclaw wrote: QEMU testing is quirky. If your lucky and get it working, don't make any system

Re: ARM support

2014-01-13 Thread Piotr Szturmaj
Johannes Pfau wrote: Am Thu, 09 Jan 2014 19:07:17 +0100 schrieb Piotr Szturmaj bncr...@jadamspam.pl: Hello, Answers for GDC: I'm developing embedded system product on ARM9/Linux platform and I wish I could use D and vibe.d for this task. ARMv5 or ARMv4? I tested ARMv5 and that should

Re: ARM support

2014-01-13 Thread Piotr Szturmaj
Iain Buclaw wrote: QEMU testing is quirky. If your lucky and get it working, don't make any system changes. :o) What do you mean exactly? Saying that, ARM is the only emulation that I've gotten working where I've actually built GDC ontop of. For anyone interested: Here are prebuilt

ARM support

2014-01-09 Thread Piotr Szturmaj
Hello, I'm developing embedded system product on ARM9/Linux platform and I wish I could use D and vibe.d for this task. I have couple of questions in this matter: - What is the current status of ARM support? - Does GDC support cross-compiling to ARM? - Is it possible to remote-debug D code on

Re: DUB 0.9.20

2013-12-02 Thread Piotr Szturmaj
Jordi Sayol wrote: El 30/11/13 02:08, Piotr Szturmaj ha escrit: Sönke Ludwig wrote: A fresh DUB release is out. Apart from the usual bug fixes, there are a few considerable changes: Thanks! Have you considered adding a version number to dub help and/or a --version option? $ dub help

Re: DUB 0.9.20

2013-11-29 Thread Piotr Szturmaj
Sönke Ludwig wrote: A fresh DUB release is out. Apart from the usual bug fixes, there are a few considerable changes: Thanks! Have you considered adding a version number to dub help and/or a --version option?

Re: The no gc crowd

2013-10-09 Thread Piotr Szturmaj
On 09.10.2013 14:41, Dicebot wrote: On Tuesday, 8 October 2013 at 22:02:07 UTC, Peter Alexander wrote: Just learn where allocations occur and avoid them during development. This leaves you only with accidental or otherwise unexpected allocations. D is not expected to be a single man project

Re: std.d.lexer performance (WAS: std.d.lexer : voting thread)

2013-10-04 Thread Piotr Szturmaj
Brian Schott wrote: On Thursday, 3 October 2013 at 20:11:02 UTC, Andrei Alexandrescu wrote: I see we're considerably behind dmd. If improving performance would come at the price of changing the API, it may be sensible to hold off adoption for a bit. Andrei The old benchmarks measured total

Re: Bartosz Milewski seems to like D more than C++ now :)

2013-09-20 Thread Piotr Szturmaj
On 20.09.2013 17:28, Andrei Alexandrescu wrote: On 9/20/13 2:36 AM, bearophile wrote: In D it's often better to use std.algorithm/range instead of raw foreach loops (despite probably unlike C++ in D a heavy use of ranges leads to a lower performance, even if you use the LDC2 compiler). Why

Re: Bartosz Milewski seems to like D more than C++ now :)

2013-09-20 Thread Piotr Szturmaj
On 20.09.2013 19:45, Andrei Alexandrescu wrote: On 9/20/13 9:51 AM, Piotr Szturmaj wrote: On 20.09.2013 17:28, Andrei Alexandrescu wrote: On 9/20/13 2:36 AM, bearophile wrote: In D it's often better to use std.algorithm/range instead of raw foreach loops (despite probably unlike C++ in D

Getting function's AST at compile-time

2013-09-15 Thread Piotr Szturmaj
I'm looking for something like __traits(getAST, fn). The AST should represent only run-time (instantiated) code without any compile-time features. How hard it would be to implement this in the frontend? It would enable analysis of code at compile-time (without the need to modify the

Re: [OT] Which IDE / Editor do you use?

2013-09-13 Thread Piotr Szturmaj
On 13.09.2013 21:48, Namespace wrote: Just out of interest. I use Sublime 2, Notepad++ and as IDE currently Mono-D. But I will try this evening VisualD. Real Programmers magnetize programs directly on a HDD.

Re: std.d.lexer: pre-voting review / discussion

2013-09-11 Thread Piotr Szturmaj
On 11.09.2013 20:49, Walter Bright wrote: On 9/11/2013 8:01 AM, Dicebot wrote: std.d.lexer is standard module for lexing D code, written by Brian Schott Thank you, Brian! This is important work. Not a thorough review, just some notes from reading the doc file: 1. I don't like the _ suffix

Re: std.d.lexer: pre-voting review / discussion

2013-09-11 Thread Piotr Szturmaj
On 12.09.2013 01:22, Kapps wrote: On Wednesday, 11 September 2013 at 19:57:28 UTC, Piotr Szturmaj wrote: On 11.09.2013 20:49, Walter Bright wrote: On 9/11/2013 8:01 AM, Dicebot wrote: std.d.lexer is standard module for lexing D code, written by Brian Schott Thank you, Brian

Re: Structs can't be zero bytes in size?

2013-09-03 Thread Piotr Szturmaj
On 03.09.2013 07:51, Walter Bright wrote: On 9/2/2013 9:39 PM, Dylan Knutson wrote: On Tuesday, 3 September 2013 at 04:33:16 UTC, Walter Bright wrote: There were huge debates about this back when the C standard was in development. I don't really want to start that up again :-), I don't

Re: assert() vs. enforce(), invariant() vs. ... ?

2013-09-01 Thread Piotr Szturmaj
On 31.08.2013 22:33, Andrej Mitrovic wrote: On 8/31/13, Piotr Szturmaj bncr...@jadamspam.pl wrote: On 31.08.2013 21:52, Andrej Mitrovic wrote: On 8/31/13, Jacob Carlborg d...@me.com wrote: T delegate (Args) dg = result.__ctor; dg(args); Ah, pretty cool workaround. Then, why not close

Re: Had another 48hr game jam this weekend...

2013-09-01 Thread Piotr Szturmaj
On 01.09.2013 20:19, Iain Buclaw wrote: On 1 September 2013 19:01, Peter Alexander peter.alexander...@gmail.com wrote: Thank you for sharing this experience Manu, I had no idea there were so many issues with D on windows. I primarily use OSX without problems, but have also used it on windows

Re: assert() vs. enforce(), invariant() vs. ... ?

2013-08-31 Thread Piotr Szturmaj
On 31.08.2013 21:52, Andrej Mitrovic wrote: On 8/31/13, Jacob Carlborg d...@me.com wrote: T delegate (Args) dg = result.__ctor; dg(args); Ah, pretty cool workaround. Then, why not close that old bug?

Re: Why I chose D over Ada and Eiffel

2013-08-29 Thread Piotr Szturmaj
W dniu 29.08.2013 15:33, Gour pisze: On Sun, 25 Aug 2013 17:06:27 +0200 bearophile bearophileh...@lycos.com wrote: Probably working even more you can make the D entry a bit more statically safe (eventually you could reach the level of Ada code) but the amount of work and code becomes

Re: DIP44: scope(class) and scope(struct)

2013-08-24 Thread Piotr Szturmaj
H. S. Teoh wrote: I've written up a proposal to solve the partially-constructed object problem[*] in D in a very nice way by extending scope guards: http://wiki.dlang.org/DIP44 Destroy! ;-) I see some possible implementation problem. Using a scope guard in a single function is

Re: std.logger

2013-08-23 Thread Piotr Szturmaj
W dniu 23.08.2013 09:44, Robert Schadek pisze: On 08/23/2013 02:07 AM, Piotr Szturmaj wrote: W dniu 22.08.2013 16:00, Robert Schadek pisze: Docu: http://burner.github.io/phobos/phobos-prerelease/std_logger.html What about specifying log level at runtime, e.g.: // set by the user at runtime

Re: std.logger

2013-08-23 Thread Piotr Szturmaj
W dniu 23.08.2013 11:01, Robert Schadek pisze: On 08/23/2013 10:30 AM, Piotr Szturmaj wrote: ? Any other Logger: auto myCoolLogger = new Logger(); myCoolLogger.logLevel = LogLevel.Critical; For the default Logger: log.logLevel = LogLevel.Info; I see, but isn't separate class instance

Re: std.logger

2013-08-23 Thread Piotr Szturmaj
W dniu 23.08.2013 14:16, Robert Schadek pisze: On 08/23/2013 01:10 PM, Piotr Szturmaj wrote: so if I have a LogLevel variable I want to use: LogLevel myLogLevel; I need to write this: # alternative 1 (possibly wrapped in a function) switch (myLogLevel) { case LogLevel.Info: log.Info

Re: std.logger

2013-08-22 Thread Piotr Szturmaj
W dniu 22.08.2013 16:00, Robert Schadek pisze: Docu: http://burner.github.io/phobos/phobos-prerelease/std_logger.html What about specifying log level at runtime, e.g.: // set by the user at runtime LogLevel userLogLevelForX; log(userLogLevelForX, X); ?

Re: Experiments with emscripten and D

2013-08-20 Thread Piotr Szturmaj
W dniu 21.08.2013 01:43, Ramon pisze: I agree with those who are against it. For a variety of reasons, one of them being that, yes, anything that produces javasc*t does a) recognize js and b) embold and support it. Web pages are/should be about *content* not about eye candy and gadgets.

Re: Experiments with emscripten and D

2013-08-20 Thread Piotr Szturmaj
W dniu 21.08.2013 01:49, Ramon pisze: Ha! Expanding on myself: Have simple web server written in D on the client and then a D-script interpreter in that server. Possibly some minimalist friendly interpreter thingy like Lua too (or optionally). Only problem I see: Does D compile to/for Arm w/

Re: Experiments with emscripten and D

2013-08-17 Thread Piotr Szturmaj
W dniu 17.08.2013 16:42, Gambler pisze: On 8/15/2013 5:55 PM, Piotr Szturmaj wrote: bearophile: Piotr Szturmaj: I have found some related activity from Rust people: https://github.com/mozilla/rust/issues/2235 https://github.com/Yoric/Mozilla-Student-Projects/issues/33 https://mail.mozilla.org

Re: Experiments with emscripten and D

2013-08-17 Thread Piotr Szturmaj
W dniu 17.08.2013 16:42, Gambler pisze: (For example, your gist doesn't work in IE. Not that I use IE normally, but you get my point.) This is because the code was compiled with typed arrays support. It's possible to compile without TA support and then it will work in IE.

Re: Experiments with emscripten and D

2013-08-17 Thread Piotr Szturmaj
W dniu 17.08.2013 23:05, Gambler pisze: On 8/17/2013 12:43 PM, Piotr Szturmaj wrote: W dniu 17.08.2013 16:42, Gambler pisze: On 8/15/2013 5:55 PM, Piotr Szturmaj wrote: bearophile: Piotr Szturmaj: I have found some related activity from Rust people: https://github.com/mozilla/rust/issues

Re: Experiments with emscripten and D

2013-08-17 Thread Piotr Szturmaj
W dniu 18.08.2013 03:58, Adam D. Ruppe pisze: I wonder how hard it would be to write that. Searching the web for kvm though always assumes qemu. No, I want to write a super-small qemu, and I don't care if it can't boot linux. How hard can it be? Someone has written an LLVM backend for DCPU-16

Re: DDT 0.7.0 released

2013-08-16 Thread Piotr Szturmaj
W dniu 16.08.2013 15:32, Bruno Medeiros pisze: On 15/08/2013 22:07, Piotr Szturmaj wrote: W dniu 15.08.2013 21:20, Bruno Medeiros pisze: A new version of DDT - D Development tools is out. The major change is the new parser which is updated to the latest version of D, and is much more robust

Re: DDT 0.7.0 released

2013-08-15 Thread Piotr Szturmaj
W dniu 15.08.2013 21:20, Bruno Medeiros pisze: A new version of DDT - D Development tools is out. The major change is the new parser which is updated to the latest version of D, and is much more robust than the previous one. Full changelog/info here:

Experiments with emscripten and D

2013-08-15 Thread Piotr Szturmaj
This is SDL and std.algorithm code translated to JavaScript with emscripten. I've used the latest git versions of LDC and emscripten (the latter needed some modifications). https://gist.github.com/pszturmaj/6244260 https://gist.github.com/pszturmaj/6244266 I couldn't manage to post it as

Re: Experiments with emscripten and D

2013-08-15 Thread Piotr Szturmaj
W dniu 15.08.2013 23:45, Adam D. Ruppe pisze: On Thursday, 15 August 2013 at 21:36:07 UTC, bearophile wrote: Integration with asm.js too is useful. Doesn't the llvm backend do that automatically now? So ldc should get that too. I thought I read that llvm did in a blog somewhere, but I'm not

Re: Experiments with emscripten and D

2013-08-15 Thread Piotr Szturmaj
bearophile: Piotr Szturmaj: Then open sdl.html in the web browser. It should print sorted and mapped array contents and run simple graphics demo. Very nice. D is meant to run efficiently, but the Web is very important. There are many situations where it could be useful to run D code

Parameterized aliases

2013-08-12 Thread Piotr Szturmaj
Hi D community! What do you think of such templated aliases: template SomeTemplate(T1, T2) { } alias Partial(T) = SomeTemplate!(int, T); alias Specialized = Partial!float; // equivalent to SomeTemplate!(int, float) I think they could be pretty helpful and they should be relatively easy to

Re: Parameterized aliases

2013-08-12 Thread Piotr Szturmaj
W dniu 12.08.2013 23:10, monarch_dodra pisze: On Monday, 12 August 2013 at 20:06:16 UTC, Piotr Szturmaj wrote: Hi D community! What do you think of such templated aliases: template SomeTemplate(T1, T2) { } alias Partial(T) = SomeTemplate!(int, T); alias Specialized = Partial!float

Re: Compile time executable calling?

2013-07-13 Thread Piotr Szturmaj
W dniu 13.07.2013 09:13, Walter Bright pisze: On 7/12/2013 11:52 PM, BLM768 wrote: On Saturday, 13 July 2013 at 04:23:56 UTC, Walter Bright wrote: A big problem with it would be the equivalent of the SQL Injection Exploit. Since the compiler can now execute arbitrary code, someone passing

Re: UDP enhancement

2013-06-30 Thread Piotr Szturmaj
W dniu 01.07.2013 03:35, Jonathan M Davis pisze: On Monday, July 01, 2013 03:22:15 JS wrote: struct Foo { @property int data() { return m_data; } // read property @property int data(int value) { return m_data = value; } // write property private: int m_data; } It would be

Re: Ć Programming Language - Compile C# subset to C, Java, C#, JS, AS, Perl and D

2013-06-17 Thread Piotr Szturmaj
W dniu 17.06.2013 22:47, jerro pisze: That sounded like chia, I don't think that's right. Here's another one http://translate.google.com/#en/sr/%C4%86 Google Translate synthesizes it incorrectly. Ć is spoken as Ci when written alone. It's spoken differently (a little shorter) when used in

Re: simpledisplay.d now works on as 64 bit on X

2013-06-09 Thread Piotr Szturmaj
W dniu 10.06.2013 00:09, bearophile pisze: Delphi has a large and efficient GUI toolkit in the standard library, but I think it's not a good idea to put a GUI toolkit in Phobos. But a little library as simpledisplay is OK. Hmm... What if Lazarus GUI code and/or LCL could be ported to D? I've

Re: simpledisplay.d now works on as 64 bit on X

2013-06-09 Thread Piotr Szturmaj
W dniu 10.06.2013 00:29, bearophile pisze: Piotr Szturmaj: Hmm... What if Lazarus GUI code and/or LCL could be ported to D? I've seen full featured Object Pascal parser in their repository. Maybe it's possible to transcode the source to D ;) Just thinking loud. Even if that's possible, I

Re: The non allocating D subset

2013-06-07 Thread Piotr Szturmaj
W dniu 07.06.2013 07:28, Tyler Jameson Little pisze: This would make D the truely universal language it was intended to be. I'd love to see that! I think that Phobos code that makes allocations can be divided (duplicated) to manual and GC versions. I thought I read somewhere about a marker

Re: The non allocating D subset

2013-06-07 Thread Piotr Szturmaj
W dniu 07.06.2013 17:01, Tyler Jameson Little pisze: On Friday, 7 June 2013 at 14:46:30 UTC, Simen Kjaeraas wrote: On Fri, 07 Jun 2013 16:39:15 +0200, Tyler Jameson Little beatgam...@gmail.com wrote: If the nogc marker could be used to overload functions then Phobos may include both versions

Re: The non allocating D subset

2013-06-02 Thread Piotr Szturmaj
W dniu 01.06.2013 07:45, SomeDude pisze: Following this idea, I believe a fairly large chunk of Phobos could be ported to compile with this minimal D sublanguage, and that one could use the allocating D and its added sugar on top of it. So in the end, the user could decide between working with

Re: Error after installing DMD v2.063

2013-06-02 Thread Piotr Szturmaj
W dniu 02.06.2013 15:05, Gary Willoughby pisze: Hi, I get the following error while running a simple hello world program compiled with the new v2.063 compiler. This is on Ubuntu 12.04. error while loading shared libraries: libphobos2.so.0.63: cannot open shared object file: No such file or

Re: What exactly does @safe mean?

2013-06-01 Thread Piotr Szturmaj
W dniu 01.06.2013 23:55, Jonathan M Davis pisze: The guarantees of @safe hold only so long as there are no holes in it, but any and all holes we find get fixed. Making ref be truly @safe has been a large part of the recent ref discussions, as you can currently get away with doing something like

Re: DConf 2013 Day 2 Talk 3: C# to D by Adam Wilson

2013-05-31 Thread Piotr Szturmaj
W dniu 31.05.2013 19:05, Jonathan M Davis pisze: On Friday, May 31, 2013 13:59:24 Juan Manuel Cabo wrote: About streams: there is some phobos support for streams, though it seems not finalized. Everything stream-related which is currently in Phobos is outdated and unacceptable, so it will be

Re: A simple way to do compile time loop unrolling

2013-05-31 Thread Piotr Szturmaj
W dniu 31.05.2013 16:06, finalpatch pisze: Just want to share a new way I just discovered to do loop unrolling. template Unroll(alias CODE, alias N) { static if (N == 1) enum Unroll = format(CODE, 0); else enum Unroll = Unroll!(CODE, N-1)~format(CODE, N-1); } after

Re: dmd 2.063 released with 260 bugfixes and enhancements

2013-05-30 Thread Piotr Szturmaj
W dniu 30.05.2013 19:16, Simen Kjaeraas pisze: On 2013-05-30, 17:16, Andrei Alexandrescu wrote: For the full story, mosey to the redesigned changelog: http://dlang.org/changelog.html Kudos to Andrej for this. *This* is how a great changelog looks. This is a very pleasant surprise to see

Re: D on next-gen consoles and for game development

2013-05-23 Thread Piotr Szturmaj
W dniu 23.05.2013 20:13, Brad Anderson pisze: @nogc comes to mind (I believe Andrei mentioned it during one of the talks released). [1][2] 1: http://d.puremagic.com/issues/show_bug.cgi?id=5219 2: http://wiki.dlang.org/DIP18 When I started learning D 2 years ago, I read on the D webpage that D

Re: Shameless autopromotion : type safe tagged union in D

2013-05-10 Thread Piotr Szturmaj
W dniu 10.05.2013 14:32, deadalnix pisze: http://www.deadalnix.me/2013/05/10/type-safe-tagged-union-in-d-programming-language/ A trick that I used to use more and more, so I ended up creating a generic solution and wrote an article about it. Here's my try on this:

Re: I wrote a JSON library

2013-05-07 Thread Piotr Szturmaj
W dniu 07.05.2013 16:53, Sean Kelly pisze: I'm not terribly happy with std.json do this is welcome. I do wish that there were a SAX style parser available too though, so I could parse JSON without allocating. You may find this useful: https://github.com/pszturmaj/json-streaming-parser Don't

Re: Attribute inference for auto functions?

2013-04-19 Thread Piotr Szturmaj
W dniu 18.04.2013 16:58, Andrei Alexandrescu pisze: On 4/18/13 2:38 AM, Walter Bright wrote: On 4/17/2013 11:34 PM, deadalnix wrote: On Thursday, 18 April 2013 at 05:59:20 UTC, kenji hara wrote: It will break existing code. int foo() { typeof(return) bar() { return 1; } return bar(); }

Re: Attribute inference for auto functions?

2013-04-19 Thread Piotr Szturmaj
W dniu 19.04.2013 15:43, John Colvin pisze: I like this. It provides a good balance of control and automation. how would template functions be treated with auto(return)? I see no need for special treating of template functions. In this case only return type would be inferred. Programmers

Re: Attribute inference for auto functions?

2013-04-17 Thread Piotr Szturmaj
W dniu 16.04.2013 17:22, Andrei Alexandrescu pisze: There's a discussion that may be of interest to the larger community: https://github.com/D-Programming-Language/dmd/pull/1877 On demand inference FTW! void fn() auto { ... } auto fn() auto { ... }

Re: Attribute inference for auto functions?

2013-04-17 Thread Piotr Szturmaj
W dniu 18.04.2013 04:50, Zach the Mystic pisze: On Thursday, 18 April 2013 at 02:40:42 UTC, Walter Bright wrote: On 4/16/2013 8:22 AM, Andrei Alexandrescu wrote: There's a discussion that may be of interest to the larger community: https://github.com/D-Programming-Language/dmd/pull/1877 What

Re: 'exp' vs 'std'? Forked: Vote for std.process

2013-04-12 Thread Piotr Szturmaj
http://forum.dlang.org/thread/jcksnp$ah8$1...@digitalmars.com My idea was to ship exp branch with phobos so all users could look into new code. Not all users follow github/newsgroups/etc.

Re: 'exp' vs 'std'? Forked: Vote for std.process

2013-04-12 Thread Piotr Szturmaj
W dniu 12.04.2013 17:05, Manu pisze: On 13 April 2013 00:41, Piotr Szturmaj bncr...@jadamspam.pl mailto:bncr...@jadamspam.pl wrote: http://forum.dlang.org/thread/__jcksnp$ah8$1...@digitalmars.com http://forum.dlang.org/thread/jcksnp$ah8$1...@digitalmars.com My idea was to ship exp

ARM Raspberry Pi support status

2013-03-03 Thread Piotr Szturmaj
I know that GDC and LDC can produce ARM code, but what about D runtime - does it work reliably?

Re: Why ranges don't return vectors?

2013-03-01 Thread Piotr Szturmaj
bearophile wrote: Piotr Szturmaj: I know it can't be easy drop-in addition to the current range implementation, but who knows... Time ago I have suggested in this newsgroup that idea, naming it vectorized lazyness, that was mostly ignored: http://web.archiveorange.com/archive/v

Re: Why ranges don't return vectors?

2013-03-01 Thread Piotr Szturmaj
H. S. Teoh wrote: On Fri, Mar 01, 2013 at 03:35:23AM +0100, Chris Cain wrote: On Friday, 1 March 2013 at 01:02:17 UTC, Piotr Szturmaj wrote: Seriously, nobody will ever get performance from single-element iterator/range pattern - this makes CPU stall! There's no reason you can't do

Why ranges don't return vectors?

2013-02-28 Thread Piotr Szturmaj
Seriously, nobody will ever get performance from single-element iterator/range pattern - this makes CPU stall! Anytime you read one byte from typical hard disk, system reads full sector - typically 512 bytes, no more, no less. Anytime you read one byte from memory, CPU loads entire cache line

Re: convert class of in pascal to D.

2013-01-30 Thread Piotr Szturmaj
Piotr Szturmaj wrote: A foo(T : A)() that should be: T foo(T : A)()

Re: convert class of in pascal to D.

2013-01-30 Thread Piotr Szturmaj
Eko Wahyudin wrote: Hi, guys? I'm new in D and I come from pascal. The constructor concept is very different, and it's very confusing for me. I want to create some statement in D which in pascal like this. type TMyObjectAClass = class of TMyObject_A; // number 1 TMyObject_A =

Re: Memory overhead for a fiber?

2012-11-05 Thread Piotr Szturmaj
W dniu 06.11.2012 04:43, Nick Sabalausky pisze: What kind of memory overhead is there for a fiber? At least one PAGESIZE (typically 4KB): https://github.com/D-Programming-Language/druntime/blob/master/src/core/thread.d#L3828

Export statement?

2012-10-16 Thread Piotr Szturmaj
We have: ImportExpression: import ( AssignExpression ) Why not also add this: ExportStatement: export ( AssignExpression, AssignExpression ) Both of the AssignExpressions must evaluate at compile time to a constant string. The text contents of the first string are interpreted as a

Re: Save JSONValue binary in file?

2012-10-12 Thread Piotr Szturmaj
Chopin wrote: Hello! I got this 109 MB json file that I read... and it takes over 32 seconds for parseJSON() to finish it. So I was wondering if it was a way to save it as binary or something like that so I can read it super fast? Thanks for all suggestions :) Try this implementation:

Re: Save JSONValue binary in file?

2012-10-12 Thread Piotr Szturmaj
Chopin wrote: Thanks! I tried using it: auto document = parseJSON(content).array; // this works with std.json :) Using json.d from the link: auto j = JSONReader!string(content); auto document = j.value.whole.array; // this doesn't Error: undefined identifier 'array' If you're sure that

std.digest: can we get rid of start() functions?

2012-10-10 Thread Piotr Szturmaj
And replace them with global reset function: void reset(T)(ref T digest) if (isDigest!T) { digest = T.init; } Current usage: SHA1 sha1; sha1.start(); ... calculate hash sha1.start(); // start again ... calculate hash New usage: SHA1 sha1; ... calculate hash sha1.reset(); // start

Re: std.digest: can we get rid of start() functions?

2012-10-10 Thread Piotr Szturmaj
Marco Leise wrote: Unlike classes, structs don't mandate a ctor call, so in general you need to disguise the constructor as 'start()' 'Create()' or similar, where T.init is not sufficient. I know, but in case of digests their init data is always known at compile time, hence no special

Re: std.digest: can we get rid of start() functions?

2012-10-10 Thread Piotr Szturmaj
H. S. Teoh wrote: Then you could just write: SHA1 sha1; // calculate hash sha1 = SHA1.init; // calculate hash ... In my proposal reset() does exactly the same.

Re: Why are scope variables being deprecated?

2012-10-10 Thread Piotr Szturmaj
Jonathan M Davis wrote: On Thursday, July 26, 2012 21:09:09 Chad J wrote: I keep hearing that scope variables are going away. I missed the discussion on it. Why is this happening? When I read about this, I have these in mind: void someFunc() { // foo is very likely to get stack

Re: Why are scope variables being deprecated?

2012-10-10 Thread Piotr Szturmaj
bearophile wrote: Piotr Szturmaj: It seems that we ended up with a solution that was meant to fix a language builtin but appears to be worse than that. This is true, currently the library solution is worse (more dangerous and more broken) than the precedent built-in feature

Re: Why are scope variables being deprecated?

2012-10-10 Thread Piotr Szturmaj
Jonathan M Davis wrote: On Wednesday, October 10, 2012 17:04:41 Piotr Szturmaj wrote: Jonathan M Davis wrote: On Thursday, July 26, 2012 21:09:09 Chad J wrote: I keep hearing that scope variables are going away. I missed the discussion on it. Why is this happening? When I read about this, I

Re: Why are scope variables being deprecated?

2012-10-10 Thread Piotr Szturmaj
Jonathan M Davis wrote: On Thursday, October 11, 2012 01:24:40 Piotr Szturmaj wrote: Could you give me an example of preventing closure allocation? I think I knew one but I don't remember now... Any time that a delegate parameter is marked as scope, the compiler will skip allocating a closure

Re: CFTE+DevIL=?

2012-10-08 Thread Piotr Szturmaj
Zhenya wrote: Hi! I need to load some textures for my game,but I woud like to do it in compile time. I know that CTFE imposes restrictions on functions.So can I execute some DevIL(Derelict3) functions? CTFE can only evaluate D functions that have their bodies available. It means that external

Re: SQL working [ was Re: The sorry state of the D stack? ]

2012-10-07 Thread Piotr Szturmaj
Russel Winder wrote: On Sun, 2012-10-07 at 00:35 +0200, denizzzka wrote: On Saturday, 6 October 2012 at 12:06:07 UTC, Thomas Koch wrote: - I looked for a PostgreSQL client library. I found small personal hacks and dead projects. https://github.com/denizzzka/dpq2 This is my personal project

Re: SQL working [ was Re: The sorry state of the D stack? ]

2012-10-07 Thread Piotr Szturmaj
Jacob Carlborg wrote: On 2012-10-07 10:55, Russel Winder wrote: Why only PostgreSQL. Shouldn't it also work with MySQL, Oracle, DB2, PervasiveSQL, SQLite3, etc.? From the example I assume that this is just a library for managing connections and that everything else is just string-based SQL

Re: SQL working [ was Re: The sorry state of the D stack? ]

2012-10-07 Thread Piotr Szturmaj
Thiez wrote: On Sunday, 7 October 2012 at 12:39:35 UTC, Piotr Szturmaj wrote: In my prostgres client one may specify field types at compile time. If I had divided the client into two separate layers it would return a Variant[] at first layer, then convert it to user specified tuple

  1   2   3   4   >