Andrej Mitrovic:
This is why we have core.std.config:
import core.stdc.config : c_long, c_ulong;
Why isn't that linked in this page?
http://dlang.org/phobos/std_stdint.html
I'd like to open a little documentation enhancement request for
that.
Bye,
bearophile
Why isn't that linked in this page?
http://dlang.org/phobos/std_stdint.html
It seems it lacks some of them, this gives an import error:
import core.stdc.config: c_ulonglong, c_longlong;
Bye,
bearophile
Andrei Alexandrescu:
And while you are at it, please also contribute the
corresponding pull request. Time to inaugurate bearophile's
additions!
As my friend, please understand, I can't afford to get addicted
to that :-)
Hugs,
bearophile
Andrej Mitrovic:
Because it's on this page:
http://dlang.org/interfaceToC.html
It seems it lacks some of them, this gives an import error:
import core.stdc.config: c_ulonglong, c_longlong;
Again see http://dlang.org/interfaceToC.html
Good, thank you. I missed that.
Bye,
bearophile
Andrei Alexandrescu:
http://www.reddit.com/r/programming/comments/1fkr5s/dconf_2013_day_2_talk_4_web_development_in_d_by/
On Reddit they seem to suggest the idea of good stack traces for
fibers...
Bye,
bearophile
Andrei Alexandrescu:
http://www.reddit.com/r/programming/comments/1fpw2r/dconf_2013_day_2_talk_5_a_precise_garbage/
Is this useful to make the GC precise regarding the stack too?
http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.19.5570
Bye,
bearophile
SomeDude:
Is this useful to make the GC precise regarding the stack too?
http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.19.5570
Bye,
bearophile
Here is the blog post deadalnix is referring about at the very
end of the video:
http://www.deadalnix.me/2012/03/05/impact-of-64bits-vs
x27;s hard to guess the size and signedness of types as
byte, ubyte, wchar, dchar. I prefer names that are more clear.
Bye,
bearophile
Walter Bright:
It would only be a trivial problem for 5 minutes, only for
ex-C/C++ programmers who are used to suffering under variable
sized ints, and will never be a problem again.
Is it really a problem to guess the size of 'byte'? Or that
'ubyte' is unsigned? Come o
hdcMem = CreateCompatibleDC(hdc);
HBITMAP hbmOld = SelectObject(hdcMem, s.handle);
GetObject(i.handle, bm.sizeof, &bm); <<
Bye,
bearophile
-)
oops fixed.
After this you will probably be more careful in future, to avoid
similar bugs :-)
Bye and thank you,
bearophile
m the window menu on
the top left.
Bye,
bearophile
tting library that
allows me to plot data with few lines of code. This allows me to
visualize intermediate data during debugging, like arrays, so it
improves my understanding of data and such data.
Bye,
bearophile
good idea to put the
resulting large library in Phobos, because everyone has different
needs and tastes regarding GUI toolkits.
Bye,
bearophile
Steven Schveighoffer:
I have no doubt that solar technology will continue to
innovate, but the worst thing we can do right now is subsidize
it. When it's ready (and it will be), it will succeed on its
own merits.
The situation is far more complex than that.
Bye,
bearophile
ct)<
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.
Bye,
bearophile
o be thoroughly field-tested before it
becomes clear how good or bad it is.
Maybe checked exceptions are bad only for the type system of
Java. Maybe for a language that has global type inferencing on
the exceptions such feature becomes better.
Bye,
bearophile
encer for exceptions.
Bye,
bearophile
tions, but forces you to catch exceptions somewhere,
assuring no holes remain if you don't want holes.
Bye,
bearophile
IDE) what are the current exceptions
that can happen there.
- If you don't handle exceptions in the main, your program will
throw them. If you annotate a function with nothrow then the type
system forces you to handle all the possible exceptions of that
function inside the function.
Bye,
bearophile
Walter Bright:
See the link to Bruce Eckel's article I posted in this thread.
Mine was a rhetorical question :-)
Bye,
bearophile
code like this:
final switch (color)
{
case Color.red:
With code like:
final switch (color) with (Color)
{
case red:
Bye,
bearophile
toChars());
with a little cleanup and a wrapper macro and I think that
would be good.
Maybe with a compiler switch syntax like:
-D:+-switch1,...,+-switchn
Using a command like?
-D:+contracts
Bye,
bearophile
er:
http://lambda-the-ultimate.org/node/4762
The question:
C's type system can be seen as a constraint checker; Haskell's
as a constraint solver. If you had a general purpose constraint
solver at compile-time what could you use it for other than type
checking?<
Bye,
bearophile
Bye,
bearophile
ere's one D design problem here.
Bye,
bearophile
-and-guess, and different static analysers will digest
different amounts of D syntax and semantics, causing those
contracts to be not portable across static analysers. Both Ada
and Liquid Haskell avoids all this.
Bye,
bearophile
I don't understand this topic well enough, so I am not saying
useful things. Thank you for your comments Timon...
Bye,
bearophile
submitted by me). If you have a link
to the PFFT code them maybe I can do that myself.
Slide 25:
Implicit invariants often hard to track down
Then maybe it's a good idea to add such invariants to the dmd
front-end code, even before its port to D.
Bye,
bearophile
more D-iomatic, both in formatting and in idioms/style. Like
using contracts, not using core C functions, using pascalCase,
etc. (Such changes are many, but they are quick and easy to do.)
Bye,
bearophile
Paulo Pinto:
Thanks for the input, I will take it for an updated version of
the article, if it just stays on my web site.
I suggest to also offer a plain text (un-colorized) version of
the code. I have spent minutes to convert it.
Bye,
bearophile
v * invSamples;
- - - - - -
I'll take a better look at ispc.
Bye,
bearophile
will expect something functionally
like __builtin_prefetch to be available in D too:
http://gcc.gnu.org/onlinedocs/gcc/Other-Builtins.html#index-g_t_005f_005fbuiltin_005fprefetch-3396
Thank you,
bye,
bearophile
iche at a level lower than D).
In threads where both Rust and D are discussed, I suggest
everybody to not express bad opinions in general about Rust. If
you want to criticize Rust then I suggest to write only on very
specific features at a time.
Bye,
bearophile
Manu:
This is interesting. I didn't know about this.
An important thing here is: what's the semantics present in that
language that is missing in D (and that is useful for the
optimizer)? Is it possible/worth to add it?
Bye,
bearophile
possible and good to replace it with some UDA?
I'm planning to create a DIP for this and would really like
this to be folded into main line.
It seems contain some different things/syntax. I don't know how
much Walter&Co will appreciate it.
Bye,
bearophile
obably each one new thing introduced
needs a separate discussion.
Bye,
bearophile
nted syntax, or because the compiler
recovering of errors must consider more possibilities), the
compiler gets a little larger. Thinking that some new syntax has
no costs is very wrong.
Bye,
bearophile
standardized kind of
tagged union):
http://d.puremagic.com/issues/show_bug.cgi?id=5057
In an Algebraic there is run-time information for the GC to
decide if inside it there are pointers to follow or not. It's
mostly a matter of letting the GC recognize and use such
information.
Bye,
bearophile
x27;t change the contents and the type of an algebraic
variable once it is assigned. So usually you call gc_emplace only
once for one of such variables).
Bye,
bearophile
ere close to such
good/efficient usage of SIMD instructions. And the compiler is
also able to spread the work on multiple cores. I think D is
meant to be used for similar numerical code too, so perhaps the
little amount of ideas contained in this very C-like language is
worth stealing and adding to D.
Bye,
bearophile
the performance of such range-based code,
writing benchmarks. Unfortunately often DMD doesn't compile it
efficiently.
Bye,
bearophile
tail[_indexHead[a]]);
auto r2 = iota(_sumTail[v], _sumTail[v + 1]).map!(a =>
_head[_indexTail[a]]);
return chain(r1, r2);
Anyway, thanks very much for the useful feedback :-)
You are welcome,
bye,
bearophile
t more readable.
Bye,
bearophile
Andrei Alexandrescu:
We must find a solution to reviewing pull requests, and fast.
I agree. Maybe this could help:
http://code.google.com/p/gerrit/
Bye,
bearophile
emory used by dmd, is it a good
idea to add a compilation switch like "-cgc" that switches on a
garbage collector for the compiler (disabled on default)?
Bye,
bearophile
ve strategies is more fit for the needs of dmd
compilation. (I think that currently the Python dicts are using a
hashing strategy different from the built-in dictionaries of D.
The Python style of hashing was implemented in D some months ago,
but I don't remember what happened to that project later).
Bye,
bearophile
Paul Hsieh has given more precise
suggestions, he's kind of expert on such matters.
Bye,
bearophile
Chris:
http://wendlerchristoph.wordpress.com/2013/07/30/probably-d/
[Python] copyright issues (easily decompilable byte code)<
Is that true?
For small D examples I suggest the Rosettacode site (when its
site isn't down).
Bye,
bearophile
Walter Bright:
http://www.digitalmars.com/download/freecompiler.html
Using it to compile dmd for win32 will result in a faster dmd.
Thank you, I'll try it soon. A faster compilation of dmd, or a
faster running dmd, or both? :-)
Bye,
bearophile
x27;(null)' tdb => 'symc.tdb'
dmc -c -Iroot;\dm\include -o -cpp -DDM_TARGET_CPU_X86=1
staticassert
Compiling for C++
source <= 'staticassert.c' obj => 'staticassert.obj' dep =>
'(null)' lst => '(null)' sym => '(null)' tdb => 'symc.tdb'
dmc -c -Iroot;\dm\include -o -cpp -DDM_TARGET_CPU_X86=1
identifier
Compiling for C++
source <= 'identifier.c' obj => 'identifier.obj' dep => '(null)'
lst => '(null)' sym => '(null)' tdb => 'symc.tdb'
dmc -c -Iroot;\dm\include -o -cpp -DDM_TARGET_CPU_X86=1 mtype
Compiling for C++
source <= 'mtype.c' obj => 'mtype.obj' dep => '(null)' lst =>
'(null)' sym => '(null)' tdb => 'symc.tdb'
nbytes = 80031, ph_maxsize = 65520
Internal error: ph.c 1854
--- errorlevel -1073741510
Bye,
bearophile
Walter Bright:
Fixed.
Do you mean that if I download the dmc zip again it will work?
Bye,
bearophile
Walter Bright:
Yes, unless I screwed it up again.
It works now, thank you.
Bye,
bearophile
#post-ibbicmqochwtirxdbmud:40forum.dlang.org
Bye,
bearophile
inedocs/gcc/Function-Specific-Option-Pragmas.html#Function-Specific-Option-Pragmas
Bye,
bearophile
David Nadlinger:
It's a cute idea, but not really practical, I'm afraid –
Goroutines are managed by a scheduler in the Go runtime
library, whereas D threads directly map to OS threads.
Can't Rory McGuire add a scheduler to his code? How much code
does it take?
Bye,
bearophile
very large graphs, so you have to
add even more logic to allocate the arrays on the C heap if they
are too much large. This could be useful if you call
betweenness() many many times.
- Try to optionally accept the buffers from outside.
Bye,
bearophile
ite 0 for
integral-types, 0.0 for floating-point.
Right. And this could be right even if you want T=Rational.
Bye,
bearophile
d
buffers) helps.
Bye,
bearophile
and time the two versions of the code, with and
without uninitializedArray. If the GC is the cause of speed
differences and you disable it, you will see no performance
difference any more.
Bye,
bearophile
slowdown,
I am saying that in general uninitializedArray is less safe.
Bye,
bearophile
rding
future changes in your code.
Bye,
bearophile
) the whole code that
depends on that type (like the body of this function of yours)
will keep working as safely as before :-)
Bye,
bearophile
Joakim:
http://www.reddit.com/r/programming/comments/1o85hy/d_programming_talk_at_osdc_2013/
They contain several details that I'd like to write differently.
Bye,
bearophile
Walter Bright:
Why not do a presentation/article?
Is that an answer to me? A presentation/article about slide
details that I think are not the best?
Bye,
bearophile
Walter Bright:
I'll go have myself flogged, then.
But please be gentle and use something soft, like a fake snow
leopard tail:
http://img.photobucket.com/albums/v310/musta.surma/Hpim4850.jpg
Bye,
bearophile
name helps
avoid mistakes like those ".c" extensions in the C++ sources,
that numerous persons keep criticizing. The advantages of a
standard suffix for D code are way larger than the disadvantages.
Bye,
bearophile
code will become
increasingly important. @annotations don't suffice.
Bye,
bearophile
marcpmichel:
Here is the ugly thing :
https://github.com/jbrains/trivia/tree/master/d
And wrong:
if (rand.front() % 9 == 7) {
Bye,
bearophile
marcpmichel:
Do you mean I should have used :
if (uniform(0,10) == 7) {
instead ?
Right. Using % introduces a bias.
Bye,
bearophile
)
counts[uniform(0, $)]++;
Bye,
bearophile
hing it to always put "immutable" at the foreach
variable, unless you want to mutate it or if you can't use
const/immutable for some other reason.
Probably I can invent you more creative answers if you want.
Bear hugs,
bearophile
anthony:
The only problem that concerns me is the lack of a UI library
to use with the language. GTK+ is not an option for me. Qt is
but I do not see any way to use it from D.
Is QtD not good enough?
Bye,
bearophile
string s2) pure =>
s1.zip(s2).count!(ab => ab[0] != ab[1]);
It's a use case for some tuple unpacking syntax:
enum dist = (in string s1, in string s2) pure =>
s1.zip(s2).count!(@{a, b} => a != b);
Bye,
bearophile
Bye,
bearophile
are only few lines long (often 2-3 lines long,
with some functions up to 10-13 lines long).
Bonus: the cute idea of a language for students:
http://www.iro.umontreal.ca/~felipe/IFT2030-Automne2002/Complements/tinyc.c
(On Reddit I seem to see some comments, like structs not allowing
constructors?)
Bye,
bearophile
wer is negative.
Bye,
bearophile
d.puremagic.com/issues/show_bug.cgi?id=11971
Bye,
bearophile
making them available (with DUB or on GitHub). This allows other
projects to re-use those modules and reduce their size.
Bye,
bearophile
n't warn if you do kind of the
opposite:
alias MyArr = int[5000];
void foo(MyArr x) {}
void main() {}
Bye,
bearophile
by C lints. Clang shows that you can add lot of lint-like
tests to the compiler. I'd like some more tests in the D compiler.
Bye,
bearophile
king, but the time isn't worth it.<
Bye,
bearophile
Dicebot:
It should be other way around - remove all such arguable
warnings from compiler to dedicated lint tool and never add any
single one to compiler.
What are the advantages and disadvantages of doing as you say?
Bye,
bearophile
Paulo Pinto:
End result being a portable macro assembler, as safe as,
writing in pure assembly.
I'd even like warnings active on default in D, plus a compiler
switch to disable them. Lot of people in D.learn don't even
activate warnings.
Bye,
bearophile
Dicebot:
Those warning that _can_ be activated by default, should be
just turned into errors. Same crap as with C.
Programming is not a black/white thing
(http://en.wiktionary.org/wiki/Manichaean#Adjective ) :-)
Bye,
bearophile
Andrei Alexandrescu:
Ironically that's for the obsoleted C++ program. The D program
is trivial to build.
Oh, I didn't know/understand that. Sorry for the noise.
Bye,
bearophile
Now among the printed books about D there's Andrei book, the book
about Tango, and your one. Plus there's Ali Çehreli online book,
and probably more. Compared to other new languages like Scala
there are far less books about D, but the situation is improving
:-)
Bye,
bearophile
rates
uniforms in [0.0, 1.0]? :-)
Bye,
bearophile
e conditional on
improvements in the available allocation strategies.
We will probably have the nice Andrei's allocators in Phobos, but
not in a short time. So I suggest to not rely on them for
std.random2.
Bye,
bearophile
ready addressed in
the current (or planned) std.random2.
Another random one that was just commented by Infiltrator:
https://d.puremagic.com/issues/show_bug.cgi?id=5901
Bye,
bearophile
but very fast function that generates
uniforms in [0.0, 1.0]? :-)
AFAIK, the allocation issue is only for ranges?
Here I was not talking about allocations:
https://d.puremagic.com/issues/show_bug.cgi?id=5240
Bye,
bearophile
equivalent regular foreach-based processing code
in C/D.
Bye,
bearophile
Andrei Alexandrescu:
http://www.reddit.com/r/programming/comments/2101ti/functional_image_processing_in_d/
But I have suggested some improvements of the article :-(
Bye,
bearophile
Joseph Rushton Wakeling:
I think the following patch should fix that for you:
https://github.com/WebDrake/std.random2/commit/fb5429de77b3c1f7fe3968fd0bd92209c9021f31
I've also made shuffle composable as per your request. Looks
good? :-)
Seems good. Onward! :-)
Bye,
bearophile
an point to a typical naming
practice from other languages?
I'd like a permutations() range in std.range or
std.combinatorics. permutation() sounds a bit too much close,
despite it is inside another module.
Bye,
bearophile
like (the boolean
template argument is to specify if it has to copy the buffer or
not):
[1, 2, 3].permutations!false.writeln;
Bye,
bearophile
51
"Strongly pure random generator":
https://d.puremagic.com/issues/show_bug.cgi?id=5249
I hope a gaussian (normal distribution) generator is planned or
present.
Bye,
bearophile
Joseph Rushton Wakeling:
int r = data[uniform!"[)"(0, data.length)];
D also accepts:
immutable r = data[uniform!"[)"(0, $)];
Bye,
bearophile
roximate)
but faster function implementation.
Are the ddocs produced by std.random2 online somewhere?
Bye,
bearophile
ned should be closed.
Bye,
bearophile
1 - 100 of 643 matches
Mail list logo