Re: dmd 2.063 released with 260 bugfixes and enhancements

2013-05-31 Thread Jacob Carlborg

On 2013-05-30 17:16, Andrei Alexandrescu wrote:

Hello,


We are pleased to announce that dmd 2.063, the reference compiler of the
D programming language, is now available for download for OSX, Windows,
and a variety of Unixen:

http://dlang.org/download.html


The -transition=field flag seems to be undocumented.

--
/Jacob Carlborg


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

2013-06-01 Thread Jacob Carlborg

On 2013-05-31 14:33, Andrei Alexandrescu wrote:

http://www.reddit.com/r/programming/comments/1feem1/dconf_2013_day_2_talk_3_from_c_to_d_by_adam_wilson/


A couple of notes on what's missing in D from C#.

There are other libraries besides from Phobos that contains some of the 
missing functionality.


Tango:

* Several SHA implementations
* Stream based IO
* Modules for manipulating text and Unicode
* Timer/stop watch
* Heap and stack

Source code: https://github.com/SiegeLord/Tango-D2
Docs: http://dsource.org/projects/tango/docs/current/

dcollections may contain some collections needed.

http://www.dsource.org/projects/dcollections

--
/Jacob Carlborg


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

2013-06-02 Thread Jacob Carlborg

On 2013-06-02 00:49, Adam Wilson wrote:


Indeed, but since I was comparing to vanilla C# 4.0 and .NET I figured
it was only fair to compare to DMD 2.062 and Phobos. Once you start
comparing and contrasting third party libraries the scope of the topic
quickly balloons in size. The biggest problem I had in putting this talk
together was deciding what to cut. I ended up leaving about 60% of my
originally planned content on the cutting room floor... I really wanted
to give you guys more!


Yes, sure, for the talk. But if you are actually going to port C# code 
to D I assume, and hope, you would take a practically approach. That is, 
using third party libraries if needed and not saying something like "If 
it's not in Phobos we cannot use it".


--
/Jacob Carlborg


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

2013-06-02 Thread Jacob Carlborg

On 2013-06-01 23:11, Jonathan M Davis wrote:


There are quite a few things that Phobos is still missing, but this isn't one
of them. We have std.datetime.StopWatch (which will probably end up in
std.benchmark when that's finally complete).


I haven't looked in std.datetime lately but I though I heard in the talk 
it was missing. If not, my mistake.


--
/Jacob Carlborg


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

2013-06-05 Thread Jacob Carlborg

On 2013-06-05 05:43, Nick B wrote:


Adam, for your talk you never said what your rational was for
doing this i.e.  what is the downside of Microsoft C# etc..(if
there is one ?).  wWhy go to all this effort ?


He said something like: the programming world isn't just Microsoft. 
Perhaps they like to use some other platform.


--
/Jacob Carlborg


Re: DConf 2013 Day 3 Talk 1: Metaprogramming in the Real World by Don Clugston

2013-06-13 Thread Jacob Carlborg

On 2013-06-11 14:33, Andrei Alexandrescu wrote:

Reddit:
http://www.reddit.com/r/programming/comments/1g47df/dconf_2013_metaprogramming_in_the_real_world_by/


Hackernews: https://news.ycombinator.com/item?id=5861237

Twitter: https://twitter.com/D_Programming/status/344431490257526785

Facebook: https://www.facebook.com/dlang.org/posts/655271701153181

Youtube: http://youtube.com/watch?v=pmwKRYrfEyY

Please drive discussions on the social channels, they help D a lot.


I really don't understand the problem with IDE. He mentions that he's 
not interested in any autocompletion, refactoring or anything like that. 
Basically just syntax highlighting. Most code editors support D these 
days. I also can't believe that just because an editor has support for D 
syntax highlighting will introduce more bugs. So is he saying that all 
editors are bad and crash?


I mostly use TextMate (Mac OS X only) when coding D. Having support for 
D certainly doesn't make it crash more. There are one or two problems 
with TextMate but that has nothing to do with D and are easily 
avoidable. It has crashed once or twice for me but not that many times 
that it's worth bring up like this.


Sublime Text is also a good text editor, available on Mac OS X, Linux 
and Windows. It's fast and stable as far as I'm aware.


--
/Jacob Carlborg


Re: DConf 2013 Day 3 Talk 1: Metaprogramming in the Real World by Don Clugston

2013-06-13 Thread Jacob Carlborg

On 2013-06-13 09:31, Don wrote:


Actually not. I'm just opposed to any work on them right now. The point
is that all of those things are COMPLETELY WORTHLESS if the IDE crashes.
It's not just "a bug". It's an absolute showstopper, and I'm begging the
community to do something about it.
Fix the crashes, and then we can talk.


We have no chance of fixing anything if you don't tell us which IDE's 
are crashing.


Have you used Sublime, does that crash?

--
/Jacob Carlborg


Re: DConf 2013 Day 3 Talk 1: Metaprogramming in the Real World by Don Clugston

2013-06-13 Thread Jacob Carlborg

On 2013-06-13 22:12, Don wrote:


Must not be worse than Notepad. 
I don't have any requirements. I *only* care about stability at this point.
I'm not personally looking for an IDE. I'm more a command line guy.


Give Sublime a try.


D has fifty people contributing to the compiler, but only two or three
working on IDEs. We need a couple more.
And that's really all I'm saying.


I agree.

--
/Jacob Carlborg


Re: DConf 2013 Day 3 Talk 1: Metaprogramming in the Real World by Don Clugston

2013-06-13 Thread Jacob Carlborg

On 2013-06-13 22:42, Walter Bright wrote:


May I present MicroEmacs:

https://github.com/DigitalMars/med


Only Linux and Windows support?

--
/Jacob Carlborg


Re: DConf 2013 Day 3 Talk 1: Metaprogramming in the Real World by Don Clugston

2013-06-13 Thread Jacob Carlborg

On 2013-06-13 21:39, Peter Alexander wrote:


The debugger is the #1 feature I'd miss from my day job if I didn't use
Visual Studio. Feature wise, I'm sure gdb has most if not all VS has,
but in VS everything is just there in front of you, easily usable (you
don't need to consult the manual, or remember archaic commands). Using
gdb vs. Visual Studio feels like trying to do web browsing via the
command line.


LLDB uses a far more consistent and logical structured commands than 
GDB. Although it doesn't support D.


--
/Jacob Carlborg


Re: DConf 2013 Day 3 Talk 1: Metaprogramming in the Real World by Don Clugston

2013-06-13 Thread Jacob Carlborg

On 2013-06-13 22:18, Jonathan M Davis wrote:


The differences between a graphical debugger and gdb are fairly interesting in
that all the basic stuff is just way easier and more pleasant in a graphical
debugger, but gdb has all kinds of advanced stuff that tends to blow graphical
debuggers out of the water in terms of power.

It would probably be best if the two could be properly combined so that all of
stuff that does better graphically is done in a proper graphical debugger, but
you have a command-line interface integrated into it for the more advanced
stuff. You can at least sort of get that with some front-ends to gdb, but their
graphical portion is never as good as it should be IMHO. Visual Studio
definitely wins in that area.


All graphical debuggers I have used (Eclipse, Xcode) are using GDB or 
LLDB as a backend. They all provide a command line for entering commands 
directly.


--
/Jacob Carlborg


Re: DConf 2013 Day 3 Talk 1: Metaprogramming in the Real World by Don Clugston

2013-06-13 Thread Jacob Carlborg

On 2013-06-14 07:48, Johannes Pfau wrote:


Can the visual studio debugger show the contents of registers? I found
this quite useful when debugging unit test failures related to floating
point code in gdc. info float shows the contents of the floating point
stack, status register and control register.

I know gdb is scriptable with python but I never used that.
Batch execution of commands is especially nice when used with dustmite
(https://github.com/CyberShadow/DustMite/wiki/Detecting-a-specific-segfault).


LLDB is pretty advanced as well. The biggest benefit there is the 
integration with the compiler. I've watched some of the WWDC videos and 
you can do pretty cool stuff.


--
/Jacob Carlborg


Re: DConf 2013 Day 3 Talk 1: Metaprogramming in the Real World by Don Clugston

2013-06-13 Thread Jacob Carlborg

On 2013-06-13 16:44, Leandro Lucarella wrote:


I've always use VIM without any problems. Is not what you typically call
an IDE though. I think now some of "our guys" are using Geany moderately
successfully, for sure much better than Ecplise and Mono plugins. IIRC,
the main problem with those huge IDEs were memory usage and death-files
(files that made the IDE crash consistently).

I think there a lot of working advanced editors for D, but IDEs are
quite behind (at least in Linux).


I agree. But he said at the end of the talk that he didn't want 
codecompletion refactoring or anything like that. Now he said he just 
wants something better than Notepad that is stable. If that's your 
requirements then you don't need an IDE, just an editor with syntax 
highlighting for D.


--
/Jacob Carlborg


Re: DConf 2013 Day 3 Talk 2: Code Analysis for D with AnalyzeD by Stefan Rohe

2013-06-13 Thread Jacob Carlborg

On 2013-06-12 19:31, bearophile wrote:


How to annotate throws in ddoct? Do they need to be generated
automatically?


That would be nice. Possibly a macro the compiler knows about so you can 
place it anywhere you want. Or a way to opt it out.



Regarding pre/post conditions, maybe a ddoc macro or switch can be used
to make them appear in the ddoc output on request.


Wouldn't mind having that.


I think the built-in unit test system should be improved, so in _most_
cases there's no need to use a second unittest system.


I agree. But there's a conflict of interest here. Some people like 
output when the tests are running (I do), some don't. Walter likes the 
simplicity of the unit test system.


--
/Jacob Carlborg


Re: DConf 2013 Day 3 Talk 2: Code Analysis for D with AnalyzeD by Stefan Rohe

2013-06-14 Thread Jacob Carlborg

On 2013-06-14 10:58, bearophile wrote:


So I suggested to offer the tools, but not a complete built-in solution.


I agree. You can get quite far with what we have now and library 
support. Perhaps we could have a couple of different implementations in 
druntime that we can choose from.


--
/Jacob Carlborg


Re: DConf 2013 Day 3 Talk 1: Metaprogramming in the Real World by Don Clugston

2013-06-14 Thread Jacob Carlborg

On 2013-06-14 15:37, Leandro Lucarella wrote:


I think, same as Manu said, if/when we were to move to D2 we'll have to 
completely avoid
phobos unless a similar approach is taken in terms of memory allocation.


Tango is available for D2 as well :)

--
/Jacob Carlborg


Re: DConf 2013 Day 3 Talk 2: Code Analysis for D with AnalyzeD by Stefan Rohe

2013-06-15 Thread Jacob Carlborg

On 2013-06-12 14:50, Andrei Alexandrescu wrote:

Reddit:
http://www.reddit.com/r/programming/comments/1g6x9g/dconf_2013_code_analysis_for_d_with_analyzed/


Hackernews: https://news.ycombinator.com/item?id=5867764

Twitter: https://twitter.com/D_Programming/status/344798127775182849

Facebook: https://www.facebook.com/dlang.org/posts/655927124420972

Youtube: http://youtube.com/watch?v=ph_uU7_QGY0


As I understand it, the static analyzer doesn't handle D completely. How 
does it behave/what happens if it encounters something it cannot handle?


--
/Jacob Carlborg


Re: DConf 2013 Day 3 Talk 2: Code Analysis for D with AnalyzeD by Stefan Rohe

2013-06-15 Thread Jacob Carlborg

On 2013-06-14 17:13, Steven Schveighoffer wrote:


With @UDAs, we have a lot of unrealized power for unit tests.

I have asked for ModuleInfo to contain an rtInfo member [1], like
TypeInfo does.  With that, and possibly splitting the unit tests into
individual functions (if not done already, I don't know), you have all
you need to completely re-design the unit testing framework.  It can
even be runtime selectable.


It would also be nice to not have to change the druntime to use RTInfo. 
Is that part of what you're suggesting?


--
/Jacob Carlborg


Re: DConf 2013 Day 3 Talk 1: Metaprogramming in the Real World by Don Clugston

2013-06-15 Thread Jacob Carlborg

On 2013-06-14 23:09, Leandro Lucarella wrote:


Yes, I know. BTW, how many people is using it (if any)? If some could
share the experience it would be appreciated.


I use it :). My experience so far is if you don't take advantage of 
these buffers it can be a bit annoying. The reason is that most 
functions either return T[] or const(T)[]. If you use "string" in the 
rest of your code you cannot easily store a returned value to a "string" 
variable. I guess some of those could be fixed by returning inout(T)[] 
instead.


Otherwise I think it's working good.

--
/Jacob Carlborg


Re: DConf 2013 Day 3 Talk 2: Code Analysis for D with AnalyzeD by Stefan Rohe

2013-06-16 Thread Jacob Carlborg

On 2013-06-15 23:50, Timon Gehr wrote:


It bails out.


I see. That's always the problem when not using a complete compiler. 
Example, in my tool DStep which converts C headers to D modules it 
doesn't handle everything (macros and similar) but it won't bail out and 
continues parsing. That's because it uses a real complete compiler 
(Clang). So I can choose to either give an error and bail out, just skip 
what it cannot handle or output a comment in the translated file.


--
/Jacob Carlborg


Re: DConf 2013 Day 3 Talk 1: Metaprogramming in the Real World by Don Clugston

2013-06-17 Thread Jacob Carlborg

On 2013-06-17 10:39, Regan Heath wrote:


Oh, yes, the ability to capture the compiler output and do a bit of a
parse and jump to error is another top IDE feature IMO.


I have that in TextMate :)

--
/Jacob Carlborg


Re: DConf 2013 Day 3 Talk 2: Code Analysis for D with AnalyzeD by Stefan Rohe

2013-06-17 Thread Jacob Carlborg

On 2013-06-17 16:21, Steven Schveighoffer wrote:


No, currently RTInfo is for types only.  I want to have it work for
modules as well (where unit tests typically live).


I think I understand what you mean now.

--
/Jacob Carlborg


Re: DMD 2.063.2 now up

2013-06-18 Thread Jacob Carlborg

On 2013-06-18 10:41, Walter Bright wrote:

and fixes several reported regressions.

download.dlang.org


No change log? Or is it the same as for 2.063?

--
/Jacob Carlborg


Re: DConf 2013 Day 3 Talk 4: LDC by David Nadlinger

2013-06-19 Thread Jacob Carlborg

On 2013-06-17 14:25, Andrei Alexandrescu wrote:

You know the drill!

reddit:
http://www.reddit.com/r/programming/comments/1gie4b/dconf_2013_ldc_the_llvmbased_d_compiler_by_david/


hackernews: https://news.ycombinator.com/item?id=5892652

facebook: https://www.facebook.com/dlang.org/posts/658638807483137

twitter: https://twitter.com/D_Programming/status/346598441230671873

youtube: http://youtube.com/watch?v=ntdKZWSiJdY


David mentions in the talks that git submodules make it more complicated 
to do merges. I'm not sure I understand why. git submodules are just 
regular repositories that are included in other repositories. One can 
work on these repositories separately, then it shouldn't be much 
difference.


--
/Jacob Carlborg


Re: DConf 2013 Day 3 Talk 4: LDC by David Nadlinger

2013-06-19 Thread Jacob Carlborg

On 2013-06-17 14:25, Andrei Alexandrescu wrote:

You know the drill!

reddit:
http://www.reddit.com/r/programming/comments/1gie4b/dconf_2013_ldc_the_llvmbased_d_compiler_by_david/


hackernews: https://news.ycombinator.com/item?id=5892652

facebook: https://www.facebook.com/dlang.org/posts/658638807483137

twitter: https://twitter.com/D_Programming/status/346598441230671873

youtube: http://youtube.com/watch?v=ntdKZWSiJdY


About the Mac OS X support. Is TLS the only problem on Snow Leopard? 
Have you considered moving the code dealing with TLS from the dynamic 
linker into the executable?


--
/Jacob Carlborg


Re: [Phoronix] D Language Still Showing Promise, Advancements

2013-06-22 Thread Jacob Carlborg

On 2013-06-21 14:11, qznc wrote:


Me too.

The only-thread-local-garbage-collection of Rust is quite interesting in
my opinion. Since many-cores (e.g. Xeon Phi) are coming, a
stop-the-world garbage collector might become unacceptable. If this is a
good solution will be seen (maybe). I certainly do not want D to adopt
this experimental feature. Let them do the research. ;)


The garbage collector in Mac OS X, which has been around for a while, is 
a thread-local collector. It contains a global collector as well for the 
global data.


--
/Jacob Carlborg


D/Objective-C, extern (Objective-C)

2013-06-23 Thread Jacob Carlborg
As some of you might know Michel Fortin created a fork of DMD a couple 
of years ago which add support for using Objective-C classes and calling 
Objective-C method. That is making D ABI compatible with Objective-C.


I have now updated it to the latest version of DMD and druntime. All 
D/Objective-C tests pass and all standard tests pass. I'm planning to 
create a DIP for this and would really like this to be folded into main 
line. For know you can read the design document created by Michel:


http://michelf.ca/projects/d-objc/syntax/

Original project page: http://michelf.ca/projects/d-objc/

My forks:
DMD: https://github.com/jacob-carlborg/dmd/tree/d-objc
druntime: https://github.com/jacob-carlborg/druntime/tree/d-objc
Phobos: standard Phobos, commit f85bd54ef5615986960fdd68ea87c8aaf5c5118d

Currently I have limited bandwidth and cannot upload a pre-compiled 
binary. To compile use the following commands:


cd dmd/src
make -f posix.mak MODEL=32 D_OBJC=1

cd druntime
make -f posix.mak DMD=../dmd/src/dmd MODEL=32 D_OBJC=1

cd phobos
make -f posix.mak DMD=../dmd/src/dmd MODEL=32

Currently D/Objc only works for 32bit. You can use Michel's example 
application, Chocolate, to try it out. It's a bit cumbersome to compile 
without Xcode but it's possible.


http://littoral.michelf.ca/code/d-objc/chocolate-dobjc-a1.zip

--
/Jacob Carlborg


Re: D/Objective-C, extern (Objective-C)

2013-06-24 Thread Jacob Carlborg

On 2013-06-23 23:02, bearophile wrote:


Instead of:
extern (Objective-C)

Is it better to use a naming more D-idiomatic?

extern (Objective_C)


As Simen said, we already have extern (C++). But I can absolutely change 
this if people wants to.



Regarding this syntax:

void insertItem(ObjcObject object, NSInteger value)
[insertItemWithObjectValue:atIndex:];

Is it possible and good to replace it with some UDA?


We could use an attribute. But I don't think it would be possible to use 
an UDA. Currently the compiler doesn't know anything about a particular 
UDA, all UDA's are treated the same. It it's either a built in attribute 
or an UDA. Doing something in between would be a lot harder.



It seems contain some different things/syntax. I don't know how much
Walter&Co will appreciate it.


I would say that it's very little new syntax, surprisingly. But 
semantically there's a lot of new stuff. But the core things are just 
the same as with extern (C), making D ABI compatible with another 
language, Objective-C. I think that this is mostly is a non-breaking 
change. All new keywords are prefix with two underscores, which is 
reserved by the compiler. A lot of stuff only apply for classes/methods 
declared as extern (Objective-C).


* extern (Objective-C) - I wouldn't really consider this new syntax

* [foo:bar:] - New syntax. Does not have to use this exact syntax but 
the functionality it provides is essential.


* Constructors in interfaces - Not really a new syntax. Just allows an 
existing syntax to be used in a new place.


* Foo.class - I guess this technically is new syntax. The only thing 
making this new syntax is the use of keyword. I we really don't want 
this we could rename it to __class or similar.


* __classext - Not implement yet, so that's up for discussion

* String literals - No new syntax. Just an implicit conversion added

* BOOL __selector(NSString) - New syntax. Kind of essential to have.

* Foo.protocolof - Not really a new syntax either. I don't think this is 
as essential as the other features.


* @IBOutlet and @IBAction - Not implemented. This could possibly be 
implemented as dummy UDA's.


* Blocks - Not implemented. I'm wondering if we could use the delegate 
keyword for this. If a delegate is marked as extern (Objective-C) it's a 
block. Or that might perhaps be confusing.


--
/Jacob Carlborg


Re: D/Objective-C, extern (Objective-C)

2013-06-24 Thread Jacob Carlborg

On 2013-06-23 23:12, Walter Bright wrote:


Thank you for reviving this. Please carry on!


Is there a chance we can get this into main line?

--
/Jacob Carlborg


Re: D/Objective-C, extern (Objective-C)

2013-06-24 Thread Jacob Carlborg

On 2013-06-24 14:49, Michel Fortin wrote:


I know it was significant work to make it both play nice with the most
recent OS X linker and port it to the newest DMD code base. Great
achievement.


Thank you for all the help I've got and for you starting with this whole 
project.


--
/Jacob Carlborg


Re: D/Objective-C, extern (Objective-C)

2013-06-24 Thread Jacob Carlborg

On 2013-06-24 15:27, Michel Fortin wrote:


Not necessarily. There's a couple of Objective-C classes that get
special treatment by the compiler (identified by a pragma). One could do
the same for an UDA so the compiler would know where to get that value.
I'd surely have implemented it as an UDA if such a thing existed at the
time.


The thing is that pragmas are tied to the compiler. It knows the 
difference between pragma(foo) and pragma(bar). But for UDA's they are 
all treated the same, there's no difference between @(3), @("asd") and 
@foo from the compiler's point of view (as far as I understand). You 
could implement it as a new attribute (that is, not an UDA), but to 
implement it as an UDA would be a totally new thing.



I'm particularly proud of those string literals. They're way cleaner
than their Objective-C counterparts.  :-)


I agree.


Those too are better than their Objective-C counterpart too as they
carry the argument and return type, making them less error-prone.


Same thing here.


Blocks are reference-counted and don't share the two-pointer layout of a
delegate. I'm not sure it'd be wise to call them delegates. But this
needs some more thinking.


Right, they seem kind of complicated in regards of the struct layout 
it's implemented as. Seems to vary quite much depending on how the block 
is used and how outer variables are referenced.



Finally, there is a couple of features that were added to Objective-C
since then that should be added to the todo list to keep feature parity.
Some of those, if implemented right, could benefit the rest of D too.
For instance: ARC (automatic reference counting) which is becoming a
must in Objective-C.


Yes. There are a couple of new features that D can take advantage of 
without adding new language support. I'm thinking of the simplified 
operator overloading that was added, last year I think. We already have 
operator overloading and can add that to the bindings, no need for 
language support.


If we want to add support for the new literals (numbers, arrays and 
associative arrays) we could do the same thing as we already done for 
strings.


And last, modules that was added this year, D has had that for years :)

--
/Jacob Carlborg


Re: D/Objective-C, extern (Objective-C)

2013-06-24 Thread Jacob Carlborg

On 2013-06-24 19:36, Walter Bright wrote:


Yes, but since I don't know much about O-C programming, the feature
should be labeled "experimental" until we're sure it's the right design.


Absolutely. But there's not that much to design. It's the same with 
extern (C) nothing to design there, just get the ABI correct. Compared 
to extern (C) there are a few additional things that need to be designed.


I suggest you try and read the design document by Michel, then comment 
and ask as much questions as possible.


--
/Jacob Carlborg


Re: D/Objective-C, extern (Objective-C)

2013-06-24 Thread Jacob Carlborg

On 2013-06-24 22:49, Walter Bright wrote:


The difference is I know C intimately.


Fair enough. Please ask any questions and we will try and answer.


I did read it.


Great.

--
/Jacob Carlborg


Re: D/Objective-C, extern (Objective-C)

2013-06-24 Thread Jacob Carlborg

On 2013-06-24 23:26, bearophile wrote:


This change opens a new target of D development (well, it was already
open for the people willing to use a not standard dmd compiler), but it
also introduce some extra complexity in the language, that every D
programmer will have to pay forever, even all the ones that will not use
those features. So such changes need to be introduced with care and
after extensive discussions in the main newsgroup. Probably each one new
thing introduced needs a separate discussion.


I don't think it adds much complexity. If you don't use extern 
(Objective-C) you don't need to learn it.


--
/Jacob Carlborg


Re: D/Objective-C, extern (Objective-C)

2013-06-25 Thread Jacob Carlborg

On 2013-06-25 08:53, Johannes Pfau wrote:


Maybe it's new in dmd but gdc already has an UDA which is recognized by
the compiler:
https://github.com/D-Programming-GDC/GDC/blob/master/libphobos/libdruntime/gcc/attribute.d
https://github.com/D-Programming-GDC/GDC/commit/afb27a0048cbf51d40abc2810b85641d9e9af9dc

The benefit of an UDA is that it does not pollute the global namespace
like a normal attribute would.


Ok, I see. I don't know if that is implemented in DMD, not that I've 
heard of. But implementing this in DMD would be more work and would be 
yet another new feature. Note, I'm not saying I'm against it, I just 
want to limit how many new features are added to increase the chance of 
this getting into main line.


--
/Jacob Carlborg


Re: D/Objective-C, extern (Objective-C)

2013-06-25 Thread Jacob Carlborg

On 2013-06-25 00:39, Steven Schveighoffer wrote:


I think this is largely false.  In order for the new syntax to be valid,
you must use extern(Objective-C).  That would be quite an accident.

Consider that I have never dealt with the COM compatibility (or frankly,
even the extern(C++) compatibility) part of D whatsoever.  Because I've
never implemented IUnknown, or used extern(C++).


I agree, I never used those either.


These features that are enabled by specific syntax are not extra
complexity for D.

Note that TDPL makes no mention of IUnknown or COM compatibility, yet I
have never seen a post on D.learn asking questions about this feature
set unless they were actually looking to write COM code.  In other
words, no accidental enabling (I have seen questions as to why
interfaces are not Objects, and I grudgingly have to point to the
incorrect belief that COM objects cannot be discerned from normal D
objects at compile time).

On the other hand, something like shared and const are pervasive,
because they are core language features, AND because they are used
throughout libraries.

I think it is important to consider the applicability to normal code
when introducing such binding features.  The way this is to be
introduced is the correct level of access -- only enabled with a
specific directive.


Well put, you said it better than I ever could.

--
/Jacob Carlborg


Re: An idea - make dlang.org a fundation

2013-06-25 Thread Jacob Carlborg

On 2013-06-25 06:34, QAston wrote:


---Get a real webdesigner involved


I would say, as long as the web site is written in ddoc, no real web 
designer will be interested.


--
/Jacob Carlborg


Re: D/Objective-C, extern (Objective-C)

2013-06-25 Thread Jacob Carlborg

On 2013-06-25 20:06, Walter Bright wrote:


3. migrating non-ARC code to ARC is error-prone and a major nuisance


Xcode provides refactoring tools to migrate manual reference counting 
and GC code to ARC.



4. non-O-C programs can also benefit from ARC (after all, reliance on
the GC is the perennial dealbreaker for people wanting to migrate high
performance code to D)


Absolutely.

--
/Jacob Carlborg


Re: DConf 2013 Closing Keynote: Quo Vadis by Andrei Alexandrescu

2013-06-25 Thread Jacob Carlborg

On 2013-06-25 11:42, Jonas Drewsen wrote:


I'm a Danish guy so there is a at least one dane using D :)


Tomas Lindquist Olsen, creator of LDC (LLVMDC back then) is Danish, if I 
recall correctly.


--
/Jacob Carlborg


Re: D/Objective-C, extern (Objective-C)

2013-06-25 Thread Jacob Carlborg

On 2013-06-25 22:18, Walter Bright wrote:


Those don't work with D.

Let's do it right the first time, and we won't have migration issues.


Right, forgot to add: "for Objective-C".

--
/Jacob Carlborg


Re: D/Objective-C, extern (Objective-C)

2013-06-26 Thread Jacob Carlborg

On 2013-06-26 10:54, Sönke Ludwig wrote:


I agree. Even though it may not be mentioned in books and many people
may never see the changes, it still *does* make the language more
complex. One consequence is that language processing tools (compilers,
syntax highlighters etc.) get updated/written with this in mind.


I don't think there will require much change for tools (non-compilers). 
I see three "big" changes, non of them are at the lexical level:


extern (Objective-C)
[foo:bar:]
foo.class

Any tool that just deals with syntax highlighting (on a lexical level) 
should be able to handle these changes. Sure, you might want to add a 
special case for "foo.class" to not highlight "class" in this case.



This is why I would also suggest to try and make another pass over the
changes, trying to move every bit from language to library that is
possible - without compromising the result too much, of course (e.g. due
to template bloat like in the older D->ObjC bridge). Maybe it's possible
to put some things into __traits or other more general facilities to
avoid changing the language grammar.


I don't see what could be but in __traits that could help. Do you have 
any suggestions?



On the other hand I actually very much hate to suggest this, as it
probably causes a lot of additional work. But really, we shouldn't take
*any* language additions lightly, even relatively isolated ones. Like
always, new syntax must be able to "pull its own weight" (IMO, of course).


I would say that for anyone remotely interested in Mac OS X or iOS 
development it pull its own weight several times over. In my opinion I 
think it's so obvious it pulls its own weight I shouldn't need to 
justify the changes.


--
/Jacob Carlborg


Re: An idea - make dlang.org a fundation

2013-06-26 Thread Jacob Carlborg

On 2013-06-25 22:19, Andrei Alexandrescu wrote:


Truth be told the designer delivered HTML, which we converted to DDoc.


Ok, I see that "web designer" was properly not the correct word(s). "Web 
developer" is perhaps better. The one who builds the final format.


--
/Jacob Carlborg


Re: An idea - make dlang.org a fundation

2013-06-26 Thread Jacob Carlborg

On 2013-06-25 23:45, Adam D. Ruppe wrote:


For my work sites, I often don't give the designer access to the html at
all. They have one of two options: make it work with pure css, or send
me an image of what it is supposed to look like, and I'll take it from
there.


"web designer" was properly not the best word(s). I would say that 
you're talking about the graphical designer I was talking about the one 
implementing the design, web developer/frontend developer or what to 
call it.


I wouldn't give the graphical designer access to the code either. It 
needs to be integrated with the backend code (which is Ruby or similar) 
anyway, to fetch the correct data and so on.


--
/Jacob Carlborg


Re: An idea - make dlang.org a fundation

2013-06-26 Thread Jacob Carlborg

On 2013-06-26 00:55, Aleksandar Ruzicic wrote:


There is no need for designer to know what DDOC is. For the past few
years I have worked with many designers which had only basic knowledge
about HTML and even less about CSS (most of them don't know anything
about JavaScript but they "know jQuery a bit"). They just give me PSD
and I do slicing and all coding.


Again, "web designer" was not the correct word(s). Something more like 
web developer/frontend developer, who ever writes the final format.



So if any redesign of dlang.org is going to happen I volunteer to do all
coding, so there is no need to look for designer which is comfortable
writing DDOC.


Ok, good.

--
/Jacob Carlborg


Re: DConf 2013 Closing Keynote: Quo Vadis by Andrei Alexandrescu

2013-06-26 Thread Jacob Carlborg

On 2013-06-26 12:16, Leandro Lucarella wrote:


Yeah, right, probably Python and Ruby have only 5k users...


There are companies backing those languages, at least Ruby, to some extent.

--
/Jacob Carlborg


Re: D/Objective-C, extern (Objective-C)

2013-06-26 Thread Jacob Carlborg

On 2013-06-26 13:07, Sönke Ludwig wrote:


I agree, it will only influence tools that include a parser. Few syntax
highlighters parse the code (although *some* do), so this was probably
not the best example.


Absolutely, some even do semantic analyze. Example, the syntax 
highlighter in Eclipse for Java highlights instance variables 
differently from identifiers. Don't know if there's any syntax 
highlighters for D that do this.



Naively I first thought that .class and .protocolof were candidates for
__traits, but actually it looks like they might simply be implemented
using a templated static property:

class ObjcObject {
   static @property ProtocolType!T protocolof(this T)() {
 return ProtocolType!T.staticInstance;
   }
}


So what would ProtocolType do? I think I need to look at the 
implementation of .class and .protocolof. In Objective-C there are 
runtime functions to do the same, I don't know if those would work for D 
as well.



That's of course assuming that the static instance is somehow accessible
from normal D code. Sorry if this doesn't really make sense, I don't
know anything of the implementation details.

The __selector type class might be replaceable by a library type
Selector!(R, ARGS).


Hmm, that might be possible. We would need a trait to get the selector 
for a method, which we should have anyway. But this uses templates 
again. We don't want to move everything to library code then we would 
have the same problem as with the bridge.



It would also be great to have general support for
implicit constructors and make string->NSString and delegate->ObjcBlock
available in the library instead of dedicated compiler special case.


Since strings and delegates are already implemented in the language, 
would it be possible to add implicit conversions for these types in the 
library?



Not sure about constructors in interfaces, they seem a bit odd, but
using "init" instead and letting "new" call that is also odd...


Using "alloc.init" would be more Objective-C like and using "new" would 
be more D like.



You already mentioned @IBAction and @IBOutlet, those can obviously be
UDAs, as well as @optional and other similar keywords.


The compiler will need to know about @optional. I don't think that the 
compiler will need to know about @IBAction and @IBOutlet, but if it 
does, there are a couple of advantages we could implement. @IBOutlet 
only make sense on instance variables. @IBAction only make sense on 
instance method with the following signature:


void foo (id sender) { }

Possibly any Objective-C type could be used as the argument type.


Maybe it's possible like this to reduce the syntax additions to
extern(Objective-C) and possibly constructors in interfaces.


I'm open to suggestions.


I don't mean the additions as a whole of course, but each single
language change vs. a library based solution of the same feature ;) In
general this is a great addition from a functional view! I was very much
looking forward for it to get back to life.


Great. It's just a question of what is possible to implement in library 
code.


--
/Jacob Carlborg


Re: DConf 2013 Closing Keynote: Quo Vadis by Andrei Alexandrescu

2013-06-26 Thread Jacob Carlborg

On 2013-06-26 15:18, Joseph Rushton Wakeling wrote:


They don't own them, though -- they commit resources to them because the
language's ongoing development serves their business needs.


Yes, exactly.

--
/Jacob Carlborg


Re: D/Objective-C, extern (Objective-C)

2013-06-29 Thread Jacob Carlborg

On 2013-06-23 22:24, Jacob Carlborg wrote:

As some of you might know Michel Fortin created a fork of DMD a couple
of years ago which add support for using Objective-C classes and calling
Objective-C method. That is making D ABI compatible with Objective-C.

I have now updated it to the latest version of DMD and druntime. All
D/Objective-C tests pass and all standard tests pass. I'm planning to
create a DIP for this and would really like this to be folded into main
line. For know you can read the design document created by Michel:


I have created a proper DIP for this now. The DIP is basically Michel 
Fortin's original designed document properly formatted and put next to 
the other DIP's.


DIP link: http://wiki.dlang.org/DIP43
Thread for the DIP: 
http://forum.dlang.org/thread/kqmlm7$1kfi$1...@digitalmars.com#post-kqmlm7:241kfi:241:40digitalmars.com


--
/Jacob Carlborg


Re: DScanner is ready for use

2013-07-28 Thread Jacob Carlborg

On Sunday, 28 July 2013 at 12:49:34 UTC, Dicebot wrote:


Awesome! I hope it won't be forgotten by the time I need it :)

By the way, how far is that "std.d.*" stuff from ongoing Phobos 
inclusion review?


I suppose currently it does not do any semantical analysis? How 
hard it would be to implement dmd warnings on top of dscanner 
instead?


I don't think it's necessary for semantic analysis to be included 
in Phobos. It's enough to start with a lexer, then later add a 
parser and semantic analysis.


--
/Jacob Carlborg


Re: monarch dodra granted write access to phobos, druntime, and tools

2013-07-28 Thread Jacob Carlborg
On Saturday, 27 July 2013 at 11:14:06 UTC, Joseph Rushton 
Wakeling wrote:


So, I'd propose that if possible the review process include a 
way for reviewers to explicitly indicate, "This pull request is 
provisionally approved subject to testing."


Github supports tags. I don't know if it's possible to use tags 
when issues are disabled though.


--
/Jacob Carlborg



Re: stop to maitain rpm

2013-08-12 Thread Jacob Carlborg

On 2013-08-12 12:38, Russel Winder wrote:


Currently GDC is in Debian, but I have to get DMD from a private Debian
repository instead of the official one, and I build LDC myself because
the Debian package is too old. This measn having to have three versions
of all the libraries and packages because each compiler requires it's
own. This sort of situation is well supported via platform packaging and
currently seems unsupported completely via D-specific things – but I may
be missing something.


DVM installs each compiler in its own directory. Although you have to 
manually put libraries and imports in the correct directories. It also 
currently only supports DMD.


--
/Jacob Carlborg


Re: Darwin 32 release broken (in uni.d)

2013-08-12 Thread Jacob Carlborg

On 2013-08-12 15:57, monarch_dodra wrote:

It looks like the darwin 32 release is broken at the phobos unittest
stage. It would appear the breakage is in the uni.d debug step:
make[1]: *** [generated/osx/debug/32/unittest/std/uni] Segmentation
fault: 11

I don't think it is the new uni module that is responsible, since it
worked fine when it was merged.

I haven't pinned down which pull triggered the breakage, but I figure
the first step to getting the release fixed is to announce it as broken.
Or I should file a report instead?


It should be reverted now. I change the compiler from GCC to Clang, 
apparently that didn't work out. Walter did fix a bunch of warnings tough :)


--
/Jacob Carlborg


Re: DDT 0.7.0 released

2013-08-16 Thread Jacob Carlborg

On 2013-08-15 21:20, Bruno Medeiros wrote:

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:
https://groups.google.com/d/msg/ddt-ide/z9ggxfCKR6M/3YrkjusZRfYJ

Note that Juno and Kepler versions of Eclipse are not supported if they
contain DLTK. If you wanna use Juno/Kepler, download a package without
DLTK. Supported for the latest versions of DLTK will be added in the
future.


I downloaded the standard version of Kepler. Then I followed the 
installation instructions. But after the restart I don't see anything 
related to DDT/D in the preferences.


--
/Jacob Carlborg


Re: DDT 0.7.0 released

2013-08-18 Thread Jacob Carlborg

On 2013-08-17 14:49, Bruno Medeiros wrote:


Someone else had a similar problem, a good guess is that you're running
with a 1.6 JVM, you need a 1.7 JVM.


I did install a 1.7 JVM, although I never verified that it's actually 
1.7 that is used. I'll have to check that.


--
/Jacob Carlborg


Re: DDT 0.7.0 released

2013-08-19 Thread Jacob Carlborg

On 2013-08-16 15:12, Bruno Medeiros wrote:


Very strange! (that it completes the install, but doesn't start properly)
Let me see your configuration log, it's at:
Help > About Eclipse > Installation Details > Configuration
And also the Error log, it's at "View Error Log" on that same dialog.


Here's the log:

http://pastebin.com/M6G76Mjv

I'm suspecting it doesn't use the correct JRE. I tried to force Eclipse 
use 1.7 but I doesn't seem to work.


--
/Jacob Carlborg


Re: Arch Linux D news digest

2013-08-26 Thread Jacob Carlborg

On 2013-08-25 21:11, Dicebot wrote:


Yes, that is correct. I have a legitimate reasons to move any D
package from  AUR to [community] once it reaches 10 votes. Please
don't forget to vote! At least tools like `dub` and `dstep`, in
my opinion, are prime candidates for inclusion ;)


I was about to tag dstep for a new release but I wanted to make a proper 
release as well, providing pre-compiled binaries and so on. 
Unfortunately I haven't been able to produce a working binary on Linux 
32bit, which is weird since it only worked on 32bit before. It segfaults 
some where inside libclang.


I've moved from Ubuntu to Debian in the hope of better binary 
compatibility, I'm wondering if that's the reason.


--
/Jacob Carlborg


Re: Unit Threaded - a unit testing library for D

2013-08-27 Thread Jacob Carlborg

On 2013-08-27 18:59, Dicebot wrote:


By the, way, can we currently in 2.064 attach UDA's to unittest blocks?
Together with getUnitTest that will allow to have same test code base
that acts in both "old-school" mode and gets used by some fancy
introspection library.


Yes, and unit tests for CTFE:

http://forum.dlang.org/thread/ks1brj$1l6c$1...@digitalmars.com

--
/Jacob Carlborg


Re: DCD: Autocomplete without the IDE

2013-09-01 Thread Jacob Carlborg

On 2013-09-01 12:58, Brian Schott wrote:

* What is it?
DCD is a client and server program that work together to provide
autocomplete suggestions and function call tips to almost any text
editor that supports scripting or plugins.


* Anything new since you last time you announced it?

* How does one best handle starting and stopping of the server?

--
/Jacob Carlborg


Re: DCD: Autocomplete without the IDE

2013-09-02 Thread Jacob Carlborg

On 2013-09-02 09:07, Brian Schott wrote:


"dcd-client --shutdown" will shut down the server.


Well, I'm mean from within the text editor. Is the user expected to run 
this when quitting the editor?


--
/Jacob Carlborg


Re: DDT 0.7.0 released

2013-09-02 Thread Jacob Carlborg

On 2013-08-17 14:49, Bruno Medeiros wrote:


Someone else had a similar problem, a good guess is that you're running
with a 1.6 JVM, you need a 1.7 JVM.


I finally managed to get it to work by uninstalling Java 1.6, installing 
1.7 and then trick Mac OS X to think that the 1.7 version was 1.6. 
Thanks for the help.


--
/Jacob Carlborg


Re: specd - write more expressive unit tests

2013-09-02 Thread Jacob Carlborg

On 2013-09-02 21:03, jostly wrote:

specd is a DSL library allowing you to write more expressive unit tests.
It is inspired by projects like specs2 and ScalaTest from the Scala world.

Example:

 unittest {
 describe("a string")
 .should("have a length property", "foo".length.must.equal(3));
 }

Features:
* DSL for expressing unit tests as specifications
* Verify with "must" instead of assert
* Report successful / failed tests using green / red paradigm

Available as a dub dependency ("specd") or from
https://github.com/jostly/specd

Comments and suggestions for improvement are welcome!


I've been working on something similar myself.

https://github.com/jacob-carlborg/dspec

I'm working on a new syntax using UDA's, shown here:

https://github.com/jacob-carlborg/phobos/blob/serialization/std/serialization/tests/array.d

--
/Jacob Carlborg


Re: DDT 0.7.0 released

2013-09-02 Thread Jacob Carlborg

On 2013-09-02 18:55, Bruno Medeiros wrote:


Hum, I didn't know it was that much of a pain to use Java 1.7 on a Mac.
If I had known I might have delayed the DDT version requirements bump,
but now it's too late as it's way down the road, there is a lot of 1.7
use already.

And regardless, it shouldn't be that much of a pain to put a newer
version of Java. Version 1.7 has been out for quite some time. But it
does seem Mac OS X is quite fussy about it:
http://docs.oracle.com/javase/7/docs/webnotes/install/mac/mac-jdk.html


I uninstalled 1.6 and then installed 1.7. Then when I started Eclipse 
Mac OS X says I need to install Java.



I don't if this might have helped, but you can specify to Eclipse which
JVM to use:
http://wiki.eclipse.org/Eclipse.ini
This means you don't have to use the default JVM but another installed one.


I tried that, doesn't work. It just adds it's own "-vm" flag, overriding 
mine.


--
/Jacob Carlborg


Re: DCD: Autocomplete without the IDE

2013-09-02 Thread Jacob Carlborg

On 2013-09-03 00:20, Brian Schott wrote:


That's something that the editor plugin can call on shutdown. DCD pretty
much requires that the editor support scripting.


I was looking in to adding this to TextMate. But the easiest solution 
would most likely be using bundles. In TextMate that's basically a 
script that gets executed when a hotkey is pressed. I mean, I can't 
really start and stop the sever each time the users press that key.


TextMate supports plugins as well, kind of. But it's quite cumbersome to 
write. I hasn't a real API, one uses method swizzling and observers to 
implement a plugin. It's a lot easier now when TextMate 2 is open source.


It also seems a bit unnecessary to have the server running as soon as 
the user opens TextMate. He/she might not even use the editor for D this 
time.


--
/Jacob Carlborg


Re: DDT 0.7.0 released

2013-09-03 Thread Jacob Carlborg

On 2013-09-03 13:14, Bruno Medeiros wrote:


I'm sure there must be a better way. But I can't help you there much, I
have no expertise in Max OS X (I only use Windows, or to a lesser
degree, Linux)


I agree, but this was the only solution that I could find that worked. I 
think someone has reported a bug with the "-vm" flag or about running 
Eclipse with Java 1.7 on Mac OS X.


--
/Jacob Carlborg


Re: DDT 0.7.0 released

2013-09-03 Thread Jacob Carlborg

On 2013-09-03 18:12, Bruno Medeiros wrote:


Hum, have you tried adding the -vm flag to a shortcut to the Eclipse
executable (instead of modying the .ini file)?
All flags specified in the command to the eclipse executable are
supposed to override the .ini file ones.


I have it already working. I don't want to mess anything up now.

--
/Jacob Carlborg


Re: Little demo of allowing basic types to implement interfaces.

2013-09-04 Thread Jacob Carlborg

On 2013-09-04 13:01, Rory McGuire wrote:

yip, :) can't think of a reason except it was interesting. wish dmd
didn't segfault when I used __MODULE__.

on the plus side the requirement for a non basic type is the same
requirement that #golang has on its interfaces.


Do you have a module declaration?

--
/Jacob Carlborg


Re: Little demo of allowing basic types to implement interfaces.

2013-09-04 Thread Jacob Carlborg

On 2013-09-04 13:57, Rory McGuire wrote:

Thanks! a module declaration gets around that one.
http://dpaste.dzfl.pl/cff0ca5a line 21


I think this should already be fixed in git HEAD.

--
/Jacob Carlborg


Re: specd - write more expressive unit tests

2013-09-04 Thread Jacob Carlborg

On 2013-09-04 19:38, jostly wrote:


Looks interesting. I hadn't heard of the UDA's before, they seem quite
powerful from a brief glance.


Very simple but very powerful. It's basically way to tag symbols with 
values/types.


--
/Jacob Carlborg


Re: DCD: Autocomplete without the IDE

2013-09-08 Thread Jacob Carlborg

On 2013-09-07 13:23, David wrote:


I wrote the Kate/Kwrite/Kdevelop Plugin. I recommend you to let the
server running all the time anyways (start it with X e.g.), since
processing phobos alone takes quite some time. If you power up the
editor you don't wanna wait a few minutes until DCD is done and can
answer the requests. Also, if you start multiple sessions, you want only
one server running (the K* Plugin won't start multiple servers anyways
because it has a fixed port).


Ok. As long as there won't be any conflicts or extra processing of files 
not used.


--
/Jacob Carlborg


Re: VisualD now on github.com/d-programming-language

2013-09-11 Thread Jacob Carlborg

On 2013-09-10 20:10, Rainer Schuetze wrote:


Thanks for pointing these out. The README didn't receive a lot of
attention lately, most of the documentation and news is on the web site.
I agree, with it being displayed on the front github page it should be
updated.


Rename it to README.md and you can use Github markdown to have a nicely 
formatted readme.


--
/Jacob Carlborg


Re: [OT] My C++ talk at GoingNative 2013

2013-09-12 Thread Jacob Carlborg

On 2013-09-10 14:54, Olivier Grant wrote:

First of all, I very much enjoyed the talk. It was as interesting as it
was entertaining.


Yes, I enjoyed it as well.


I do have a question regarding the talk's section on devirtualization.
As a language that imposes virtual methods for classes, how well does D
play when it comes to devirtualization? And on a side note, does D have
a different way of implementing virtual methods than most C++ compilers do?


In D it seems that currently the preferred way to compile a project is 
to compile all the source at once using RDMD or similar. Isn't that a 
great opportunity for full program analysis to do devirtualization?


--
/Jacob Carlborg


Re: [OT] My C++ talk at GoingNative 2013

2013-09-14 Thread Jacob Carlborg

On 2013-09-13 09:40, Mathias LANG wrote:


It may be a trend, but I hope it will never become D's official
approach, because it doesn't scale. This would left out all the
people that use the object-file based approach (and related
tools, like Makefiles), which is dominant in the Linux world, and
is required in some cases (limited hardware, distributed
compiling, or simply huge projects).


D supports separate compilation, object files and libraries. I don't 
think it will ever stop supporting that.


--
/Jacob Carlborg


Re: DCD: Autocomplete without the IDE

2013-09-15 Thread Jacob Carlborg

On 2013-09-01 12:58, Brian Schott wrote:

* What is it?
DCD is a client and server program that work together to provide
autocomplete suggestions and function call tips to almost any text
editor that supports scripting or plugins.


I'm thinking about adding support for this to TextMate. But as soon as 
one adds this to an editor a bunch of new issues appears, which I'm 
trying to figure out.


* When to start/stop the server. I'm, at least as a start, going to try 
and implement this as a bundle command and not a plugin. A bundle 
command basically is a script that is run when a key is pressed


* How to deal with import paths? TextMate doesn't have any kind of build 
configuration. I need to be able to specify, except for the current 
project, the path to the standard library and possibly paths for other 
projects. I have an idea how to do this, using custom keys in the 
project specific settings, but I'm wondering how this is solved in other 
editors.


* How to deal with multiple sessions/projects? Should I have one server 
running per session/project? Say I have two different projects, both 
with the symbol "foo.bar". I don't want those to cause conflicts.


--
/Jacob Carlborg


Re: DCD: Autocomplete without the IDE

2013-09-15 Thread Jacob Carlborg

On 2013-09-15 23:41, Brian Schott wrote:


I start and stop the server manually. I know that this should be
improved, but there are a few other things that I'd like to focus on first.


Ok, I can probably add this to a menu.



Things such as the standard library location can be placed in
$XDG_CONFIG_HOME/dcd/dcd.conf or $HOME/.config/dcd/dcd.conf on Linux or
BSD, or dcd.conf (in the same directory as the server executable) on
Windows. The server reads this on startup and caches all .d and .di
files that it finds in the paths in that file.


Ok, I see. But a user needs to be able use different compilers for 
different projects. I'll see if I can use the project specific settings 
and fall back on dcd.conf.



Symbols are filtered by the import statements that are contained in the
text that you send to dcd-client, so there shouldn't be a conflict. If
you have multiple foo backages each with a bar module, then it'll
probably break.


So ideally one server per session/project. That won't conflict, right? I 
can just use different ports?


--
/Jacob Carlborg


Re: DUnit: Advanced unit testing toolkit.

2013-09-22 Thread Jacob Carlborg

On 2013-09-21 02:40, Gary Willoughby wrote:

DUnit: Advanced unit testing toolkit.

I've needed this for a project i've been working on so i created a
toolkit that i'm using and happy with. I must thank the community here
for helping me with a few issues along the way (mostly due to poor
documentation). It uses a lot of compile time reflection to generate the
mocks, which has been very interesting to learn/write (to say the least).

I think it's useful enough now to release and it would be nice to
perhaps receive some guidance as to where it should improve or fails
spectacularly.

Wikipedia: http://en.wikipedia.org/wiki/Unit_testing

DUnit: https://github.com/kalekold/dunit

See examples and documentation for usage.

Have fun.


You might want to use alternatively you could use "version(unittest)" 
instead of "debug" for the mocks. Don't know which is better.


--
/Jacob Carlborg


Re: DUnit: Advanced unit testing toolkit.

2013-09-24 Thread Jacob Carlborg

On 2013-09-23 18:40, jostly wrote:


I think it's great to see the D unit testing ecosystem growing. Since
it's still relatively small, I think we have a good chance here to
create interoperability between the different frameworks.

As I see it, we have:

1. Running unit tests

This is where D shines with the builting facility for unit tests.
However, it suffers a bit from the fact that, if we use assert, it will
stop on the first assertion failure, and there is (as far as I've been
able to tell) no reliable way to run specific code before or after all
the unit tests. If I'm wrong on that assumption, please correct me, that
would simplify the spec running for specd.

In specd, the actual code inside the unittest { } sections only collect
results, and the reporting is called from a main() supplied by compiling
with version "specrunner" set. I haven't checked to see if your dunit do
something similar.


Agree. I only see the unittest blocks as a place to but the asserts, 
since it's not possible to put them at module level.


It's possible to implement you're own unit test handler. See:

https://github.com/D-Programming-Language/druntime/blob/master/src/core/runtime.d#L290

It's also possibly to set the assert handler:

https://github.com/D-Programming-Language/druntime/blob/master/src/core/exception.d#L368

But you most likely want to throw some kind of exception anyway. Because 
if an assertion is triggered in a unit test block you most likely want 
to end that unit test block, immediately.


--
/Jacob Carlborg


Re: DUnit: Advanced unit testing toolkit.

2013-09-25 Thread Jacob Carlborg
On Wednesday, 25 September 2013 at 20:18:57 UTC, Gary Willoughby 
wrote:


That looks interesting but the unittester handler seems to run 
instead of the unittest blocks


I'm not exactly sure what you mean. But this is how it works. DMD 
turns each unit test block into a function. Then DMD creates a 
single function for each module, which will call all these unit 
test functions. If you access the "unitTest" [1] property of a 
ModuleInfo you will get the unit test runner and not the 
individual unit test functions.


To access the individual unit test functions you can use the 
getUnitTests trait, available in git HEAD:


https://github.com/D-Programming-Language/dlang.org/pull/366


and the assert handler property is private.


There are property functions at line 374 and below to set the 
assert handler.


[1] 
https://github.com/D-Programming-Language/druntime/blob/master/src/object.di#L284


--
/Jacob Carlborg


Re: DUnit: Advanced unit testing toolkit.

2013-09-25 Thread Jacob Carlborg

On 2013-09-25 21:55, Dicebot wrote:


UDAs + recent trait to get all unit-tests during compile-time really
favors instead having lot of small independent annotated unit-test blocks.


If you have more than one test per unit test block you always need to 
run them together, and in the declared order. Example:


unittest
{
@test("foo")
{
assert(1 == 1);
}

@test("bar")
{
assert(1 == 2);
}
}

You cannot run "foo" separated from "bar". They all will always run 
together. You also cannot run "bar" before running "foo". Running tests 
like this makes it very easy to introduce order dependencies between the 
tests.


--
/Jacob Carlborg


Re: DUnit: Advanced unit testing toolkit.

2013-09-26 Thread Jacob Carlborg

On 2013-09-26 13:12, Dicebot wrote:


I was saying that if you want to have some tests independent, it makes
much more sense to do it this way:

```
@test("foo") unittest
{
 assert(1 == 1);
}

@test("bar") unittest
{
 assert(1 == 2);
}
```

..and let tests within one block terminate on first failure. That should
integrate better with existing tooling when no external testing
library/framework is connected.


Exactly. I guess I misunderstood you. Although I would consider "having 
lot of small independent annotated unit-test blocks" be basically what 
you're showing above.


--
/Jacob Carlborg


Re: DUnit: Advanced unit testing toolkit.

2013-09-26 Thread Jacob Carlborg

On 2013-09-26 16:56, Dicebot wrote:


Beg my pardon, bad wording from my side. I was referring to approach
when testing framework defines some sort of own testing DSL and uses it
for test case decoupling within one unit-test block - as far as I
understand it is what some of currently existing D testing frameworks do.


Ok, I see. Yes, there are some libraries that does that.


Key point here is that good testing library should augment built-in
facility, not replace it. Fallback to built-ins can still be useful.



--
/Jacob Carlborg


Re: DUnit: Advanced unit testing toolkit.

2013-09-26 Thread Jacob Carlborg

On 2013-09-26 20:18, Gary Willoughby wrote:


Only the deprecated version works as expected.

import core.exception;
import std.stdio;

alias void function(string file, size_t line, string msg) AssertHandler;

AssertHandler handler = function(string file, size_t line, string msg)
{
 writefln("File: %s", file);
 writefln("Line: %s", line);
 writefln("Message: %s", msg);
};

void main(string[] args)
{
 // assertHandler = handler; // <--- Private!
 setAssertHandler(handler); // <--- Works but deprecated

 assert(false, "Test message.");
}


I don't know which version of DMD you're using or when this part of 
druntime was update, but it's clearly not private according to the 
source code:


https://github.com/D-Programming-Language/druntime/blob/master/src/core/exception.d#L380

--
/Jacob Carlborg


Re: DUnit: Advanced unit testing toolkit.

2013-09-26 Thread Jacob Carlborg

On 2013-09-26 22:39, Gary Willoughby wrote:


I knowm, it's weird, i've been trying to find out why it's private,
everything looks like it's public. Try running the code i posted see if
you can get it to work.


It works fine using DMD 2.063.2 on Mac OS X.

--
/Jacob Carlborg


Re: DUnit: Advanced unit testing toolkit.

2013-09-28 Thread Jacob Carlborg

On 2013-09-27 18:23, Gary Willoughby wrote:


I've just tested it on Mac OS 10.8 and it fails.

Are you sure you commented out the line of code that you need to test?
In the snippet of code above the working deprecated version is
uncommented. Comment that line out and try using the property.


Hmm, ok, you were right. The following commit made it public:

d5fda766c248b5b3671b1b498c0a7dba8bee7442

I guess we'll have to wait to the next release of DMD or use git HEAD.

--
/Jacob Carlborg


Re: Pragmatic D Tutorial

2013-10-07 Thread Jacob Carlborg

On 2013-10-07 21:18, qznc wrote:

I believe one of the things D needs right now is more documentation.
Therefore, I started writing a tutorial.


For GUI libraries there's DWT as well. Works on Windows and Linux, uses 
native drawing and doesn't have any runtime dependencies expect for the 
system libraries.


https://github.com/d-widget-toolkit/dwt

Small detail. On the Hello World page, this text:

"The nice fact about rdmd is that it finds additional files 
automatically and links them"


You should replace "links" with "compiles".

--
/Jacob Carlborg


Re: Pragmatic D Tutorial

2013-10-07 Thread Jacob Carlborg

On 2013-10-07 21:18, qznc wrote:

I believe one of the things D needs right now is more documentation.
Therefore, I started writing a tutorial.


Run-time errors

You might want to add that D automatically handles uncaught exceptions 
and prints a stacktrace when one is thrown.


Optimization

I think it's worth mentioning that DMD is faster at compiling your code 
compared to GDC and LDC.


--
/Jacob Carlborg


Re: Pragmatic D Tutorial

2013-10-09 Thread Jacob Carlborg

On 2013-10-09 10:37, qznc wrote:


I am not aware about any counter arguments. Are there some downsides? I
noticed that "Returns:" is rarely used in Phobos.


D has built-in support for documentation comments, called ddoc:

http://dlang.org/ddoc

--
/Jacob Carlborg


Re: Facebook is using D in production starting today

2013-10-11 Thread Jacob Carlborg

On 2013-10-11 02:36, Andrei Alexandrescu wrote:

Today I committed the first 5112 lines of D code to Facebook's
repository. The project is in heavy daily use at Facebook. Compared to
the original version (written in C++) we've measured massive wins in all
of source code size, build speed, and running speed.

In all likelihood we'll follow up with a blog post describing the process.


That's great news!

--
/Jacob Carlborg


Re: Start of dmd 2.064 beta program

2013-10-14 Thread Jacob Carlborg

On 2013-10-15 07:16, deadalnix wrote:


This is for that very reason that I prefers to work with timestamps UTC
as much as possible. No timzone hell, no format hell, no nothing. Just
convert from user input directly, and convert back to text just before
output.


Agree. Always work with universal standards internally in your 
applications. Be it time, date, encodings or whatever. Then convert to 
and from local formats, as early as possible on input and as late as 
possible for output.


--
/Jacob Carlborg


Re: Start of dmd 2.064 beta program

2013-10-15 Thread Jacob Carlborg

On 2013-10-13 00:16, Walter Bright wrote:

http://ftp.digitalmars.com/dmd2beta.zip

Current list of regressions:


Another one: http://d.puremagic.com/issues/show_bug.cgi?id=11268

--
/Jacob Carlborg


Re: Funny coverage of the recent reddit/hackernews chatter

2013-10-16 Thread Jacob Carlborg

On 2013-10-16 10:01, simendsjo wrote:


Another funny thing: I couldn't get the page to work in Chromium and had
to use FF :)


Did you try Chrome :)

--
/Jacob Carlborg


Re: Start of dmd 2.064 beta program

2013-10-16 Thread Jacob Carlborg

On Wednesday, 16 October 2013 at 20:19:17 UTC, Brad Roberts wrote:

That's not a what, that's a who.  Would you please elaborate on 
the what and why?  I haven't seen any obstructionism coming 
from anyone in terms of repeating the previous style for this 
releases notes.


Originally Walter  thought it was enough to just list the 
bugzilla issues.


--
/Jacob Carlborg


Re: Start of dmd 2.064 beta program

2013-10-17 Thread Jacob Carlborg

On 2013-10-16 23:16, Jonathan M Davis wrote:


Yes, but after Andej did the great changelog for 2.063, Walter publicly
admitted that he had been wrong about the changelog. Andrej showed Walter that
it _is_ worth doing something more than just a list of bugzilla issues. So, I
would assume that whatever Andrej is unhappy with Walter for is something
else.


Andrej wrote:

> I'm wondering whether there will be the nifty changelog like it
> was for 2.063?
> Andrej? :D

We'll see if someone else volunteers to do it. I'm not doing it out of 
protest.


http://forum.dlang.org/thread/l3chnd$1mvs$1...@digitalmars.com?page=4#post-mailman.2221.1381889714.1719.digitalmars-d-announce:40puremagic.com

I interpreted that as he originally created the changelog out of protest 
to Walter's claim that it's not necessary.


--
/Jacob Carlborg


Re: Mono-D 0.5.4.1 - Build, completion & other fixes + Unittests via rdmd

2013-10-17 Thread Jacob Carlborg

On 2013-10-17 09:42, Timothee Cour wrote:


on OSX, lldb has better support than gdb.


Not for D. Break points doesn't work in LLDB but they do work in GDB. 
The backtrace seem to be slightly incorrect as well. The line number for 
frame 0 is off by one. Printing a variable doesn't seem to work.


--
/Jacob Carlborg


Re: code.dlang.org now supports categories and search - license information now required

2013-10-17 Thread Jacob Carlborg

On 2013-10-17 14:06, Sönke Ludwig wrote:


If you have per-file differences, then this in fact means that both
licenses need to be obeyed when using the package.


Not necessarily. There can be two completely separated targets, that 
don't share any code. I don't know if that's possible in Dub, but in 
theory it would be.


--
/Jacob Carlborg


Re: code.dlang.org now supports categories and search - license information now required

2013-10-17 Thread Jacob Carlborg

On 2013-10-17 14:33, Sönke Ludwig wrote:


"dub publish" sounds like something that may considerably increase the
complexity of the command line tool, especially in the long term, and it
also increases the coupling to the public registry, whereas now it just
needs a very small HTTP API that can be fulfilled by any HTTP file
server. So I'd rather want to avoid that if possible.


You could have something like this:

dub publish 

Should be much difference compare to how it works now. It would just 
trigger the server to look for that tag, instead of doing it automatically.


--
/Jacob Carlborg


Re: code.dlang.org now supports categories and search - license information now required

2013-10-17 Thread Jacob Carlborg

On 2013-10-17 11:33, Sönke Ludwig wrote:

There has been another important change that requires existing packages
to be updated: All packages must now have the fields "description" and
"license" present to be published. The license field has to be set
according to the specification [1]. All existing branches and version
tags stay unaffected by this requirement and are still available.


Perhaps add the license: Apple Public Source License. This can be useful 
for creating bindings to Apple specific libraries. Is there a 
corresponding license for Microsoft?


--
/Jacob Carlborg


Re: code.dlang.org now supports categories and search - license information now required

2013-10-17 Thread Jacob Carlborg

On 2013-10-17 15:44, Sönke Ludwig wrote:


Not necessarily, but possibly, so it probably has to cope with it.

One possibility to handle your example would be to make different sub
packages for the two targets.


What's happens then with the main/super package, in regards to licensing?

--
/Jacob Carlborg


Re: code.dlang.org now supports categories and search - license information now required

2013-10-17 Thread Jacob Carlborg

On 2013-10-17 15:53, Sönke Ludwig wrote:


Added APSL-2.0 (Apple Public Source License) and MS-PL (Microsoft Public
License).


Cool, thanks.

--
/Jacob Carlborg


Re: Start of dmd 2.064 beta program

2013-10-17 Thread Jacob Carlborg

On 2013-10-17 22:35, Andrej Mitrovic wrote:


- Walter is still not tagging the beta releases by the file name (it's
always dmd2beta.zip). I've complained about this several times and
IIRC someone else did as well at dconf (maybe I'm remembering wrong
though). They should at least be named as "dmd2_064_beta1.zip",
"dmd2_064_beta2.zip". And all of them should always be available for
download (including visibility on the download page), so people who do
not use Git or build manually from master can quicky check whether a
regression was introduced in a specific beta version.


Please make it "dmd.2_064_beta1.zip" and "dmd.2_064_beta2.zip" instead. 
This will automatically make it compatible with DVM. The important thing 
here is "dmd.".



So that's what I'm protesting about.


Agree with everything you said.

--
/Jacob Carlborg


Re: LDC 0.12.0 has been released

2013-10-25 Thread Jacob Carlborg

On 2013-10-23 00:42, David Nadlinger wrote:

LDC 0.12.0, the LLVM-based D compiler, is available for download! It is
built on the 2.063.2 frontend and standard library and supports LLVM
3.1-3.3 (OS X: 3.2 only).


I noticed that Apple's releases of Clang is still at 3.2.

--
/Jacob Carlborg


  1   2   3   4   5   6   7   8   9   10   >