D 1.076 Alpha for Windows 64 bits, works with VS 2010

2012-09-27 Thread Walter Bright
http://ftp.digitalmars.com/dmd1beta.zip Mainly for those daring folks who want to help develop it further: $(LI 80 bit reals are truncated to 64 bits when formatting.) $(LI Many math functions are not implemented.) $(LI No symbolic debug info is generated.) $(LI

Re: D 1.076 Alpha for Windows 64 bits, works with VS 2010

2012-09-27 Thread Andrej Mitrovic
On 9/27/12, Walter Bright newshou...@digitalmars.com wrote: D will probably not bother with the 64 bit SEH. How come, and what will be the consequences of this? Anyway great work so far!

Re: D 1.076 Alpha for Windows 64 bits, works with VS 2010

2012-09-27 Thread Jacob Carlborg
On 2012-09-27 15:42, Andrej Mitrovic wrote: On 9/27/12, Walter Bright newshou...@digitalmars.com wrote: D will probably not bother with the 64 bit SEH. How come, and what will be the consequences of this? Anyway great work so far! What he said. What about this:

Re: D 1.076 Alpha for Windows 64 bits, works with VS 2010

2012-09-27 Thread David Nadlinger
On Thursday, 27 September 2012 at 15:00:23 UTC, Jacob Carlborg wrote: On 2012-09-27 15:42, Andrej Mitrovic wrote: On 9/27/12, Walter Bright newshou...@digitalmars.com wrote: D will probably not bother with the 64 bit SEH. How come, and what will be the consequences of this? Anyway great

Re: GtkD 2.0 released, Gtk+ 3 with D.

2012-09-27 Thread Mike Wey
On 09/26/2012 08:49 PM, Mike James wrote: Mike Wey wrote in message news:k2isv4$2r67$1...@digitalmars.com... GtkD is a D binding and OO wrapper of Gtk+ and is released on the LGPL license. With 2.0 GtkD will wrap Gtk+ version 3, if you need Gtk+ 2 you can use the latest version from the Gtk2

Re: D 1.076 Alpha for Windows 64 bits, works with VS 2010

2012-09-27 Thread Mike Wey
On 09/27/2012 01:56 PM, bearophile wrote: Walter Bright: http://ftp.digitalmars.com/dmd1beta.zip How do I switch from producing a 32 bit to 64 binary? I am looking for a -b64 or -b32 or similar switch... Bye, bearophile -m32 and -m64 ? i'ts what dmd uses on linux. -- Mike Wey

Re: D 1.076 Alpha for Windows 64 bits, works with VS 2010

2012-09-27 Thread bearophile
Mike Wey: -m32 and -m64 ? i'ts what dmd uses on linux. Are those usable on DMD-Windows64 too? Bye, bearophile

Re: D 1.076 Alpha for Windows 64 bits, works with VS 2010

2012-09-27 Thread Walter Bright
On 9/27/2012 4:56 AM, bearophile wrote: How do I switch from producing a 32 bit to 64 binary? -m64

glfw3 deimos bindings

2012-09-27 Thread David
I made glfw3 bindings (translated the C headers to D): https://github.com/Dav1dde/glfw3 Can someone make a deimos repo?

Re: I'll be at GOTO in Denmark

2012-09-27 Thread Walter Bright
Sure, why not? On 8/31/2012 11:47 AM, Knud Soerensen wrote: Super, the same night the local hacker space (osaa.dk) makes Tech Talk Tuesday. Which consider of short talks (15-30 min.) with technical focus. I was woundering if you would consider giving a short talk about D. Love Knud On

Re: dynamic library building and loading

2012-09-27 Thread Daniel Kozak
Hi, I have same issue, but it is possible make shared library, first of all you have to make shared variant of druntime and phobos library, than it should work ok. Now I am at work, when I come back home I will post some more details about this. Daniel Kozak On Wednesday, 26 September

Re: DIP19: Remove comma operator from D and provision better syntactic support for tuples

2012-09-27 Thread Jacob Carlborg
On 2012-09-27 00:38, bearophile wrote: I have appreciated named fields of D tuples since the beginning, I have found them quite handy. With them sometimes you don't need to unpack a tuple, you can just access its fields with a nice name, avoiding to move around more than one variable. If you

Re: dynamic library building and loading

2012-09-27 Thread Daniel Kozak
Now I try it, and it is not required to build shared variant of druntime and phobos, only rebuild it with -fPIC On Thursday, 27 September 2012 at 06:12:38 UTC, Daniel Kozak wrote: Hi, I have same issue, but it is possible make shared library, first of all you have to make shared variant of

Re: dynamic library building and loading

2012-09-27 Thread Paulo Pinto
On Wednesday, 26 September 2012 at 20:15:35 UTC, nazriel wrote: On Wednesday, 26 September 2012 at 20:10:47 UTC, Michael wrote: Thanks. The loading part is very useful, but I'm still lost when it comes to build the shared library itself. Andrei Program loads dll at runtime using loader

Re: [OT] Was: totally satisfied :D

2012-09-27 Thread Paulo Pinto
On Wednesday, 26 September 2012 at 22:23:00 UTC, Nick Sabalausky wrote: On Wed, 26 Sep 2012 10:37:10 -0700 H. S. Teoh hst...@quickfur.ath.cx wrote: wide images get clipped with no way to unclip them when using the mobile stylesheet (probably the same bug you describe above), etc.. And Apple

Re: LDC blacklisted in Ubuntu

2012-09-27 Thread Iain Buclaw
On 27 September 2012 03:14, Brad Roberts bra...@puremagic.com wrote: On Wed, 26 Sep 2012, H. S. Teoh wrote: On Wed, Sep 26, 2012 at 05:58:08PM -0700, Brad Roberts wrote: [...] I don't know what's involved in getting built-packages into the various distributions. I suspect that a number of

Re: LDC blacklisted in Ubuntu

2012-09-27 Thread Brad Roberts
On 9/27/2012 12:02 AM, Iain Buclaw wrote: On 27 September 2012 03:14, Brad Roberts bra...@puremagic.com wrote: #4 there implies it's a source package, though I could be mis-interpreting you. Is there a path for externally built binary packages? That's fairly counter to the general

Re: dynamic library building and loading

2012-09-27 Thread Johannes Pfau
Am Thu, 27 Sep 2012 08:26:36 +0200 schrieb Daniel Kozak kozz...@gmail.com: Now I try it, and it is not required to build shared variant of druntime and phobos, only rebuild it with -fPIC In the end you'll probably need a shared druntime phobos: Let's say your main app doesn't use

Re: std.math.frexp wrong on ARM

2012-09-27 Thread Johannes Pfau
Am Wed, 26 Sep 2012 17:35:18 +0200 schrieb Don Clugston d...@nospam.com: On 26/09/12 17:13, Johannes Pfau wrote: The frexp test fails on ARM. I think the mask in line 1491 is wrong: https://github.com/D-Programming-Language/phobos/blob/master/std/math.d#L1491 For doubles, the 63 bit is

Re: dynamic library building and loading

2012-09-27 Thread Maxim Fomin
On Thursday, 27 September 2012 at 05:52:44 UTC, Jens Mueller wrote: Maxim Fomin wrote: You can build shared libraries on linux by manually compiling object files and linking them. On windows last time I tries it was not possible. Can you give detailed steps for doing this on Linux? Because

Re: LDC blacklisted in Ubuntu

2012-09-27 Thread Jacob Carlborg
On 2012-09-27 09:02, Iain Buclaw wrote: For #4, yes. Ubuntu is a better platform to approach for externally built binary-only packages. But for debian, you could possibly do something similar to how eg: the flash-plugin installer package works - downloads the tar.gz/zip from an external site,

Re: dynamic library building and loading

2012-09-27 Thread Jacob Carlborg
On 2012-09-27 10:04, Maxim Fomin wrote: On Thursday, 27 September 2012 at 05:52:44 UTC, Jens Mueller wrote: Maxim Fomin wrote: You can build shared libraries on linux by manually compiling object files and linking them. On windows last time I tries it was not possible. Can you give detailed

Re: dynamic library building and loading

2012-09-27 Thread Jens Mueller
Jacob Carlborg wrote: On 2012-09-27 10:04, Maxim Fomin wrote: On Thursday, 27 September 2012 at 05:52:44 UTC, Jens Mueller wrote: Maxim Fomin wrote: You can build shared libraries on linux by manually compiling object files and linking them. On windows last time I tries it was not possible.

Re: dynamic library building and loading

2012-09-27 Thread Maxim Fomin
On Thursday, 27 September 2012 at 08:26:08 UTC, Jacob Carlborg wrote: 1. Does this actually run? If it were non-runnable, I wouldn't posted it. 2. This is statically linked with druntime and Phobos. What happens when you create an executable that links with the D dynamic library?

Re: dynamic library building and loading

2012-09-27 Thread Jacob Carlborg
On 2012-09-27 10:55, Maxim Fomin wrote: If it were non-runnable, I wouldn't posted it. Ok, I see. Solution depends on a problem. I understood Andrei's post that he wanted a .so file or DLL. I told originally that it is possible to make shared libraries on linux. Now I see there is some

Re: DIP19: Remove comma operator from D and provision better syntactic support for tuples

2012-09-27 Thread foobar
On Wednesday, 26 September 2012 at 21:31:13 UTC, Jonathan M Davis wrote: On Wednesday, September 26, 2012 21:54:44 foobar wrote: Library tuples have broken semantics. Tuples supposed to have _structural_ typing which AFAIK can only be correctly implemented in language. import

Re: LDC blacklisted in Ubuntu

2012-09-27 Thread Joseph Rushton Wakeling
On 27/09/12 09:20, Brad Roberts wrote: On reflection, #4 is not going to work for dmd.. neither ubuntu nor debian, nor most distributions are going to be happy with the license situation. Would Debian have a problem with a dmd package in non-free? Would Ubuntu have a problem with it in the

Re: DIP19: Remove comma operator from D and provision better syntactic support for tuples

2012-09-27 Thread foobar
On Wednesday, 26 September 2012 at 23:02:45 UTC, Piotr Szturmaj wrote: Jonathan M Davis wrote: It sounds to me like the reason that structural typing is needed is because Tuple allows you to name its fields, which I've always thought was a bad idea, and which a built-in tuple definitely

Re: Order of evaluation - aka hidden undefined behaviours.

2012-09-27 Thread Alex Rønne Petersen
On 26-09-2012 19:23, Jonathan M Davis wrote: On Wednesday, September 26, 2012 17:12:49 Alex Rønne Petersen wrote: On 26-09-2012 15:34, monarch_dodra wrote: IMO: useful behavior would be if it was explicitly illegal to modify (or modify + read) the same value twice in the same expression. I'd

Re: LDC blacklisted in Ubuntu

2012-09-27 Thread Joseph Rushton Wakeling
On 26/09/12 17:46, David Nadlinger wrote: Joseph, Russel, you seem to be both personally interested in D/LDC and quite knowledgeable about Debian-style packaging. Might I suggest that you think about joining the LDC forces as a package maintainer? It certainly isn't a huge amount of work to do,

Re: dynamic library building and loading

2012-09-27 Thread Daniel Kozak
On Thursday, 27 September 2012 at 09:16:48 UTC, Jacob Carlborg wrote: On 2012-09-27 10:55, Maxim Fomin wrote: If it were non-runnable, I wouldn't posted it. Ok, I see. Solution depends on a problem. I understood Andrei's post that he wanted a .so file or DLL. I told originally that it is

Re: Reference semantic ranges and algorithms (and std.random)

2012-09-27 Thread Joseph Rushton Wakeling
On 25/09/12 18:36, monarch_dodra wrote: Thank you for bringing it up. The problem is indeed as you said, and making the PRNGs references types fixes it. I have a pretty well developed first iteration. I hope that by the end of next week, I'll have something to show. That would be fantastic.

Re: Visula D fails to build after Windows updates

2012-09-27 Thread Richard Webb
On 26/09/2012 15:56, Mike James wrote: Hi, After a recent Windows update cycle the Visual D projects now fail to build - it can't find the D source files - the output from compiler is below. === OPTLINK (R) for

Re: LDC blacklisted in Ubuntu

2012-09-27 Thread Iain Buclaw
On 27 September 2012 11:02, Joseph Rushton Wakeling joseph.wakel...@webdrake.net wrote: On 26/09/12 17:46, David Nadlinger wrote: Joseph, Russel, you seem to be both personally interested in D/LDC and quite knowledgeable about Debian-style packaging. Might I suggest that you think about

Re: LDC blacklisted in Ubuntu

2012-09-27 Thread Joseph Rushton Wakeling
On 27/09/12 12:11, Iain Buclaw wrote: I also managed to royally screw up when going through beginners' packaging instructions for Ubuntu, so I'm not sure I'm the best choice here ... :-\ I'd advise to retrieve the LLVM source package and tailor for LDC instead rather than building from

Re: dynamic library building and loading

2012-09-27 Thread Maxim Fomin
On Thursday, 27 September 2012 at 08:26:08 UTC, Jacob Carlborg wrote: Last time I tried this (on Mac OS X) I got several symbols missing. This was all symbols that are usually pointing to the executable, inserted by the compiler. One of them would be main and symbols like these:

Re: Order of evaluation - aka hidden undefined behaviours.

2012-09-27 Thread Walter Bright
On 9/26/2012 5:04 AM, Timon Gehr wrote: Why should the calling convention have an impact on code semantics? Maximizing performance. The code reads LTR, therefore evaluation should consistently be LTR. The best order is the one that generates the fewest temporaries, and that's the order

Re: LDC blacklisted in Ubuntu

2012-09-27 Thread Iain Buclaw
On 27 September 2012 11:27, Joseph Rushton Wakeling joseph.wakel...@webdrake.net wrote: On 27/09/12 12:11, Iain Buclaw wrote: I also managed to royally screw up when going through beginners' packaging instructions for Ubuntu, so I'm not sure I'm the best choice here ... :-\ I'd advise to

Re: Visula D fails to build after Windows updates

2012-09-27 Thread Richard Webb
Oops, didn't notice that this had already been mentioned in the other copy of the post :-(

Re: DIP19: Remove comma operator from D and provision better syntactic support for tuples

2012-09-27 Thread Jonathan M Davis
On Thursday, September 27, 2012 11:37:10 foobar wrote: I do _not_ want to consider two different _structs_ (nominal types) as the same type. I would like to get correct tuple semantics which means _structural_ typing (I thought I emphasized that enough in the OP). A tuple is defined by its

Re: Order of evaluation - aka hidden undefined behaviours.

2012-09-27 Thread Iain Buclaw
On 27 September 2012 11:38, Walter Bright newshou...@digitalmars.com wrote: On 9/26/2012 5:04 AM, Timon Gehr wrote: Why should the calling convention have an impact on code semantics? Maximizing performance. The code reads LTR, therefore evaluation should consistently be LTR. The best

Re: Function prototype + definition in the same file

2012-09-27 Thread Manu
On 26 September 2012 20:28, Rainer Schuetze r.sagita...@gmx.de wrote: I think this should be allowed, aswell as implementing forward declared enums and structs (IIRC the compiler even has some error messages that suggest that it is intended). As a workaround, you could put your prototypes

Re: DIP19: Remove comma operator from D and provision better syntactic support for tuples

2012-09-27 Thread Steven Schveighoffer
On Wed, 26 Sep 2012 15:54:44 -0400, foobar f...@bar.com wrote: On Tuesday, 25 September 2012 at 21:02:49 UTC, Andrei Alexandrescu wrote: I agree. That's why I want to take the minimum amount of steps to make library tuples work. That minimum amount may be 1, i.e. just implement

Re: Order of evaluation - aka hidden undefined behaviours.

2012-09-27 Thread bearophile
Walter Bright: The best order is the one that generates the fewest temporaries, and that's the order that should be defined for D. Java and Python and C# give a precedent, maybe many programmers expect a behavior like those ones. Bye, bearophile

Re: Ch-ch-changes

2012-09-27 Thread Andrei Alexandrescu
On 9/27/12 1:00 AM, Philippe Sigaud wrote: On Thu, Sep 27, 2012 at 1:30 AM, Andrei Alexandrescu seewebsiteforem...@erdani.org wrote: You are great, too, and would be even greater if you finalized your parser generator and submitted it to Phobos. Most of the questions I get asked at

Re: dynamic library building and loading

2012-09-27 Thread Andrei Alexandrescu
On 9/27/12 2:26 AM, Daniel Kozak wrote: Now I try it, and it is not required to build shared variant of druntime and phobos, only rebuild it with -fPIC Could you please send a troika composed of one dynlib, one loader using it, and a makefile that puts the all together? Thanks much!

Re: Order of evaluation - aka hidden undefined behaviours.

2012-09-27 Thread Timon Gehr
On 09/27/2012 12:38 PM, Walter Bright wrote: On 9/26/2012 5:04 AM, Timon Gehr wrote: Why should the calling convention have an impact on code semantics? Maximizing performance. Optimisations by definition do not have an impact on code semantics. The code reads LTR, therefore evaluation

Re: Order of evaluation - aka hidden undefined behaviours.

2012-09-27 Thread Timon Gehr
On 09/27/2012 01:43 PM, bearophile wrote: Walter Bright: The best order is the one that generates the fewest temporaries, and that's the order that should be defined for D. Java and Python and C# give a precedent, maybe many programmers expect a behavior like those ones. Well, those can

Re: LDC blacklisted in Ubuntu

2012-09-27 Thread David Nadlinger
On Thursday, 27 September 2012 at 10:43:08 UTC, Iain Buclaw wrote: I meant clang. :-) Clang is an entirely different story, because it is built as part of the LLVM source tree/build process, checked out into llvm/tools/clang (at least usually, don't know if it's possible to build it

Re: Ch-ch-changes

2012-09-27 Thread deadalnix
Le 26/09/2012 00:10, Andrei Alexandrescu a écrit : There's quite a few changes that we're very excited about, that I'd love to share to the extent possible. First, we have decided to extend commit rights to Daniel Murphy and Martin Nowak, two heavyweight dmd contributors better known under

Re: dynamic library building and loading

2012-09-27 Thread nazriel
On Thursday, 27 September 2012 at 08:03:34 UTC, Maxim Fomin wrote: On Thursday, 27 September 2012 at 05:52:44 UTC, Jens Mueller wrote: Maxim Fomin wrote: You can build shared libraries on linux by manually compiling object files and linking them. On windows last time I tries it was not

Re: DIP19: Remove comma operator from D and provision better syntactic support for tuples

2012-09-27 Thread foobar
On Thursday, 27 September 2012 at 10:58:12 UTC, Jonathan M Davis wrote: On Thursday, September 27, 2012 11:37:10 foobar wrote: I do _not_ want to consider two different _structs_ (nominal types) as the same type. I would like to get correct tuple semantics which means _structural_ typing (I

Re: LDC blacklisted in Ubuntu

2012-09-27 Thread Joseph Rushton Wakeling
On 27/09/12 12:43, Iain Buclaw wrote: The source package for clang has mostly everything set-up for you. Source deps, Binary deps, etc. I'd imagine the build process would be similar, just a case of replacing the clang sources with ldc, and tweaking the rules file to pick up ldc-specific

Re: dynamic library building and loading

2012-09-27 Thread Jacob Carlborg
On 2012-09-27 12:02, Daniel Kozak wrote: With DMD 2.060 last two points are possible, only first point (Using a shared ...) I dont try I really need to try this when I get home. -- /Jacob Carlborg

HMAC-SHA1

2012-09-27 Thread Daniel Kozak
Hi all, I try to find hmac in phobos, but I dont find anything. Is there some unnoficial library for D which I can use? Daniel Kozak

Re: HMAC-SHA1

2012-09-27 Thread Piotr Szturmaj
Daniel Kozak wrote: Hi all, I try to find hmac in phobos, but I dont find anything. Is there some unnoficial library for D which I can use? Daniel Kozak

Re: HMAC-SHA1

2012-09-27 Thread Piotr Szturmaj
Piotr Szturmaj wrote: Daniel Kozak wrote: Hi all, I try to find hmac in phobos, but I dont find anything. Is there some unnoficial library for D which I can use? Daniel Kozak Oops, I accidentally clicked Send button... You'll find HMAC and SHA here:

Re: LDC blacklisted in Ubuntu

2012-09-27 Thread H. S. Teoh
On Thu, Sep 27, 2012 at 11:46:12AM +0200, Joseph Rushton Wakeling wrote: On 27/09/12 09:20, Brad Roberts wrote: On reflection, #4 is not going to work for dmd.. neither ubuntu nor debian, nor most distributions are going to be happy with the license situation. Would Debian have a problem

Re: LDC blacklisted in Ubuntu

2012-09-27 Thread H. S. Teoh
On Wed, Sep 26, 2012 at 07:14:12PM -0700, Brad Roberts wrote: On Wed, 26 Sep 2012, H. S. Teoh wrote: On Wed, Sep 26, 2012 at 05:58:08PM -0700, Brad Roberts wrote: [...] I don't know what's involved in getting built-packages into the various distributions. I suspect that a number of

Re: LDC blacklisted in Ubuntu

2012-09-27 Thread David Nadlinger
On Thursday, 27 September 2012 at 02:07:32 UTC, Brad Roberts wrote: That works well for packages which are single source tree. The current dmd, druntime, phobos, d-programming-language, tools separation makes that a little more challenging to put together, but not a lot. It's probably worth

Re: LDC blacklisted in Ubuntu

2012-09-27 Thread Jacob Carlborg
On 2012-09-27 11:46, Joseph Rushton Wakeling wrote: Would Debian have a problem with a dmd package in non-free? Would Ubuntu have a problem with it in the multiverse or partner repositories? Doesn't at least Ubuntu proprietary software, like drivers? -- /Jacob Carlborg

Re: LDC blacklisted in Ubuntu

2012-09-27 Thread H. S. Teoh
On Thu, Sep 27, 2012 at 12:20:46AM -0700, Brad Roberts wrote: On 9/27/2012 12:02 AM, Iain Buclaw wrote: [...] For #4, yes. Ubuntu is a better platform to approach for externally built binary-only packages. But for debian, you could possibly do something similar to how eg: the flash-plugin

Re: HMAC-SHA1

2012-09-27 Thread Daniel Kozak
Thanks, old code is good enought :), it works perfectly Daniel Kozak On Thursday, 27 September 2012 at 14:34:07 UTC, Piotr Szturmaj wrote: Piotr Szturmaj wrote: Daniel Kozak wrote: Hi all, I try to find hmac in phobos, but I dont find anything. Is there some unnoficial library for D

Re: LDC blacklisted in Ubuntu

2012-09-27 Thread David Nadlinger
On Thursday, 27 September 2012 at 00:51:29 UTC, Brad Roberts wrote: I have on my personal todo list a few major items (among many others): 1) add support for multiple projects (dmd2 being the only one currently) 2) add packaging of built artifacts for master builds 3) add uploading of

Re: DIP19: Remove comma operator from D and provision better syntactic support for tuples

2012-09-27 Thread David Nadlinger
On Wednesday, 26 September 2012 at 12:20:56 UTC, Dmitry Olshansky wrote: On 25-Sep-12 23:29, kenji hara wrote: My suggestion is very simple. 1. Change all words built-in tuple in the documentation to built-in sequence. Then, in the D language world, we can have clarify name for the built-in

Re: dynamic library building and loading

2012-09-27 Thread Maxim Fomin
On Thursday, 27 September 2012 at 13:00:24 UTC, nazriel wrote: Btw, sorry for OT. What exactly doesn't work in Dpaste? It seems to work fine for me(TM). If those are UI glitches, try pressing F5 2-3 times ;D Dpaste was completely down when I tried to post code. It was in the middle of

Re: LDC blacklisted in Ubuntu

2012-09-27 Thread Sean Kelly
On Sep 27, 2012, at 12:20 AM, Brad Roberts bra...@puremagic.com wrote: On 9/27/2012 12:02 AM, Iain Buclaw wrote: On 27 September 2012 03:14, Brad Roberts bra...@puremagic.com wrote: #4 there implies it's a source package, though I could be mis-interpreting you. Is there a path for

Re: dynamic library building and loading

2012-09-27 Thread Jacob Carlborg
On 2012-09-27 10:55, Maxim Fomin wrote: On Thursday, 27 September 2012 at 08:26:08 UTC, Jacob Carlborg wrote: 1. Does this actually run? If it were non-runnable, I wouldn't posted it. 2. This is statically linked with druntime and Phobos. What happens when you create an executable that

Re: dynamic library building and loading

2012-09-27 Thread Andrei Alexandrescu
On 9/27/12 6:26 AM, Maxim Fomin wrote: [snip] Thanks! I adapted your code as follows and it works with 2.058 on Centos. *** lib.d import std.stdio; extern(C) int fun() { writeln(, world!); return 42; } *** main.d import std.stdio; extern(C) int fun(); void main() { write(Hello);

Re: dynamic library building and loading

2012-09-27 Thread Jacob Carlborg
On 2012-09-27 20:25, Andrei Alexandrescu wrote: On 9/27/12 6:26 AM, Maxim Fomin wrote: [snip] Thanks! I adapted your code as follows and it works with 2.058 on Centos. I seriously doubt that everything is working properly, have a look at my reply to Maxim Fomin:

Re: dynamic library building and loading

2012-09-27 Thread Maxim Fomin
On Thursday, 27 September 2012 at 17:10:07 UTC, Jacob Carlborg wrote: On 2012-09-27 10:55, Maxim Fomin wrote: On Thursday, 27 September 2012 at 08:26:08 UTC, Jacob Carlborg wrote: 1. Does this actually run? If it were non-runnable, I wouldn't posted it. 2. This is statically linked with

Re: dynamic library building and loading

2012-09-27 Thread Andrei Alexandrescu
On 9/27/12 3:37 PM, Maxim Fomin wrote: Posted code doesn't load libraries at runtime, it is just linked to shared libraries. Exactly! (I can't believe I'm starting to get the hang of this...) But what we ultimately need is true dynamic loading of never-seen modules. After the initial test I

Re: LDC blacklisted in Ubuntu

2012-09-27 Thread Russel Winder
On Thu, 2012-09-27 at 07:50 -0700, H. S. Teoh wrote: […] Yeah that's the other way to do it: build your own .deb's, and create an apt repository on dlang.org (or somewhere), then publish the repository URL. Then users can simply add the URL to /etc/apt/sources.list, and they will be able to

Re: LDC blacklisted in Ubuntu

2012-09-27 Thread Russel Winder
On Wed, 2012-09-26 at 17:46 +0200, David Nadlinger wrote: […] Joseph, Russel, you seem to be both personally interested in D/LDC and quite knowledgeable about Debian-style packaging. Might I suggest that you think about joining the LDC forces as a package maintainer? It certainly isn't a

Re: DIP19: Remove comma operator from D and provision better syntactic support for tuples

2012-09-27 Thread ixid
int, string a = 1, hello; int, string foo(double, double a) { return cast(int) (d[0] * d[1]), hello; } This is incompatible with current language specs (or will ends up with highly bizantine rules do define what to do, in a topic where it is already complex). Which parts exactly are

Re: dynamic library building and loading

2012-09-27 Thread Rob T
For me to get C or C++ to run a D function, I had to do the following: // // C/C++ library source // // sample D function from library void foo(int i, int j, int k); // D runtime initialization shutdown void init(); void done(); void bar() {

Re: LDC blacklisted in Ubuntu

2012-09-27 Thread Joseph Rushton Wakeling
On 28/09/12 00:31, Russel Winder wrote: Having a D apt repository remains a good move. In fact isn't there one already? It's contents could be widened to include all deb from D stuff. There certainly used to be, but IIRC it has fallen into disuse. But it's still better to have packages in the

Re: dynamic library building and loading

2012-09-27 Thread Rob T
On Thursday, 27 September 2012 at 07:54:29 UTC, Johannes Pfau wrote: Am Thu, 27 Sep 2012 08:26:36 +0200 schrieb Daniel Kozak kozz...@gmail.com: Now I try it, and it is not required to build shared variant of druntime and phobos, only rebuild it with -fPIC In the end you'll probably need a

Rust and D

2012-09-27 Thread bearophile
Most comparisons between Go and D on Reddit aren't good, but this time there is an almost decent comparison between D and Rust: http://www.reddit.com/r/programming/comments/10k9ao/why_i_think_rust_is_the_language_of_the_future/ I think the most direct competitor of D is going to become Rust

Re: dynamic library building and loading

2012-09-27 Thread Rob T
On Thursday, 27 September 2012 at 19:57:13 UTC, Andrei Alexandrescu wrote: So I think in order to enable true dynamic loading, I'll need to generate PIC for druntime and phobos, and then link liblib.so like this: dmd -fPIC -c lib.d gcc -shared lib.o -o liblib.so -L/path/to/phobos -lphobos2

Re: Dangling if

2012-09-27 Thread Jonathan M Davis
On Friday, September 28, 2012 03:43:13 Andrej Mitrovic wrote: So I just had a bug I thought I'd never have: dpaste.dzfl.pl/5c0ab8b8 It's pretty obvious what's going on from that code snippet. But in a larger codebase where refactoring happens often it's easy to make a mistake of leaving out

Re: Rust and D

2012-09-27 Thread bearophile
From the Reddit thread: Walter: D has the @safe annotation, which prevents unsafe pointer operations. Rust has a statically enforced borrow/lend management system, and other things like memory regions, that make it smarter (and probably harder to use). The Rust type system extends what

Re: Dangling if

2012-09-27 Thread Andrej Mitrovic
On 9/28/12, Jonathan M Davis jmdavisp...@gmx.com wrote: That would make the language whitespace-sensitive, which I would consider a major no-no. I don't know of any use-case where you actually want to use such an if statement. Would you ever allow this to pass a human code-review?: if (bVal)

Re: Dangling if

2012-09-27 Thread Jonathan M Davis
On Friday, September 28, 2012 04:12:46 Andrej Mitrovic wrote: This is a very specific situation that could be handled unless it is too complex to mess with the lexer. If there's an if statement which isn't followed by a block but is followed by a blank line emit a warning. Sounds simple enough

Re: Dangling if

2012-09-27 Thread Bernard Helyer
On Friday, 28 September 2012 at 02:12:20 UTC, Andrej Mitrovic wrote: This is a very specific situation that could be handled unless it is too complex to mess with the lexer. If there's an if statement which isn't followed by a block but is followed by a blank line emit a warning. Sounds simple

Re: Finite state machine in D

2012-09-27 Thread Mirko Pilger
What is the D-way to implement fsm with code generation? you might have a look at ragel: http://www.complang.org/ragel/

Re: About std.ascii.toLower

2012-09-27 Thread Don Clugston
On 20/09/12 18:57, Jonathan M Davis wrote: On Thursday, September 20, 2012 18:35:21 bearophile wrote: monarch_dodra: It's not, it only *operates* on ASCII, but non ascii is still a legal arg: Then maybe std.ascii.toLower needs a pre-condition that constraints it to just ASCII inputs, so

Re: Finite state machine in D

2012-09-27 Thread Druzhinin Alexandr
27.09.2012 14:48, Mirko Pilger пишет: What is the D-way to implement fsm with code generation? you might have a look at ragel: http://www.complang.org/ragel/ I had. It's good but is too fat for my purpose - simple fsm implementation in D without third party's instruments (for simple use).

Re: Finite state machine in D

2012-09-27 Thread Philippe Sigaud
On Thu, Sep 27, 2012 at 10:15 AM, Druzhinin Alexandr n...@digitalmars.com wrote: 27.09.2012 14:48, Mirko Pilger пишет: What is the D-way to implement fsm with code generation? I'm not sure you need code generation. Using D functions literals or closures already gives you a good part of a FSM:

scope as storage class

2012-09-27 Thread Namespace
What is the correct use of scope as storage class? int counter; void foo(scope int a) { counter = a; } void main() { int num = 42; foo(num); }

Re: scope as storage class

2012-09-27 Thread Namespace
My handy has send to soon This code: int counter; void foo(scope int a) { counter = a; } void main() { int num = 42; foo(num); } works fine but I think it should not. So can you explain me the use of scope as a storage class?

Re: scope as storage class

2012-09-27 Thread bearophile
Namespace: int counter; void foo(scope int a) { counter = a; } void main() { int num = 42; foo(num); } works fine but I think it should not. So can you explain me the use of scope as a storage class? Generally such enforcement is not (well) implemented in the dmd front-end

Re: scope as storage class

2012-09-27 Thread Namespace
So you mean this code should give an error? import std.stdio; class A { } A ga; void foo(scope A a) { ga = a; } void main() { A a = new A(); foo(a); }

Re: Runtime termination hook?

2012-09-27 Thread Steven Schveighoffer
On Thu, 27 Sep 2012 08:03:39 -0400, Steven Schveighoffer schvei...@yahoo.com wrote: On Wed, 26 Sep 2012 02:16:31 -0400, Jacob Carlborg d...@me.com wrote: On 2012-09-26 07:37, Sean Kelly wrote: A shared static dtor? Didn't think of that. When exactly are those run?

Re: Runtime termination hook?

2012-09-27 Thread Steven Schveighoffer
On Wed, 26 Sep 2012 02:16:31 -0400, Jacob Carlborg d...@me.com wrote: On 2012-09-26 07:37, Sean Kelly wrote: A shared static dtor? Didn't think of that. When exactly are those run? https://github.com/D-Programming-Language/druntime/blob/master/src/rt/dmain2.d#L319 -Steve

Re: Is it possible to force CTFE?

2012-09-27 Thread Tommi
On Sunday, 10 June 2012 at 10:16:23 UTC, jerro wrote: No, but you could wrap it in a template to force it to always execute at compile time. So, I just realized, I could have just this one convenience template that I can use whenever I want to force an expression to be evaluated at

Re: Finite state machine in D

2012-09-27 Thread Druzhinin Alexandr
27.09.2012 18:15, Philippe Sigaud пишет: I'm not sure you need code generation. Using D functions literals or closures already gives you a good part of a FSM: States are functions, that accept a current 'payload' and return a tuple consisting of another function and the new payload. The

Re: Is it possible to force CTFE?

2012-09-27 Thread bearophile
Tommi: 2) Is it possible to specialize a function based on whether or not the parameter that was passed in is a compile time constant? I am interested in this since some years. I think it's useful, but I don't know if it can be implemented. I don't remember people discussing about this

template condition

2012-09-27 Thread Namespace
Is there any difference between these two code snippets: #1: struct Foo(T : Object) { #2: struct Foo(T) if (is(T == class)) { ? I ask because I prefer option #1, but I see most often in Phobos variant #2.

Re: template condition

2012-09-27 Thread Timon Gehr
On 09/27/2012 03:01 PM, Namespace wrote: Is there any difference between these two code snippets: #1: struct Foo(T : Object) { #2: struct Foo(T) if (is(T == class)) { ? I ask because I prefer option #1, but I see most often in Phobos variant #2. Yes there is: struct S{ Object o;

  1   2   >