bearophile wrote:
> Recently lot of work has being done about "inout", and I think it is now
> usable in D2.
>
> So this has made me ask how much needs to be done (in D language and/or
> Phobos) to allow the correct compilation of exactly this useless demo
> program (I think it is correct):
>
>
On Fri, 2011-10-07 at 08:49 +0200, Jacob Carlborg wrote:
[ . . . ]
> I think it's important to support the range interface (or if it's
> simpler, the array interface). I think ActiveRecord has a good high
> level API which allows to lazily evaluate SQL queries.
>
> persons = Person.all # no quer
On Fri, 2011-10-07 at 08:51 +0200, Jacob Carlborg wrote:
[ . . . ]
> I think it's important to have a solid low level database API which an
> object oriented abstraction can be built upon.
Why object oriented? Why not functional?
The lesson form ORMs is that object oriented and relational can be
kennytm:
> Allow a template argument to treat a const(T[]) as a const(T)[] is a
> different and a known problem IIRC.
I don't fully understand the meaning of your answer, but I didn't want to imply
that those two problems are new or unknown.
Bye,
bearophile
== Quote from Andrei Alexandrescu (seewebsiteforem...@erdani.org)'s article
>
http://www.reddit.com/r/programming/comments/l3tk5/merging_in_the_gnu_d_language_compiler_to_gcc/
> Andrei
Cool beans.
Iain
Jens Mueller wrote:
>Hi,
>
>I started writing a simple module to color terminal output some time
>ago. In a recent thread people seemed interested in having such
>functionality. I cleaned up this code and kindly ask whether such a
>module is considered a useful addition.
>
>On Posix systems it uses
On 10/6/2011 9:39 PM, Andrei Alexandrescu wrote:
http://www.reddit.com/r/programming/comments/l3tk5/merging_in_the_gnu_d_language_compiler_to_gcc/
On Hacker News too:
http://news.ycombinator.com/item?id=3083125
I was converting something that was a class to a struct, and ran into this
(minimized as much as possible):
import mysql;
// The import mysql.d for the test contains only:
/*
extern (C):
struct MYSQL{}
MYSQL* mysql_init(MYSQL* mysql);
*/
// If I put this stuff in-line the error does not happen
st
-- mysql.d
extern (C):
struct MYSQL{}
MYSQL* mysql_init(MYSQL* mysql);
-- main.d -
import mysql;
struct Connection
{
MYSQL _mysql;
~this()
{
}
this(int dummy = 0)
{
mysql_init(&_mysql);
}
}
void main()
{
C
If you don't need the internal data of struct MYSQL and you don't want
to care about. Then just keep some reference in your program.
alias void MYSQL;
alias void MYSQL_RES;
and then only use MYSQL* and pass it to every function.
struct Connection
{
MYSQL* _mysql;
~this()
{
}
t
Steve Teale , dans le message (digitalmars.D:146210), a écrit :
> I was converting something that was a class to a struct, and ran into this
> (minimized as much as possible):
>
> import mysql;
> // The import mysql.d for the test contains only:
> /*
> extern (C):
> struct MYSQL{}
> MYSQL* mysql_i
Am 07.10.2011, 09:26 Uhr, schrieb Russel Winder :
On Fri, 2011-10-07 at 08:49 +0200, Jacob Carlborg wrote:
[ . . . ]
I think it's important to support the range interface (or if it's
simpler, the array interface). I think ActiveRecord has a good high
level API which allows to lazily evaluate SQ
On 2011-10-07 09:30, Russel Winder wrote:
On Fri, 2011-10-07 at 08:51 +0200, Jacob Carlborg wrote:
[ . . . ]
I think it's important to have a solid low level database API which an
object oriented abstraction can be built upon.
Why object oriented? Why not functional?
The point was that the l
The empty struct is a red herring. I cut mysql.d down to the bare minimum to
help
isolate the bug.
I get exactly the same error with the complete mysql.d
On 2011-10-07 11:55, mta`chrono wrote:
If you don't need the internal data of struct MYSQL and you don't want
to care about. Then just keep some reference in your program.
alias void MYSQL;
alias void MYSQL_RES;
The correct way to do this is to declare an opaque struct, just as in C:
struct
On 2011-10-07 09:26, Russel Winder wrote:
On Fri, 2011-10-07 at 08:49 +0200, Jacob Carlborg wrote:
[ . . . ]
I think it's important to support the range interface (or if it's
simpler, the array interface). I think ActiveRecord has a good high
level API which allows to lazily evaluate SQL queries
On Fri, 07 Oct 2011 07:40:01 +0100, Jacob Carlborg wrote:
On 2011-10-06 21:44, Jesse Phillips wrote:
Regan Heath Wrote:
That's just it however, I am not generous enough with my time to be of
use
to you/D/phobos. I spend my free time doing other things, and not
working
on the code I have
You could use ANSI codes on posix to avoid a dependency on curses:
http://en.wikipedia.org/wiki/ANSI_escape_code#Colors
But I think using curses is ok. ncurses is MIT licensed and can be
used as a dynamic library, so I don't think there are license problems.
However, I'd recommend to load ncurses
Am 07.10.2011, 11:27 Uhr, schrieb Walter Bright
:
On 10/6/2011 9:39 PM, Andrei Alexandrescu wrote:
http://www.reddit.com/r/programming/comments/l3tk5/merging_in_the_gnu_d_language_compiler_to_gcc/
On Hacker News too:
http://news.ycombinator.com/item?id=3083125
And again they immediately
That will always happen.
My self I think that Go is a better C and D a better C++. It remains to be
seen how much they
will be able to take from C and C++.
Personaly I have been spending most of the time with Go, because of its
similarity with Oberon. It
brings back some good memories.
Now D i
On 07.10.2011 7:49, Andrei Alexandrescu wrote:
On 10/6/11 9:17 PM, Jonathan M Davis wrote:
On Sunday, October 02, 2011 23:27:35 Jonathan M Davis wrote:
The review for the region allocator has completed, so we need to choos
something else to review now. I believe that the current items in the
re
Now D is also quite cool, I would just like for the language compilers
to be a bit more stable.
They have been vastly improving, really.
Currently I do have more sucess proposing C++11 based solutions as Go or
D based ones, on the type of corporate environment I work in.
That's not D's or
Trass3r wrote:
> >You could use ANSI codes on posix to avoid a dependency on curses:
> >http://en.wikipedia.org/wiki/ANSI_escape_code#Colors
> >But I think using curses is ok. ncurses is MIT licensed and can be
> >used as a dynamic library, so I don't think there are license problems.
> >
> >Howeve
On 10/6/2011 11:49 PM, Andrei Alexandrescu wrote:
I suggest we go ahead with std.regex. Dmitry?
Andrei
My only concern is that Dmitry's code uses RegionAllocator. I was
hoping to get RegionAllocator into Phobos first, but that obviously
didn't happen.
Johannes Pfau wrote:
> Jens Mueller wrote:
> >Hi,
> >
> >I started writing a simple module to color terminal output some time
> >ago. In a recent thread people seemed interested in having such
> >functionality. I cleaned up this code and kindly ask whether such a
> >module is considered a useful ad
Am 07.10.2011, 14:51 Uhr, schrieb Jens Mueller :
Trass3r wrote:
>You could use ANSI codes on posix to avoid a dependency on curses:
>http://en.wikipedia.org/wiki/ANSI_escape_code#Colors
>But I think using curses is ok. ncurses is MIT licensed and can be
>used as a dynamic library, so I don't th
On 07.10.2011 17:04, dsimcha wrote:
On 10/6/2011 11:49 PM, Andrei Alexandrescu wrote:
I suggest we go ahead with std.regex. Dmitry?
Andrei
My only concern is that Dmitry's code uses RegionAllocator. I was hoping
to get RegionAllocator into Phobos first, but that obviously didn't happen.
I f
What's the big advantage of
Person.find_all_by_name_and_age("Joe", 15)
over
db.query("select * from people where name = ? and age = ?", "Joe", 15);
The latter is much easier to write in the library and you retain all
the flexibility of sql itself if needed.
Trass3r wrote:
> Am 07.10.2011, 14:51 Uhr, schrieb Jens Mueller :
>
> >Trass3r wrote:
> >>>You could use ANSI codes on posix to avoid a dependency on curses:
> >>>http://en.wikipedia.org/wiki/ANSI_escape_code#Colors
> >>>But I think using curses is ok. ncurses is MIT licensed and can be
> >>>used
I see. You mean using curses if available and falling back to ISO/IEC
6429. So you think that supporting ISO/IEC 6429 terminals is too
limited, aren't you?
Well I personally only care about bash and Windoze console. I guess these
support ISO 6429?!
I'm thinking that for each database that gets covered there will
need to be two modules, like:
etc.c.mysql
etc.mysqld
The etc.c.xxx modules would be completely different between databases -
just translations of the necessary header files. The xxxd modules
would be as similar as possible consisten
"Trass3r" wrote in message news:op.v2ze74ma3ncmek@enigma...
>> Now D is also quite cool, I would just like for the language compilers
>> to be a bit more stable.
>
> They have been vastly improving, really.
>
>> Currently I do have more sucess proposing C++11 based solutions as Go or
>> D based
"Trass3r" wrote in message news:op.v2zhq60v3ncmek@enigma...
>> I see. You mean using curses if available and falling back to ISO/IEC
>> 6429. So you think that supporting ISO/IEC 6429 terminals is too
>> limited, aren't you?
>
> Well I personally only care about bash and Windoze console. I guess t
Hell, they didn't even know about clang even though they were
progressive enough to use C++0x.
I once had a university professor who openly admitted C was the only
language he knew - and yet he didn't even understand how C's
null-terminated
strings work. So he didn't really even know that o
On 10/7/11 9:11 AM, Steve Teale wrote:
I'm thinking that for each database that gets covered there will
need to be two modules, like:
etc.c.mysql
etc.mysqld
The etc.c.xxx modules would be completely different between databases -
just translations of the necessary header files. The xxxd modules
On 07-10-2011 16:11, Steve Teale wrote:
I'm thinking that for each database that gets covered there will
need to be two modules, like:
etc.c.mysql
etc.mysqld
The etc.c.xxx modules would be completely different between databases -
just translations of the necessary header files. The xxxd modules
Am 04.10.2011 20:44, schrieb kennytm:
Timon Gehr wrote:
Is there already an enhancement request/bug report for this?
I did mention nullptr_t in 5899.
There is already a similar enhancement request:
http://d.puremagic.com/issues/show_bug.cgi?id=5416
I would really appreciate a comment by W
Hi, it's been years since I've posted here. I just wanted to share
something I worked on, a new sorting algorithm. It's a variant of merge
sort, but much more memory efficient with only a small loss in
performance. The most similar algorithm I know of is Timsort.
I had need for a stable sortin
Andrei,
The suggestion in your penultimate paragraph is what I'm trying to get started.
Maybe the answer to the problem with structs may lie somewhere in std.typecons
in
combination with the field discovery features supported by most databases. If we
can manufacture the struct to suit the circum
On 10/7/11 11:51 AM, Steve Teale wrote:
Andrei,
The suggestion in your penultimate paragraph is what I'm trying to get started.
Maybe the answer to the problem with structs may lie somewhere in std.typecons
in
combination with the field discovery features supported by most databases. If we
can
On 10/7/11 11:42 AM, Xinok wrote:
Hi, it's been years since I've posted here. I just wanted to share
something I worked on, a new sorting algorithm. It's a variant of merge
sort, but much more memory efficient with only a small loss in
performance. The most similar algorithm I know of is Timsort.
Andrei Alexandrescu wrote:
1. MFC had at a point a wizard that generated one struct per resultset.
It was an absolute maintenance disaster and they recanted by offering
dynamically-bound result sets. The lesson there is that defining a
struct for each query won't likely play out, so we better use
On 10/7/11 12:02 PM, Piotr Szturmaj wrote:
Andrei Alexandrescu wrote:
1. MFC had at a point a wizard that generated one struct per resultset.
It was an absolute maintenance disaster and they recanted by offering
dynamically-bound result sets. The lesson there is that defining a
struct for each q
In my database.d, I used a database row struct to provide both
integer and key based indexes.
On 10/7/2011 1:03 PM, Andrei Alexandrescu wrote:
On 10/7/11 11:42 AM, Xinok wrote:
Hi, it's been years since I've posted here. I just wanted to share
something I worked on, a new sorting algorithm. It's a variant of merge
sort, but much more memory efficient with only a small loss in
performance
Andrei,
I've actually already got that in a way. Before I attempt to populate fields
into
a struct, the struct is checked to see if it conforms to the field properties.
Steve
Dmitry Olshansky Wrote:
> Well, if Jesse won't mind.
> I'll wrap the thing up in my phobos fork in a couple of moments.
> Anyone going for review manager?
>
>
> --
> Dmitry Olshansky
I'm good with that. Hmm, maybe I can take on managing the review for you.
On Oct 7, 2011, at 8:46 AM, Andrei Alexandrescu wrote:
> On 10/7/11 9:11 AM, Steve Teale wrote:
>> I'm thinking that for each database that gets covered there will
>> need to be two modules, like:
>>
>> etc.c.mysql
>> etc.mysqld
>>
>> The etc.c.xxx modules would be completely different between d
On 10/7/11 12:23 PM, Xinok wrote:
http://www.neowin.net/forum/blog/422/entry-3737-sort-algorithm-complete/
This is interesting. What do the numbers in the benchmark represent?
Andrei
I'll just post the code I used for benchmarking. Simply put, smaller
numbers are faster.
[snip]
Thanks. It
tinkered with timsort a bit a few months ago. comparing that to your
sort, I get numbers like
xinokSort
random: 77 ascending: 0 descending: 21
timsort
random: 354 ascending: 1 descending: 4
where each are sorting a 500k element array of int, times are msecs,
compilation flags were -O -i
Andrei,
So if I'm understanding you correctly, if structs are used, and there's a
database
change, then the app has to be rebuilt. If Variants, then only the app's config
file has to be updated (or the app can look in the database to get such
information) - have I got this right?
Steve
On 10/07/2011 01:20 PM, Andrei Alexandrescu wrote:
> Also, which version of D are you using? I'm seeing that
> std.algorithm.sort (introSort) performs quite badly; for example, it's
> twice as slow on shuffled data against quickSort, and it also deals
> badly with already sorted data. Generally i
Andrei Alexandrescu Wrote:
> http://www.reddit.com/r/programming/comments/l3tk5/merging_in_the_gnu_d_language_compiler_to_gcc/
>
> Andrei
I like your comment about being in 1981. If I'm not mistaken, what he describes
in this
http://youtu.be/HxaD_trXwRE?t=7m55s
is that toString is a Unique ad
On Oct 7, 2011, at 10:14 AM, Adam Ruppe wrote:
> In my database.d, I used a database row struct to provide both
> integer and key based indexes.
Funny… I have a ResultSet object which contains an array of Column objects.
Here's the basic idea:
class ResultSet {
static class Column {
On Oct 7, 2011, at 11:27 AM, Steve Teale wrote:
> Andrei,
>
> So if I'm understanding you correctly, if structs are used, and there's a
> database
> change, then the app has to be rebuilt. If Variants, then only the app's
> config
> file has to be updated (or the app can look in the database to
On 10/7/2011 2:20 PM, Andrei Alexandrescu wrote:
On 10/7/11 12:23 PM, Xinok wrote:
http://www.neowin.net/forum/blog/422/entry-3737-sort-algorithm-complete/
This is interesting. What do the numbers in the benchmark represent?
Andrei
I'll just post the code I used for benchmarking. Simply pu
Sean Kelly wote:
> Does your Row equate to the ResultSet above?
Fairly similar.
Mine looks something like this:
interface ResultSet {
// name for associative array to result index
int getFieldIndex(string field);
string[] fieldNames();
bool empty();
Row f
On 2011-10-07 16:11, Steve Teale wrote:
I'm thinking that for each database that gets covered there will
need to be two modules, like:
etc.c.mysql
etc.mysqld
The etc.c.xxx modules would be completely different between databases -
just translations of the necessary header files. The xxxd modules
On 2011-10-07 15:34, Adam Ruppe wrote:
What's the big advantage of
Person.find_all_by_name_and_age("Joe", 15)
over
db.query("select * from people where name = ? and age = ?", "Joe", 15);
The latter is much easier to write in the library and you retain all
the flexibility of sql itself if ne
On 10/7/11 1:27 PM, Steve Teale wrote:
Andrei,
So if I'm understanding you correctly, if structs are used, and there's a
database
change, then the app has to be rebuilt.
Yes. Touched to update the structs and rebuilt.
If Variants, then only the app's config
file has to be updated (or the ap
Andrei Alexandrescu wrote:
On 10/7/11 12:02 PM, Piotr Szturmaj wrote:
Did you see http://pszturmaj.github.com/ddb/db.html ? It maps tuples,
structs and arrays in similar manner.
I did. Looks good. Why do you need DBRow? You could simply use
Variant[], the given struct, or Tuple directly.
Sur
On 07.10.2011 21:48, Jesse Phillips wrote:
Dmitry Olshansky Wrote:
Well, if Jesse won't mind.
I'll wrap the thing up in my phobos fork in a couple of moments.
Anyone going for review manager?
--
Dmitry Olshansky
I'm good with that. Hmm, maybe I can take on managing the review for you.
Th
On 10/07/11 13:36, Ellery Newcomer wrote:
On 10/07/2011 01:20 PM, Andrei Alexandrescu wrote:
Also, which version of D are you using? I'm seeing that
std.algorithm.sort (introSort) performs quite badly; for example, it's
twice as slow on shuffled data against quickSort, and it also deals
badly
On 10/07/11 15:00, Piotr Szturmaj wrote:
Andrei Alexandrescu wrote:
On 10/7/11 12:02 PM, Piotr Szturmaj wrote:
Did you see http://pszturmaj.github.com/ddb/db.html ? It maps tuples,
structs and arrays in similar manner.
I did. Looks good. Why do you need DBRow? You could simply use
Variant[],
On 10/07/11 13:50, Xinok wrote:
On 10/7/2011 2:20 PM, Andrei Alexandrescu wrote:
On 10/7/11 12:23 PM, Xinok wrote:
http://www.neowin.net/forum/blog/422/entry-3737-sort-algorithm-complete/
This is interesting. What do the numbers in the benchmark represent?
Andrei
I'll just post the code
I'm just wondering, does Glasgow Haskell Compile (GHC) have the most
advanced GC? I remember reading where it said that GHC is like 10 years
ahead of all the other compilers, or something to that effect.
On Sat, 08 Oct 2011 00:34:26 +0400, Dmitry Olshansky wrote:
> Thanks, that would be great.
>
> On the bright side of things I'm hitting a funky error after merging
> FReD into phobos, compiler stops recognizing std.c.xxx in std.file and
> issues errors like:
> std/file.d(537) Error: undefined ide
Caligo:
> I'm just wondering, does Glasgow Haskell Compile (GHC) have the most advanced
> GC?
> I remember reading where it said that GHC is like 10 years ahead of all the
> other compilers,
> or something to that effect.
If you want to find an advanced GC that is years ahead of all other ones,
On Sat, 08 Oct 2011 00:34:26 +0400, Dmitry Olshansky wrote:
> On the bright side of things I'm hitting a funky error after merging
> FReD into phobos, compiler stops recognizing std.c.xxx in std.file and
> issues errors like:
> std/file.d(537) Error: undefined identifier package c.stdio
>
> For
On 10/7/2011 2:27 PM, Ellery Newcomer wrote:
tinkered with timsort a bit a few months ago. comparing that to your
sort, I get numbers like
xinokSort
random: 77 ascending: 0 descending: 21
timsort
random: 354 ascending: 1 descending: 4
where each are sorting a 500k element array of int
On 10/7/2011 5:08 PM, Andrei Alexandrescu wrote:
On 10/07/11 13:50, Xinok wrote:
On 10/7/2011 2:20 PM, Andrei Alexandrescu wrote:
On 10/7/11 12:23 PM, Xinok wrote:
http://www.neowin.net/forum/blog/422/entry-3737-sort-algorithm-complete/
This is interesting. What do the numbers in the benc
I've been getting more familiar with both git and hg, and I'm coming to the
conclusion that I like TortoiseGit far more than TortoiseHg, but when I have
to use them at the cmd line (which I hate to have to do), I can't stand
Git's cmd line interface, but Hg seems to be pretty nice (and I like Hg
I use this title at Andrei's suggestion, and repeat his idea that it be used
as a prefix for discussions as we navigate toward a design. Unless there is
resistance to the idea, I will on the job of implementing whatever we decide
is appropriate. I am retired, and have the time to do it.
It seems t
73 matches
Mail list logo