of a next JavaScript update :-)
Bye,
bearophile
Ola Fosheim Grøstad:
Downplaying other languages makes the D crowd look desperate...
That kind of articles are bad for the image of the D community
(and the D code shown in that article is not the best).
Bye,
bearophile
Kagamin:
Or even more obvious (VBA,TSQL):
set (x,y,z) = [1,2,3];
I prefer to use "set" as in Python, to define sets:
s = set([1, 2, 3])
2 in s
True
Bye,
bearophile
Kagamin:
Doesn't "let" normally declare a new variable?
You are right, yours is a valid point... So "tie" could be a
better name after all.
Bye,
bearophile
Mengu:
that's a great example to show d's strength. thank you.
It's also a great way to show what's missing in D syntax.
Bye,
bearophile
Ola Fosheim Grøstad:
Maybe change the name to tie:
http://www.cplusplus.com/reference/tuple/tie/
?
I prefer "let", it's much more traditional and descriptive. C++
standard library is often a bad example to follow...
Bye,
bearophile
It it a good idea to keep a weekly rhythm? Perhaps one issue
every two, three or even four weeks is better at this stage of
the D life.
Bye,
bearophile
r three little images to the page, like here:
https://sergeytihon.wordpress.com/category/f-weekly/
Bye,
bearophile
items?
The last way I've invented is:
myTuple[].only.sum
It's also @nogc. But it causes a little of template bloat.
Bye,
bearophile
,
bearophile
Iain Buclaw:
Sure, what is that supposed to do?
Iain.
To print a classic image of the Mandelbrot Set (but Codepad seems
down currently).
Bye,
bearophile
Iain Buclaw:
For a more practical example, I've added an example jit
compiled brainf*** interpreter.
https://github.com/ibuclaw/gccjitd/blob/master/tests/brainf.d
Here I have put a little program you can use as performance
benchmark:
http://codepad.org/hogVnlIS
Bye,
bearophile
mix of tabs and spaces and seem
messed up.
Is gamma_cody better/worse than std.mathspecial.gamma?
Bye,
bearophile
Vladimir Panteleev:
http://wiki.dlang.org/extensions/DCaptcha/demo.php
Very nice, we can help spammers learn some D and become some day
valid D developers :-)
Bye,
bearophile
ture, in both
surface look of code, and idioms, and I think this is good.
Bye,
bearophile
Tomer Rosenschtein:
Awesome article.
"Paper of the week" is a modest word for this.
The D code is not good.
Bye,
bearophile
t
gives a warning if you use the built-in sort and "reverse".
Unfortunately the library "reverse" still needs to be fixed to
return the array as the built-in "reverse".
Bye,
bearophile
Dmitry Olshansky:
Which is 1:1 parity. Another myth busted? ;)
There is still an open bug report:
https://issues.dlang.org/show_bug.cgi?id=11810
Do you want also to benchmark that byLineFast that for me is
usually significantly faster than the byLine?
Bye,
bearophile
Dmitry Olshansky:
Why is File.byLine so slow?
Seems to be mostly fixed sometime ago.
Really? I am not so sure.
Bye,
bearophile
Brian Schott:
https://github.com/Hackerpilot/dfix
Sounds like a very good start :-)
Bye,
bearophile
ecause it's an alpha version.
Bye,
bearophile
IgorStepanov:
Do you ask about alias this or about it multiple usage.
Multiple usage is similar to single, but multiple:)
I meant the multiple usage. And none of your examples here are
use cases :-( I'd like to see one use case, or more.
Bye,
bearophile
IgorStepanov:
I've created pull request, which introduces multiple alias this.
Can someone show one or more usage cases?
Thank you,
bye,
bearophile
rary-for-d/)
Eventually a QuickCheck-like library needs to become standard
tool used to test most D projects.
There are many other related ideas, like:
http://www.cse.chalmers.se/~nicsma/quickspec.pdf
Bye,
bearophile
tic in D.
Bye,
bearophile
hmark.
Bye,
bearophile
peces).
So I guess Walter is currently busy with something (like
finishing the 2.066 release and its regressions, or developing
Warp for Facebook, or something else), so you have to wait some
time for him to come back to the language development side, to
receive a good answer and a good solution.
Bye,
bearophile
t;\x05hello".representation;
Bye,
bearophile
quicker.
Bye,
bearophile
Andrei Alexandrescu:
schwartzSort comes to mind -- Andrei
forgot the smiley :o) -- Andrei
Yeah that's an infamous example. Standard libraries should avoid
too much hard to write identifiers.
Bye,
bearophile
ketmar:
are you sure that you have latest git then? yes, i know that
this is very silly question, but sometimes... ;-)
OK, -m32mscoff works (probably I was using a wrongly written
switch), but I don't see it listed among the other compiler
switches.
Bye,
bearophile
ketmar:
are you sure that you compiled dmd for 32-bit windows? other
versions seems to not have this flag.
Yes, I am using a 32 bit Windows.
Bye,
bearophile
Bye,
bearophile
that could be useful for Phobos is
assumeAligned!(T[], 16), that specifies the assumption that a
specific slice has its first item aligned to 16 bytes. This could
be useful if you use SIMD instructions (time ago I have even
suggested to put such array alignment inside the D type system,
but I didn't raise much enthusiasm).
Bye,
bearophile
s.
Bye,
bearophile
Ali Çehreli:
Ali Çehreli's (first speaker) slides are at
http://acehreli.org/AliCehreli_assumptions.pdf
Very nice. Also very nice was the WAT Lighting Talk. The border
of this post is not large enough to contain all my comments about
those two short talks.
Bye,
bearophile
es
to switch on.
The use of Algebraic, Nullable and Expected is very different
(and safer) if you use them through pattern matching. The point
is not to ape the functional languages: currently in D Nullable
is not much safer (and not more handy) than using a null pointer.
Bye,
bearophile
Despite Walter is
Sorry, I meant to write, "Now Walter is"...
Bye,
bearophile
n a system language, this page
shows some little examples of functional syntax for Rust:
http://science.raphael.poss.name/rust-for-functional-programmers.html
Bye,
bearophile
So are those things a good addition to Phobos for your kind of
programming? (additions to the language can be discussed later).
You can look at the slides for a quicker overview, or you can ask
me here for a summary, if necessary.
Bye,
bearophile
without changes to the D language (or with small changes,
but you can't tell before you have tried implementing them with
the current language).
So are those things a good addition to Phobos for your kind of
programming? (additions to the language can be discussed later).
Bye,
bearophile
and you don't want to indicate
destruction, you have to use RAII and perhaps RefCounted. You can
allocate on the C heap manually, or on the stack, or you can
allocate on the stack or C heap using one of Andrei's future
allocators.
Bye,
bearophile
Joseph Rushton Wakeling:
Anyway, here's my thinking behind the opCall idea. One of the
major shifts of the move to classes is that, suddenly, all of
these entities have to be explicitly allocated.
So creating a random number generator can't be @nogc?
Bye,
bearophile
erations on
ubytes/bytes/shorts/ushorts, and keep the same type for the
results. So I presume a future Phobos Safe math based on
core.checkedint will need to check the ranges by itself, to allow
checked assignments back to the same types:
void main() {
Safe!ubyte x = 100;
Safe!ubyte y = 200;
Safe!ubyte z = x + y;
}
Bye,
bearophile
ower than using checkedints, but
it also gives the correct results if some overflow has occurred
:-)
Bye,
bearophile
long, requires a cast and is not fully
DRY (the 'x' name is repeated twice):
import std.traits;
void foo(in int x) {
Unqual!(typeof(x)) y = x;
y++;
}
!const is useful here (I assume !const to be the same as
!immutable):
void foo(in int x) {
!const y = x;
y++;
}
Bye,
bearophile
Dmitry Olshansky:
Unless things improve dramatically CTFE code generation +
An alternative and much faster JITter for LLVM, something like
this could make CTFE on LDC2 very quick:
http://llvm.org/devmtg/2014-04/PDFs/LightningTalks/fast-jit-code-generation.pdf
Bye,
bearophile
s able to inline the functions, the data transfer
overhead is removed, and most of the performance loss is restored
(but I don't know if non-templated Phobos functions get inlined).
Bye,
bearophile
mory allocation nightmare?
For the strongly pure random generator we should choose a
generator with a small internal state (let's say less than 5 CPU
words, they get passed by immutable value).
Bye,
bearophile
At about 40.42 in the "Thoughts on static regex" there is written
"even compile-time printf would be awesome". There is a patch
about __ctWrite in GitHug, it should be fixed and merged.
Bye,
bearophile
inside the function...
If that's right, then is this simple strongly pure random
generator worth adding to std.random2?
Bye,
bearophile
Kagamin:
Pass it by reference, I see no reason why MT can't be pure.
I meant strongly pure :-)
Bye,
bearophile
Bye,
bearophile
s (stack-allocated) too could allow alignment
annotations (perhaps ldc2 is already supporting this syntax):
void main() {
align(16) ubyte[60] ubs;
}
I discussed this topic another time in past:
http://forum.dlang.org/thread/wldsugyllfpnzeksu...@forum.dlang.org
Bye,
bearophile
to do.
The Deque struct methods should be in camelCase (and possibly
fulfill the range protocol).
Bye,
bearophile
later tests are less needed).
Bye,
bearophile
C.<
In my D code I have an average 2.5 lines of testing code or every
1 line of D code, probably thanks to the stronger typing of D
(and I think my D/Python code is less buggy than Phobos).
Bye,
bearophile
y quite hard to
explain such differences in coding stile to people that are used
to static typing.
Bye,
bearophile
nd of strong static typing you see in Ada language.
Bye,
bearophile
Meta:
and there's always std.variant.Variant when you don't want to
bother with them.
How many good usages of D Variant do you know?
Bye,
bearophile
Walter Bright:
what do you guys think?
The caption I'd like to see is the name of the speaker during the
live transmissions.
Bye,
bearophile
specified amount of energy (expressed in pJ).
The "SPARK 2014: Hybrid Verification using Proofs and Tests" talk
is nice, but I have seen it already elsewhere.
Bye,
bearophile
Walter Bright:
Sigh, Windows can't open that file type.
Install this:
http://www.videolan.org/vlc/index.html
Bye,
bearophile
urce projects I report bugs to, but I don't sent patched
to.
Bye,
bearophile
)
Then I suggest DScanner to support the half-C-declarations,
because D compilers digests them just fine and they are very
common in D code you will find in the wild. A code analyzer has
to accept the real world code people write, otherwise it's much
less useful :-)
Bye,
bearophile
ll fix. Plus it
has found three usages of the implicit string concatenation, and
two of them are (the same) bug! Andrei Alexandrescu was very
wrong to think that implicit string concatenation is a speck of
dust. I am not going to close down that enhancement request.
Bye,
bearophile
| opcode == 0xfd) {
I suggest to add an empty line before the line of comment.
And I suggest to use 4 spaces as indent unit.
static __gshared ubyte parity_tbl[256];
Better to use the D syntax:
static __gshared ubyte[256] parity_tbl;
Bye,
bearophile
Harpo:
http://www.mediafire.com/download/cjae0pnxmjpl7au/HarpoScriptR2.tar.gz
The "hs" suffix is used by Haskell source code.
Bye,
bearophile
I see some duplicated titles, like for Issue 12557, and 12556:
http://forum.dlang.org/group/digitalmars.D.bugs
Bye,
bearophile
have fallen in this trap? Perhaps Ada?
Bye,
bearophile
array[Succ!(Index.A)] = t;
auto i = Index.A;
array[i.succ] = t;
And with "enum precondition" in the succ() function you can do
both cases with a single function:
array[Index.A.succ] = t;
auto i = Index.A;
array[i.succ] = t;
Bye,
bearophile
ral little breaking changes to do to
D, and they need priority over additive enhancements.
Bye,
bearophile
g-Language/phobos/pull/2058
If such Flags is implemented with enums, then it contains casts,
but again casts in Phobos are less dangerous than casts in user
code.
Bye,
bearophile
place them with stronger enums (like the "enum class" of
C++11), but I have no proof of this.
Bye,
bearophile
rted to use D1 and I have missed it.
I suspect that in my D code most cast usage does not need casts
if you replace them with stronger casts as the "enum class" of
C++11, but I have no proof of this.
Bye,
bearophile
have several corners of weak typing (like a partial
confusion between pointers and dynamic arrays) that later have
being (painfully and slowly) fixed (and this despite D Zen is
supposed to prefer a strict design first, followed by some
relaxations later).
Bye,
bearophile
little higher level language using a 3-value enum (as in
Haskell, more or less) is still sufficiently efficient. And Ada
language shows that often you can have both precise types (strong
typing) and almost C-like efficiency.
Bye,
bearophile
Andrei Alexandrescu:
A lot of them could apply to us as well.
https://www.youtube.com/watch?v=TS1lpKBMkgg
I agree that D language/compiler could improve its integration
with versioning systems (slide 31). How to design this?
Bye,
bearophile
Andrei Alexandrescu:
A lot of them could apply to us as well.
https://www.youtube.com/watch?v=TS1lpKBMkgg
The slides:
http://www.slideshare.net/extempore/keynote-pnw-scala-2013
Bye,
bearophile
Walter Bright:
Since then, I've fixed a handful of bugs, but that didn't
amount to much time.
Have you kept a list of such bugs/mistakes of yours for warp? It
is an interesting list.
Bye,
bearophile
ned should be closed.
Bye,
bearophile
roximate)
but faster function implementation.
Are the ddocs produced by std.random2 online somewhere?
Bye,
bearophile
Joseph Rushton Wakeling:
int r = data[uniform!"[)"(0, data.length)];
D also accepts:
immutable r = data[uniform!"[)"(0, $)];
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
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
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
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
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
equivalent regular foreach-based processing code
in C/D.
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
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
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
rates
uniforms in [0.0, 1.0]? :-)
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
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
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
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:
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
king, but the time isn't worth it.<
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
1 - 100 of 643 matches
Mail list logo