Unlike mainstream software, it requires a lot of effort to get hardware
guys interested in software.
I meant to say interested in *opensource* software
But, a fair chunk of code. Maybe there's little activity recently because
they consider it done. I haven't committed to the majority of my github
things for months, but I still stand by them.
Greetings
I am the lead developer of Vlang.
Vlang is still being actively worked on. We are not
Greetings
half the site is 404, the github account show little activity and
information pretty sparse. smells kinda dubios..
I am really sorry for the poor webpage. We are actively working on that
front, but progress is slow since we need to give priority to customer
projects. We are an
This is great going, Puneet. Congratulations, good luck, and keep us all
posted! -- Andrei
Thanks Andrei.
And thanks again to Walter, yourself, Kenji and other developers who
together made D a wonderful language.
Greetings
I hit what looks like a probable DMD bug. When I reduced with help from
dustmite I get something like this. Can someone tell me if this is a bug or
am I doing something illegal?
class A {
B.BB b;
}
class B: A {
static class BB {}
}
When I compile I get:
test.d(2): Error: no
DMD wont compile this. I get an error saying:
/tmp/test.d(3): Error: need 'this' for 'foo' of type 'int'
Failed: [dmd, -v, -o-, /tmp/test.d, -I/tmp]
Is this a bug or is it illegal code?
// Regards
// Cherry
class Foo {
int foo = 42;
@foo int bar;
this(int frop) {
foo = frop;
}
int
On Mon, Jun 10, 2013 at 10:13 PM, Jacob Carlborg d...@me.com wrote:
On 2013-06-10 18:34, Manu wrote:
On 11 June 2013 02:26, Jacob Carlborg d...@me.com mailto:d...@me.com
wrote:
On 2013-06-10 17:40, David Nadlinger wrote:
Let me try to summarize it in code:
---
https://github.com/D-Programming-Language/dmd/pull/3181
Daniel asked me to use this. And it works.
Use something like:
union U
{
void delegate(int) dg;
struct
{
void* ptr;
void function(int) funcptr;
}
}
U u;
u.dg = dg;
u.funcptr = ...;
u.ptr = ...;
Regards
- Puneet
On Sat, May 4, 2013 at 12:41 AM, Rob T al...@ucora.com wrote:
I have significantly reduced CG performance issues (up to 3x faster) with
strategically placed disabling and enabling of the GC, so it may be that
the problem can be solved using carefully placed GC.disable and GC.enable
calls at
On Sun, Oct 13, 2013 at 9:56 PM, Iain Buclaw ibuc...@ubuntu.com wrote:
I don't think I'm receiving emails from this ML. Is anyone else seeing
this?
I generally use mailing list interface and I am seeing your post on mailing
list.
Greetings
I am trying to use emplace and it is seemingly leading to memory
corruption. Before I file a bug on DMD Buzilla, I want to find out if I am
doing something wrong or if it is a known issue. I am using a linux box and
this testcase is freaky -- if I comment out either line 20 or line 24,
I tried that and it still crashes. I don't think that's the problem.
Puneet, the code looks legit, please file a bug report.
Thanks for confirming.
http://d.puremagic.com/issues/show_bug.cgi?id=11139
Regards
- Puneet
Greetings
I have a question on class destructor method. D documentation for
destructors says:
The garbage collector is not guaranteed to run the destructor for
all unreferenced objects. Furthermore, the order in which the garbage
collector calls destructors for unreference
Greetings
Is there a way to initialize an associative array to a non-null (but still
empty) state? The only way I know is by adding an element and then removing
it. Did I miss something obvious? Basically I want to write lines 7-8 in
the following code in a cleaner fashion. Any ideas?
Regards
-
Thanks Jonathan
Do you think this could make a good enhancement request?
Regards
- Puneet
On Sat, Jun 1, 2013 at 9:34 PM, Jonathan M Davis jmdavisp...@gmx.comwrote:
On Saturday, June 01, 2013 20:21:42 d coder wrote:
Greetings
Is there a way to initialize an associative array to a non
Greetings
Consider the following code ...
class Foo { // 1
void foo() { // 2
bar(); // 3
this.bar(); // 4
} // 5
} // 6
void bar(Foo f) { // 7
import std.stdio; // 8
writeln(This bar); // 9
} // 10
void main() { // 11
Foo test = new Foo; // 12
test.foo(); // 13
} // 14
DMD
Timon, you mean such support is planned, or is the current behavior the
expected behavior.
Regards
- Puneet
On Sat, May 4, 2013 at 4:57 PM, Timon Gehr timon.g...@gmx.ch wrote:
This is to be expected.
On Fri, May 3, 2013 at 5:41 AM, Joseph Cassman jc7...@outlook.com wrote:
If you could provide an update on the allocators design and implementation
-- progress and/or roadmap -- that would be great. Also if there are any
plans to update std.container as a result.
+1
And another one. I am
Greetings
I just wanted to find out how good is the GDB support for debugging
multithreaded code written in D language. I remember trying it sometimes
back, but could not get it to work.
Any suggestions?
Regards
- Puneet
Greetings
I am wondering if there is a way to find out a tuple of all the
symbols/identifiers in a given delegates closure.
Regards
- Puneet
There could be other possibilities as well, like a function without @foo
attribute not being able to call a function with the attribute in its body.
I mean, a function without @foo should not be able to call a function with
@foo attribute.
Greetings
I believe the paper takes a contrived route to criticize static if. It
takes some bad code examples which are not obvious use cases of static if
and then goes on to say that the resultant code is not good. I think the
code example to begin with was not good.
Regards
- Puneet
Cool I will try not to sleep when I catch a train next time. :-)
On Thu, Feb 21, 2013 at 12:27 AM, H. S. Teoh hst...@quickfur.ath.cx wrote:
But once I get into the realm of new features introduced in D, like
generic metaprogramming, functional-style code, non-trivial range APIs,
const-correctness, purity, etc., I just keep running into bugs,
unexpected
In D, class objects are implicitly pointers. So try the following code.
class Parent {}
class Child : Parent {}
void myFunc(Parent obj) {
import std.stdio;
writeln(got , obj);
}
void main() {
Child myChild = new Child();
myFunc(myChild);
}
On Thu, Jan 31, 2013 at 2:43 PM, Robert burner Schadek
realbur...@gmx.de wrote:
Thats not totally correct. The Rb tree is a class. But the real reason for
the Deque being a class
is that it holds two value members. And if you pass the Deque around you
need to do this as ref.
Otherwise you
On Thu, Jan 31, 2013 at 5:30 PM, monarch_dodra monarchdo...@gmail.com wrote:
The pull is kind of stuck in limbo, specifically because of the problems
associated with implementing reference semantics with structs :/
Thanks for the enlightening email.
I am of the considered view that reference
To be honest deque can be implemented far better if random access as in
indexing, removal and such is dropped.
As other people too pointed out, Deque is indeed a random access
range, so indexing operator is a must. Insert/Remove too are good to
have. Array implementation in the std.container
On Sun, Jan 20, 2013 at 6:21 PM, David d...@dav1d.de wrote:
I am not using the forum, but still sending messages. You can send
messages directly via a NNTP client, you don't have to use the forum, so
it's definitly possible he doesn't know of it.
David, that can be guessed on basis of the
You can use a string mixin:
class Foo
{
int a;
@(3) private int b;
}
void main()
{
writeln(mixin(__traits(getAttributes, ~ Foo.tupleof[1].stringof ~
))); // - 3
}
Hmm
This works only when main is in the same file (and therefor module) as Foo.
Regards
- Puneet
Greetings
When I compile the code below, I unexpectedly get an error:
test.d(7): Error: template std.string.format does not match any function
template declaration. Candidates are:
/home/puneet/local/github-d/bin/../phobos/std/string.d(2528):
std.string.format(Char, Args...)(in Char[] fmt, Args
That's not how you define implicit conversions in D. It's a weird hack
from C++.
Thanks for clarification. I knew about alias this, but I thought it was in
addition to constructor path.
Regards
- Puneet
Greetings
I have created a DList of class objects. Now I want to delete a particular
object from the list. I do not see a straightforward way of doing that. The
only way I found was to create a DList range, take out all other elements
from the range using popFront and popBack and then apply
Thanks Jonathan.
On Wed, Dec 19, 2012 at 3:43 PM, Iain Buclaw ibuc...@ubuntu.com wrote:
How difficult would you think it would be to scale down (or up) this
library type so it can be an emulated IEEE type of any size? (The whole
shebang eg: quarter, half, single, double, quad, double-quad, 80bit and
96-bit).
Greetings
I thought I would be able to use allMembers/getMembers traits to access the
attributes of all the members of a class. But that fails me if some members
of the class are private.
Consider the code pasted below -- I get en error:
B.d(5): Error: class A.Foo member bar is not accessible
Ok. It seems to work with allMembers/getMember traits combination.
But should it work with tupleof or not?
Regards
- Puneet
Try something like this:
foreach (i, dummy; foo.tupleof)
{
alias Tuple!(__traits(getAttributes, foo.tupleof[i])) tp;
pragma(msg, tp);
}
Ok so that is because ref does not work with foreach on tuples. Somehow I
thought that got fixed.
Anyways, with your suggestion I get a strange
On Mon, Dec 17, 2012 at 9:56 PM, Walter Bright
newshou...@digitalmars.comwrote:
On 12/17/2012 3:55 AM, d coder wrote:
So my question is: Is this a bug in DMD, or am I doing something plainly
wrong?
You're doing something wrong. Consider:
@Bar int i = 3;
int x = i;
The UDA does not get
I do not know if I am missing something but consider:
struct Foo {
int r;
int i;
bool get() {
return true; // always return true
}
alias get this;
}
So I am wondering how it would be possible to construct Foo from a bool?
Otherwise how would the compiler be able to figure out in
The name doesn't matter. I just wanted to annoy Walter again with yet
another bit of evidence that completeness of a feature is important even if
it doesn't seem to have an obvious use case. People will do what is logical
and end up with hacks like that.
I believe it *is* an obvious use
Greetings
The following code prints . Similar thing happens when a and b are
bytes.
Is this intended?
Regards
- Puneet
void main()
{
import std.stdio;
ushort a = 0x55AA;
ushort b = 0xAA55;
writefln(%X, ~(a | b));
}
For some more clarity, when I compile the following code:
void main() {
import std.stdio;
byte a;
byte b;
byte c = a + b;
}
I get error:
test.d(6): Error: cannot implicitly convert expression (cast(int)a +
cast(int)b) of type int to byte
Why is D trying to convert bytes and shorts to
On Tue, Dec 11, 2012 at 6:23 PM, monarch_dodra monarchdo...@gmail.comwrote:
D's stance regarding integer operations is if it compiles, it creates the
same output as in C.
Thanks Monarch. So it is a gotcha we inherit from C. :-)
Regards
- Puneet
On Tue, Dec 11, 2012 at 7:05 PM, Peter Alexander
peter.alexander...@gmail.com wrote:
That's the whole point. What you are doing is dangerous, so it requires
the cast.
What I am doing is not dangerous. I am operating at byte/short level.
Tell me, if what I am doing is dangerous, how come
Thanks Everybody for responding. I have another query which is off-topic
but related.
Why is the following allowed in D?
long a;
int b;
b += a; // Allowed -- no explicit cast
b = a + b; // Not allowed
b = a; // Not allowed
On Wed, Dec 12, 2012 at 3:40 AM, Walter Bright
newshou...@digitalmars.comwrote:
No worries there :-) I feel pretty dang strongly about this issue, from
bad experience.
Even if a language behaves wrong, it is still usable if it is
predictable.
Agreed.
How about this.
1. Let char and short
On Wed, Dec 12, 2012 at 8:14 AM, Walter Bright
newshou...@digitalmars.comwrote:
(This is how the high level vector library Manu is implementing is done.)
Greetings
Where can I learn more about this library Manu is developing?
regards
- Puneet
But it's not a bug. Like Ali said:
The destruction order of GC-maintained resources is not deterministic as
e.g. in C++. It is quite possible that the member of an object is destroyed
before the object itself.
Oops. I get it now.
What should be done to avoid this situation? I think I need
On Fri, Nov 30, 2012 at 7:41 PM, Maxim Fomin ma...@maxim-fomin.ru wrote:
This is another bug with structures. Consider posting this to bugzilla.
Thanks for confirming. I have posted this to Bugzilla.
Regards
- Puneet
Congratulations.
I found that my applications still do not compile using the git HEAD.
Waiting eagerly for the 2.060 alpha release.
Regards
- Puneet
Obtain the gdc sources and install into gcc-core (I
will tarball a copy up that includes the zlib sources too and post a
link).
Greetings
Where would I find the gdc source?
Then rebuild gcc with the same options above above, but with
--enable-languages=d included.
Would this option
Thanks to C++ for inspiration, I even have proposal for such
syntax!
obj.free myFunc( args )
obj.member myFunc( args )
How about:
obj.myFunc( args ); // calls member function, even if free function exists
myFunc( obj, args ); // calls free function, even if member function
I'm going to be pushing gdc-4.8 package into debian this weekend (give
about a fortnight for it to land in sid) - is anyone interested in porting
Druntime / Phobos over to the architectures that Debian supports? I can
give anyone a quick crash course through building a cross compiler if
Greetings
Normally I use released beta versions of dmd, but this time I started using
dmd 2.060 for sake of std.string.xformat.
But I am facing issues. This version is ignoring ref when passing array
as ref argument. Kindly see the code below. When I run this code it prints
Postblit called! four
Done.
http://d.puremagic.com/issues/show_bug.cgi?id=8335
Greetings
std.string.format throws runtime exception for BigInt and for BitArray
types even though writefln works fine. The run-time error says
std.format.FormatException@std/format.d(4744): Can't convert
std.bigint.BigInt to string: string toString() not defined
Here is a small test case.
I have files a phobos bug report.
http://d.puremagic.com/issues/show_bug.cgi?id=8326
Regards
- Puneet
Thanks Kenji, I will use xformat. BTW, why is it named xformat? Would not
sformat be a better name? Where s could stand for string.
Also I feel, std.string.format should work for BitArray and BigInt too.
Both these types are defined as part of phobos.
Regards
- Puneet
On Sat, Jun 23, 2012 at 10:58 PM, Tobias Pankrath tob...@pankrath.netwrote:
I am currently writing a sat solver for educational purposes
How mature is the sat solver yet? Do you plan to release it at some point
of time?
Regards
- Puneet
Greetings
I do not know if this email belongs to this list or not. It is about a
package available at dsource. Let me know if I should be posting such
emails elsewhere.
I need an implementation of Doubly Linked list and Deque. Since the
std.container library does not support these containers
Did you try : list.insert(list.begin, value);
Thanks. But I believe append and prepend are too common use-cases to be
ignored.
Also, I see that assert(some-expression) has been used at a lot of places
in the code of the libraries. Since these libraries are built with -release
option, should
Also, I see that assert(some-expression) has been used at a lot of
places in the code of the libraries. Since these libraries are built with
-release option, should these assert statements not be replaced by
enforce?
Ok I think asserts are fine since these would be taken out and the library
auto append(T, V)(ref T t, V value)
{
return t.insert(t.begin, value);
}
should do the trick.
(you may add a guard to make sure T is a container)
Thanks Christophe. I think you are relying on UFCS here.
So cool.
Regards
- Puneet
Greetings
Is emplace/clear mechanism mature enough to be used to create freelists?
I looked but found very scanty documentation on emplace/clear on dlang.org.
Regards
- Puneet
Greetings All
Using DMD 2.059, the following code does not compile. DMD does not allow me
to apply stringof on a function alias of a function that takes one or more
arguments. It compiles and runs fine for functions that do not take any
arguments.
Is it a bug, or am I doing something wrong here?
At the moment, the ref-ness of the return type is not determined
correctly because of a compiler bug. Otherwise, that works mostly
fine.
Thank you Max for showing me toDelegate. But I find that it does not work
even for function arguments with default values. So for the moment I will
trod
dlang.org is back.
By the way, is there a PDF version of D Programming Language
Specification which is available from Amazon as a kindle edition. It
should be useful to have access to such a manual if the website goes down
again.
Regards
- Puneet
Greetings
I know there is a plan for D to have AST macros eventually. I wanted to
know if it is a feature being worked upon at this point of time.
Approximately how long it would be before AST Macros see the light of the
day in D?
I know D is an opensource project and I am not trying to put any
Hello All
Particularly I would like to know if it is possible at all in D to invoke a
class method transferred to a scope outside the class as an alias argument.
Regards
- Puneet
Hello Steve, thanks for looking at this.
I see the code works when I create the delegate first and then send it to
template. That is the way you do it here.
void main() {
Foo f = new Foo();
auto dg = f.foo; // need to make a symbol so it can be aliased
callfoo!(dg)();
}
But it does
Hello Steve
There is a way, as I hinted :)
I'll show you how, but be prepared to deal with ugliness!
All this smart code would be hidden from the end-users so I really do not
care.
typeof(F.init.foo) dg; // alternately: void delegate() dg;
dg.funcptr = F.foo;// use the type, not the
On Fri, Jun 1, 2012 at 7:40 PM, Mehrdad wfunct...@hotmail.com wrote:
Another way to phrase it would be that D is forcing you to to use
templates where they really aren't meant to be used. :\
No. I am working on a Domain Specific Language and want to cut on the code
the end user has to write.
Steve
One small thing. As you said I might declare a delegate in an alternate
fashion that is by saying void delegate() dg;.
But would it be possible to rewrite the following declaration in a way that
avoids naming foo explicitly. I would just have an alias for foo. I am
asking this to cover the
Huh, wasn't Digital Daemon the previous site at dlang.org address?
No. Digital Daemon is the hosting company that hosts dlang.org as well as
digitalmars.com. Yesterday even digitalmars.com was leading me to Digital
Daemon page. As Walter has said, it was a technical problem with the
hosting.
Greetings
Kindly make me understand this. I have been trying to call an alias for a
class method from another scope. I keep getting an error saying that I need
this to call a method. Why will not this pointer be available when I am
passing the method symbol along with an object of the class? Is
Why am I being taken to Digital Daemon when I goto http://dlang.org ?
Where can I find official D language site now?
Regards
- Puneet
Alright, well I've got a case of beer with your name on it if you can pull
it off! ;)
+1. I too am waiting for CTFE improvements. I am working on a DSL and with
the present limitations, it is impractically slow and memory consuming
while compiling.
Generally a parser generated by other tool and accepting tokens returns
the abstract syntax tree, but it return the evaluated value in the example.
In other words, it does lexical analysis, parsing and (type) converting at
a time.
If you want simply abstract syntax tree, it may be a little
I would like the parser to effect some side effects. For this purpose, I
tried including the parser mixin into a class, but I got a strange error
saying:
Error: need 'this' to access member parse
Ok. I see my folly. At compile time, there would not be any this since
the class has not been
Greetings
I am trying to use Pegged for compile time parsing. The only issue I am
facing is with the compile time memory. I have a rather simple grammar,
mostly derived from the arithmetic.d example that comes bundled with Pegged.
I am wondering if the memory could be optimized by fine-tuning
dmd simply never frees any memory it allocates.
Since GDC uses DMD front-end, I do not think I can get any relief by using
that too. Right?
Have you guys tried to use asModule?
https://github.com/PhilippeSigaud/Pegged/wiki/Grammars-as-D-Modules
Thanks for the idea. I just gave it a try and the memory came down by about
50%. Additionally the compilation became much faster.
But that might still not be enough :-( I will try to
But that might still not be enough
Some 50-100MB additional memory is getting consumed by the compiler each
time I parse a simple expression like foo 32;. In the end, if I parse
20 such expressions, the memory usage tops 2GB even while using asModule.
Regards
- Puneet
Use template mixins? At least in struct/class area that catches the most
attention it should work perfectly.
I believe template mixins are equally ugly. Don't you have to explicitly
specify that you are invoking a mixin? Or am I missing something here.
Regards
- Puneet
Hello Philippe
OK, doing a bit of thread necromancy here (3 weeks, still acceptable here?)
You are more than welcome. I am still working on the stuff.
Puneet, I might have something for you. IIUC, you want to parse
expressions that are
- an association of boolean expressions (, ||, !)
-
Pegged should have no problem parsing all of D, at least theoretically (I
don't know of any severe ambiguities in D). So IOW, it can probably do
what you need it to do.
Oh. I realized that I had missed Pegged announcement by Philippe. I will
have a look at it.
Regards
- Puneet
I'm afraid being in holidays right now means I do not have easy access to
GitHub (no git on a pad, and the computer I use to code right now does not
have any network connection). I'll put all this online in a few days,
because that must seems like the ramblings of a madman right now...
I
This sounds like something I ran into in my D lexer project. Lexing
Phobos took upwards of 10-15 seconds, which is extremely slow
considering that dmd can *compile* it in just a few seconds. So I did
some profiling, and found out that most of the time was spent formatting
tokens into
On Wednesday, February 29, 2012 02:16:12 Christopher Bergqvist wrote:
I agree that the current direction of D in this area is impressive.
However, I fail to see a killer-feature in generating a lexer-parser
generator at compile-time instead of run-time.
CTFE parsing is especially
Parsing method which the generated parser employs is Recursive Descent
Parsing.
And the behavior of the parsers recursive and A is a little bit
complicated.
The parser recursive matches the sequence of 'a' whose length is 2^n-1
such as 1, 3, 7 and 15.
Anyway, I'm going to write more
How different is what you want to do from CTFE?
http://dlang.org/function.html
I do not want to evaluate the expression in the string at compile time. I
want to parse it at compile time and later at run time, I am required to
process the parse tree and evaluate it in a different fashion
Hisayuki Mima's ctpg is compile-time parser generater, and the
generated parser works in compile time!
https://github.com/youkei/ctpg
Kenji Hara
Thanks Kenji
This is very interesting. Also I think ctpg is being actively developed. I
will try to figure out how to make use of it.
Regards
-
Operator precedence parsers are simple to implement:
http://effbot.org/zone/simple-**top-down-parsing.htmhttp://effbot.org/zone/simple-top-down-parsing.htm
Timon
I want to do all this parsing at compile time in D (using mixins). I have
just started working on this. I am not sure if CTFE
I know. CTFE is flexible enough and implementing this would be quite
simple. However, if ctpg serves your needs well, just use that.
Thanks Timon
You mean I do not need to use function style when using CTFE?
I will try parsing myself as you suggested. This approach would give me a
Greetings
I need to parse simple D expressions at compile time. I was wondering if
somebody on the list has some example code that could be of help to me.
I am working on an opensource constraint solver and expressions that I
need to parse can be reasonably complex such as x + y*n 32 x 4. I
https://github.com/PhilippeSigaud/D-templates-tutorial/blob/master/dtemplates.pdf
can't open the pdf with acrobat reader under win7 :(
(the file seems to be ok, contains the pdf header)
im using the latest acrobat reader x
Same here. When I regenerated the pdf after cloning the git
Btw, it's cool you could generate the pdf. Did you have minted and
pygments already installed?
No. But I downloaded minted.sty and apt-get pygmentize when pdflatex failed.
Don't hesitate to tell me where it's unclear. If you have any example
in mind or some difficulty that constantly trip
D's pass-down lambdas do not need memory allocation. As far as I remember
none of std.algorithm's use of lambda allocates memory.
On that front Andrei, did you get a chance to discuss my request to make
std.algorithm more usable with Walter?
The books have different authors. I don't suppose someone has both and can
comment on the differences? I have the older version as well, but wouldn't
mind picking up this new one if it brings enough new stuff to the table.
Perhaps you can take a look at the ToC here
1 - 100 of 166 matches
Mail list logo