14-Jan-2014 01:24, "Ola Fosheim Grøstad"
" пишет:
On Monday, 13 January 2014 at 21:08:50 UTC, Dmitry Olshansky wrote:
So what? It can't move it and as such there is nothing special about
it, it doesn't _cost_ anything to pin object.
Well, the advantage of compacti
13-Jan-2014 22:44, "Ola Fosheim Grøstad"
" пишет:
On Monday, 13 January 2014 at 17:56:12 UTC, Dmitry Olshansky wrote:
Precisely. Since C space has no type information you have to
conservatively assume that everything can be a pointer.
I think we are misunderstanding each other
in C
heap (and not being marked explicitly).
--
Dmitry Olshansky
7;d wanted to review the code itself I never found time
to do it.
--
Dmitry Olshansky
13-Jan-2014 21:49, "Ola Fosheim Grøstad"
" пишет:
On Monday, 13 January 2014 at 17:45:26 UTC, Dmitry Olshansky wrote:
How would it be expensive? I don't see a need to do anything to "pin"
a memory block, at the time of scanning there will be a potential
pointer
to explicitely pin every pointer passed to C functions would be
very expensive.
How would it be expensive? I don't see a need to do anything to "pin" a
memory block, at the time of scanning there will be a potential pointer
to it (in the stack space of C function or registers).
--
Dmitry Olshansky
13-Jan-2014 00:12, Michel Fortin пишет:
On 2014-01-12 20:08:17 +, Dmitry Olshansky
said:
12-Jan-2014 23:59, Kira Backes пишет:
Hello,
I was just looking at the source of std.typecons.RefCounted and it seems
like it is not thread-safe at all, the count variable may be written
-local by default.
And shared(RefCounted!T) would most likely fail to compile.
Is
this correct or am I overlooking something (I’m still new to D). If it
is correct then this should either be fixed or if it is intentional it
should really be documented.
--
Dmitry Olshansky
ake "mostly-moving" collector?
For that we discern precise pointers (with typeinfo) and conservative
(such as potential pointers in registers/stack). Then any block pointed
to by a least one conservative pointer is pinned, others though can be
moved freely since all of the pointers are known.
--
Dmitry Olshansky
indeed may look confusing at start but keep in mind that
range.front is in fact a lookahead of 1. Thus all algorithms that can
work with lookahead of 1 LL(1), LALR(1) etc. would easily work any
forward/input range (though any practical parser need to slice or copy
parts of input aside).
--
Dmitry Olshansky
ually more like "toLowerProbablyInPlace"
With high probablity :)
And it's indeed quite high, the amount of "bad sheep" that gets
longer/shorter across the whole Unicode is around 5-10 codepoints IRC.
--
Dmitry Olshansky
3 separate heaps, so that addresses given for immutable
stuff would never be (sometime later) assigned to (thread-local)
mutable? I might have got this point of yours wrong, but I think there
is a merit in having separate heap at least for shared stuff.
--
Dmitry Olshansky
DDox?
Seconded.
--
Dmitry Olshansky
ot at all. Take time to read the Unicode standard.
Surrogate pairs are a part of UTF-16 encoding and little else.
--
Dmitry Olshansky
10-Jan-2014 11:49, Dmitry Olshansky пишет:
10-Jan-2014 05:16, Adam D. Ruppe пишет:
On Friday, 10 January 2014 at 00:56:36 UTC, Manu wrote:
So is it 'correct'?
Yes, with the caveat that it might find a surrogate pair (like H
followed by an accent code point). That's what byGr
09-Jan-2014 21:38, Adam D. Ruppe пишет:
On Thursday, 9 January 2014 at 14:08:02 UTC, Manu wrote:
string y = find(retro("Hello"), 'H');
import std.string;
auto idx = lastIndexOf("Hello", 'H');
Wow, that's unbelievable difficult. D sucks.
+1 LOL
--
Dmitry Olshansky
07-Jan-2014 15:52, Iain Buclaw пишет:
On 7 Jan 2014 10:20, "Dmitry Olshansky" mailto:dmitry.o...@gmail.com>> wrote:
>
> 07-Jan-2014 12:30, Adam Wilson пишет:
>>
>> On Tue, 07 Jan 2014 00:05:35 -0800, Ola Fosheim Grøstad
>> mailto:ola.fosheim.grostad
ation of some old crap to me.
And how would you use a GPU w/o manufacturer provided drivers?
DX also builds on top of vendor specific drivers.
--
Dmitry Olshansky
07-Jan-2014 11:59, Jason White пишет:
On Monday, 6 January 2014 at 10:26:27 UTC, Dmitry Olshansky wrote:
Ok, now I see. In my eye though serialization completely hides raw
stream write.
So:
struct SomeStream{
void write(const(ubyte)[] data...);
}
struct Serializer(Stream){
void write
oped.
It would be better not to or you risk introducing suboptimal software
rendering patterns that do not have even remote correspondence to the
hardware.
--
Dmitry Olshansky
,
support from phobos - it is tough.
So you want to put this burden on compiler writers. Can't really
sympathize ;)
--
Dmitry Olshansky
05-Jan-2014 15:08, Jason White пишет:
On Sunday, 5 January 2014 at 09:33:46 UTC, Dmitry Olshansky wrote:
As an advice I'd suggest to drop the 'Data' part in
writeData/readData. It's obvious and adds no extra value.
You're right, but it avoids a name clash if it
05-Jan-2014 09:22, Jason White пишет:
On Saturday, 4 January 2014 at 13:32:15 UTC, Dmitry Olshansky wrote:
IMHO C run-time I/O has no use in D. The amount of work spent on
special-casing the non-locking primitives of each C run-time,
repeating legacy mistakes (like text mode, codepages and
31-Dec-2013 22:46, Joseph Cassman пишет:
On Tuesday, 31 December 2013 at 09:04:58 UTC, Dmitry Olshansky wrote:
31-Dec-2013 05:53, Joseph Cassman пишет:
On Sunday, 29 December 2013 at 22:02:57 UTC, Dmitry Olshansky wrote:
I'm thinking there might be a way to bridge the new range type
ge - it builds on
top of forward range making it instantly compatible with the most of
std.algorithm. The only problem at the moment is slightly worse
performance with DMD (who cares) and that it segfaults with LDC (and
this is a problem). Would be nice to test LDC first but I think I'll
31-Dec-2013 05:51, Brad Anderson пишет:
On Sunday, 29 December 2013 at 22:02:57 UTC, Dmitry Olshansky wrote:
Proposal
Having never written any parser I'm not really qualified to seriously
give comments or review it but it all looks very nice to me.
Speaking as just an end user of
31-Dec-2013 05:53, Joseph Cassman пишет:
On Sunday, 29 December 2013 at 22:02:57 UTC, Dmitry Olshansky wrote:
[...]
Interesting idea. Seems to fill a need I have been facing with some
parsing code.
Since I was unclear about how its functionality compares to ForwardRange
I took a look through
se there's a member function called 'remove' in a struct that
took precedence over the module-level 'remove' function. (Not to mention
it breaks HTML compliance because it gives multiple elements the same
ID.)
Yeah, that's another problem.
And couple of years old at that...
--
Dmitry Olshansky
yte[] mapAvailable() pure nothrow
ubyte[] mapAtLeast(in ℕ count)
Yeah, that's a good idea.
I mean primitives, not Unicode in type names ;)
--
Dmitry Olshansky
30-Dec-2013 02:45, Vladimir Panteleev пишет:
On Sunday, 29 December 2013 at 22:02:57 UTC, Dmitry Olshansky wrote:
[snip]
Hmm, just yesterday I was rewriting a parser to use a buffer instead of
loading the whole file in memory, so this is quite timely for me.
Questions:
1. What happens when
buffer (require minimal history).
5. Cheap lookahead/lookbehind.
This exploits the fact that underlying buffer is nothing but array,
hence one may easily take a peek at some portion of it as plain ubyte[].
Implementation makes sure it buffers up enough of data as required
and/or returns empty range if not possible. This supports things like
LL(k) lookahead and fixed-length lookbehind that is common in regex
0-width assertions.
These 2 can be implemented with relative 'seek' +front/popFront, the
question remains is how effective it'll be.
--
Dmitry Olshansky
29-Dec-2013 23:28, Vladimir Panteleev пишет:
On Sunday, 29 December 2013 at 18:45:36 UTC, Dmitry Olshansky wrote:
I've come to conclusion that the only sane line ending behavior is to
do what Unicode standard says, and detect the following pattern as
line separator:
\r\n | \r | \f | \v
cted_ to
create? Why not pick something accessible in the first place?
--
Dmitry Olshansky
e
separator:
\r\n | \r | \f | \v | \n | \u0085 | \u2028 | \u2029
This includes never breaking a line in between \r\n sequence.
--
Dmitry Olshansky
It would even work out of the box with current user-defined pack types
if they have .expand.
--
Dmitry Olshansky
://wiki.ecmascript.org/doku.php?id=harmony:destructuring
http://wiki.ecmascript.org/doku.php?id=proposals:destructuring_assignment
Bye,
bearophile
--
Dmitry Olshansky
22-Dec-2013 08:23, Andrei Alexandrescu пишет:
On 12/21/13 1:38 PM, Dmitry Olshansky wrote:
As it stands the only thing lazy buys us is "pay as you touch" contrary
to "pay as you name the intent to touch". The problem is that the
payment is for the whole stock of the said
22-Dec-2013 02:16, monarch_dodra пишет:
On Saturday, 21 December 2013 at 21:38:59 UTC, Dmitry Olshansky wrote:
As it stands the only thing lazy buys us is "pay as you touch"
contrary to "pay as you name the intent to touch". The problem is that
the payment is for the who
22-Dec-2013 01:16, Andrei Alexandrescu пишет:
On 12/21/13 1:06 PM, Dmitry Olshansky wrote:
21-Dec-2013 21:10, Andrei Alexandrescu пишет:
On 12/21/13 12:08 AM, Dmitry Olshansky wrote:
21-Dec-2013 00:43, Martin Nowak пишет:
Couldn't static imports be made lazy without breaking any code
21-Dec-2013 21:10, Andrei Alexandrescu пишет:
On 12/21/13 12:08 AM, Dmitry Olshansky wrote:
21-Dec-2013 00:43, Martin Nowak пишет:
Couldn't static imports be made lazy without breaking any code?
The above example would read.
static import std.range.
void foo(R)(R rang
disadvantage of importing the whole std.range.
I seriously doubt that we'd get anything better then:
> import std.range.traits;
>
> void foo(R)(R range) if (isForwardRange!R)
> {
import std.range;
...
> }
Stays practical w.r.t. cutting down dependencies and no need to uglify
constraints. They are not that readable already.
--
Dmitry Olshansky
valgrind works just fine for me. If compiled with debug symbols
callgrind works quite well, and so do the other tools e.g. massif.
--
Dmitry Olshansky
19-Dec-2013 01:40, Andrei Alexandrescu пишет:
On 12/18/13 1:16 PM, Dmitry Olshansky wrote:
19-Dec-2013 01:06, Andrei Alexandrescu пишет:
http://chopapp.com/#fvepfd8 shows the number of dependencies (plus 1)
for each module in phobos. Those include druntime dependencies.
So the bill of using
.
--
Dmitry Olshansky
uot;alpha", "beta", "delta"] )
Wouldn't
if (foo in LiteralSet("alpha", "beta", "delta"))
be a ton faster?
Or even:
if (foo in LiteralSet!("alpha", "beta", "delta"))
Andrei
--
Dmitry Olshansky
17-Dec-2013 01:40, Walter Bright пишет:
On 12/16/2013 12:17 PM, Dmitry Olshansky wrote:
And, of course, speaking of linking:
https://d.puremagic.com/issues/show_bug.cgi?id=4
Did you try -allinst ?
Yes, then it links.
Interestingly enough I only need -allinst with
-inline
16-Dec-2013 23:03, Walter Bright пишет:
On 12/16/2013 9:15 AM, Dmitry Olshansky wrote:
It's still broken as it was during release. Most of my projects don't
link
normally. That and -inline leading to curious crashes in my code make
me use dmd
only as an interpreter.
Are there bug r
dmd only as an interpreter.
--
Dmitry Olshansky
;s hope! :P
Sadly it was in a hotel parking lot, and not committed to the eternal
historic
record (ie, the forum).
Yes, I remember, and you did convince me!
Yay!
--
Dmitry Olshansky
08-Dec-2013 13:25, Namespace пишет:
On Sunday, 8 December 2013 at 09:14:44 UTC, Dmitry Olshansky wrote:
08-Dec-2013 02:32, Namespace пишет:
[snip]
And what do you use?
Because it's more D'ish.
There is no such objective quality as being D'ish.
GC.malloc/GC.free are no bet
~this() {
GC.free(this.arr.ptr);
this.arr = null;
GC.minimize();
This is slow. Just use malloc & free, why touch GC at all?
}
}
void main() {
// need temp memory
scoped!(int[]) arr = new int[n];
}
And what do you use?
--
Dmitry Olshansky
07-Dec-2013 13:32, Johannes Pfau пишет:
Am Sat, 07 Dec 2013 03:12:02 +0400
schrieb Dmitry Olshansky :
07-Dec-2013 02:20, Walter Bright пишет:
"there is no way proper C code can be slower than those languages."
3. Function inlining has generally been shown to be of tremendou
reasoning there, too.
That is just one way to it. Most of the time "the right thing" is to
factor things into smaller reusable parts. Unlike Go we have ways to
write very flexible code once and have it run at top speed in all cases.
--
Dmitry Olshansky
07-Dec-2013 11:15, Dmitry Olshansky пишет:
07-Dec-2013 03:55, H. S. Teoh пишет:
On Fri, Dec 06, 2013 at 03:19:24PM -0800, Walter Bright wrote:
On 12/6/2013 3:02 PM, Maxim Fomin wrote:
[snip]
import std.regex.traits;
auto dirEntries(C, RegEx)(in C[] path, RegEx re)
if(isSomeChar!C
e may do something like this:
import std.regex.traits;
auto dirEntries(C, RegEx)(in C[] path, RegEx re)
if(isSomeChar!C && isRegexFor!(Regex, C))
{
import std.regex; //full package
...
}
--
Dmitry Olshansky
pically "faster then
Cee" ;)
--
Dmitry Olshansky
nt as well.
In the longterm, well, they do offer digital editions (ISO images) for
quite some time. I do suspect I can actually share ISO myself legally,
as the only thing you do buy from MS is LICENSE (i.e. the key).
--
Dmitry Olshansky
container type defines allocation scheme (=some
container specific default).
As an extended version allow passing reference to an allocator to use
with that container type.
--
Dmitry Olshansky
.
There is a tool for that. Nothing stellar but it does the job:
https://github.com/D-Programming-Language/tools/blob/master/changed.d
Also be sure to contact Andrej Mitrovic he is a mastermind behind nice
changelogs we had for the last couple of releases.
--
Dmitry Olshansky
tectures times Y OS ABIs and generate code of at least moderate
quality.
JIT would have the benefit of being usable for patterns not known ahead
of time though.
--
Dmitry Olshansky
about paid stuff, if there is one thing I'd consider
necessary to kickstart funds for is creation of formal language
specification and keeping it maintained. It is one of things that don't
go with volunteer efforts very well.
+1
--
Dmitry Olshansky
oded range that is
2 in one: some stronger (as in capabilities) range of code elements and
the default decoded view imposed on top of it (that can be weaker).
--
Dmitry Olshansky
27-Nov-2013 20:18, Wyatt пишет:
On Wednesday, 27 November 2013 at 15:43:11 UTC, Jakob Ovrum wrote:
It
honestly surprised me how many things in std.uni don't seem to work on
ranges.
Which ones? Or do you mean more like isAlpha(rangeOfCodepoints)?
--
Dmitry Olshansky
talk about boundaries,
and grapheme is what happens to be in between).
More specifically D's std.uni follows the notion of the extended
grapheme cluster. There is no need to stick with ugly legacy crap.
See also
http://www.unicode.org/reports/tr29/
-Wyatt
--
Dmitry Olshansky
escribed is interesting and is worth trying out in
addition to what we have in std.uni.
--
Dmitry Olshansky
doesn't at all solve the interchange at all - you'd have to encode
on write/re-code on read
b) It relies on having global shared state across the whole program, and
that's the real show-stopper thing about it
In any case it's a direction well worth exploring.
T
--
Dmitry Olshansky
the string and issuing a table lookup
per codepoint.
David
--
Dmitry Olshansky
26-Nov-2013 23:40, Andrei Alexandrescu пишет:
On 11/26/13 11:23 AM, Dmitry Olshansky wrote:
For the moment it looks as if half people are pissed off because of the
work they would need to do on it (workaround, shipping, maintenance,
etc.), and the other half (using it) are having usability
stands already.
P.S. And before I forgot - there are specifics problems with curl Linux
distros that are not Debian derived and with shared phobos in
particular, but there are fokls that must known this side of coin better
then I.
--
Dmitry Olshansky
26-Nov-2013 09:06, Daniel Murphy пишет:
"Dmitry Olshansky" wrote in message
news:l6tfm8$2hnj$1...@digitalmars.com...
Can't it just check for the real part being exactly zero and special- case
multiplication for that?
There is no such thing as exactly zero in floating poin
fundamental problem with a complex type in general. C++
has this issue as well. You need a purely imaginary type with the
appropiate operations between Complex and Imaginary defined.
Can't it just check for the real part being exactly zero and special-
case multiplication for that?
--
Dmitry Olshansky
24-Nov-2013 00:55, bearophile пишет:
This works if you compile with the -d switch:
Can this situation be fixed/improved?
Use an alias?
--
Dmitry Olshansky
that even later will be a problem.
Spot on, +1 from me.
Bye,
bearophile
--
Dmitry Olshansky
viral. With escape hatch though, it may be done
step by step.
--
Dmitry Olshansky
ust notify/wait a bit/do the change?
--
Dmitry Olshansky
!(sanitizeFileName,
string) path) {
// Do stuff
}
--
Dmitry Olshansky
n actually use it for something without casting it first.
Otherwise I think it's a good idea to encode high-level invariants in
types. The only problem is inadvertent template bloat then.
[snip]
--
Dmitry Olshansky
ng.
There is a whole class of functions where validation is ~ the same
amount of work as scrubbing the input. Do I need to provide an example
of parser? :)
--
Dmitry Olshansky
Day day);
The first better be designed to scrub input, while the second is
designed to accept verified values (hence Year, Month and not naked ints).
--
Dmitry Olshansky
16-Nov-2013 17:02, bearophile пишет:
Dmitry Olshansky:
Pull & peek at preliminary results
https://github.com/D-Programming-Language/phobos/pull/1685
Docs
http://blackwhale.github.io/phobos/std_uni.html#MatcherConcept
Good. Are those ideas usable for other Phobos functions, like group?
stuff in something:
https://d.puremagic.com/issues/show_bug.cgi?id=10929
A CTFE dtor bug, blocks my efforts with std.regex for 2.065.
--
Dmitry Olshansky
le of
bytes to spare per node).
--
Dmitry Olshansky
13-Nov-2013 01:16, Dicebot пишет:
On Tuesday, 12 November 2013 at 20:56:34 UTC, Dmitry Olshansky wrote:
If we just had:
//this would invoke compiler's parser at CTFE
auto ast = "x = y;".astof
and have it work at CTFE to return sensible AST (a big if btw).
And then (after som
27;s can be just
foo!q{
...
};
For instance this is compilable:
{
import std.regex;
auto r = ctRegex!"how do you think that works?";
}
See ctRegex template in std.regex.
--
Dmitry Olshansky
13-Nov-2013 22:46, Andrei Alexandrescu пишет:
On 11/13/13 10:41 AM, Dmitry Olshansky wrote:
13-Nov-2013 13:27, Andrei Alexandrescu пишет:
On 11/13/13 12:55 AM, Jacob Carlborg wrote:
On 2013-11-13 05:07, Andrei Alexandrescu wrote:
Then how do you figure doing this:
class Streamable
Simply on the ground of "solves problem in too narrow scope for a hefty
coast to the user" I'd drop it.
--
Dmitry Olshansky
ved in the
Unicode Standard for internal use. They are forbidden for use in open
interchange of Unicode text data.
--
Dmitry Olshansky
):
ast.toString() //get back a string of D code
It may help code generation of D --> DSL.
Alternatively one can implement D parser that works at CTFE and watch it
crawl :)
--
Dmitry Olshansky
11-Nov-2013 15:55, simendsjo пишет:
On Monday, 11 November 2013 at 11:43:01 UTC, Dmitry Olshansky
wrote:
11-Nov-2013 15:06, Manu пишет:
but enum works fine:
enum priorityMap = [
"1" : "blocker",
"2" : "critical",
uot;major",
"6" : "major",
"7" : "minor",
"8" : "minor",
"9" : "trivial" ];
So it does... I didn't think of an enum AA ;)
... copy pastes that literal everywhere, I'm sure you'll like it ;)
--
Dmitry Olshansky
s like I can use AST literal in R-T code as well? That would
be useful but only if some library actually accepted these AST nodes.
--
Dmitry Olshansky
hub.com/D-Programming-Language/phobos/pull/1685
Docs
http://blackwhale.github.io/phobos/std_uni.html#MatcherConcept
Caveats: like it's 'backend' std.uni Trie it suffers from poor
performance on DMD. Kudos to LDC team, or I'd gave up on the whole idea.
--
Dmitry Olshansky
g the disassembly of the binary will get the answer.
--
Dmitry Olshansky
nsafe :/ It's a delicate process.
Well if it's indeed Mar 2014 I think there is no rush :)
--
Dmitry Olshansky
ong but but we seem to be very close to
achieving this symbolic goal and then it's well worth prioritizing.
More to come I hope.
--
Dmitry Olshansky
one else will change
the value. But since no-one else can change the value it seems overkill,
no?
immutable is useful for non-value types. Say strings, then wherever
function/module it's passed later on can safely avoid copying it since
it's immutable.
--
Dmitry Olshansky
7
not be replaced with ubyte[size] _store = void; ?
Hm... Andrei has just been caught using internal pointers in structs :o)
--
Dmitry Olshansky
r the type-system is often violated and most code out there
that uses synchronized on class instance undoubtedly violates it.
I'd say optimally shared(Class) should have monitor field, others don't.
This would mean that cast to shared must not work on class references.
--
Dmitry Olshansky
quot;age": @age,
"address": {
@fieldName: "@address",
}
}.embed!(age, fieldName, address);
writeln(y);
}
Prints as expected:
var=2, second=3.14, third=hello!
"firstName": "",
"age": 45,
"address": {
my_field: "Fleet st. 15",
}
Now isn't it already nice beyond proportions?
--
Dmitry Olshansky
07-Nov-2013 00:24, Timothee Cour пишет:
On Wed, Nov 6, 2013 at 10:49 AM, Dmitry Olshansky mailto:dmitry.o...@gmail.com>> wrote:
06-Nov-2013 21:40, Manu пишет:
On 7 November 2013 03:14, Dmitry Olshansky
mailto:dmitry.o...@gmail.com>
<mailto:dmitry.o.
701 - 800 of 2126 matches
Mail list logo