Re: Z80 Emulation Engine

2014-04-20 Thread bearophile via Digitalmars-d-announce
ketmar: sorry, it uses GDC @attribute(forceinline) feature, so you need latest GDC to build it. it's not strictly necessary though (speed optimizations? Have you performed a benchmark with and without that attribute? http://repo.or.cz/w/zymosis.d.git In this kind of code computed gotos

Re: DScanner is ready for use

2014-04-22 Thread bearophile via Digitalmars-d-announce
Brian Schott: DScanner is a tool for analyzing D source code. It has the following features: ... https://github.com/Hackerpilot/Dscanner I have just compiled it on Windows32 and tried it. The compilation using the given bat has failed to link: OPTLINK (R) for Win32 Release 8.00.15

Re: DScanner is ready for use

2014-04-24 Thread bearophile via Digitalmars-d-announce
Brian Schott: This is not valid. DMD and the grammar spec both do not allow this. This was changed weeks ago. Now D accepts that code. int items[5]; I don't support C-style declarations. DMD doesn't really support them either. (https://issues.dlang.org/show_bug.cgi?id=953) Then I

Re: DScanner is ready for use

2014-04-24 Thread bearophile via Digitalmars-d-announce
Brian Schott: You want tooling to support language features that aren't released? I think it's nice for a language tool to try to follow closely the improvements in the language. But you are right, the update rhythms of DScanner are left to you. Several people have indicated that they

Re: Video of my LDC talk @ FOSDEM'14

2014-05-26 Thread bearophile via Digitalmars-d-announce
Walter Bright: Sigh, Windows can't open that file type. Install this: http://www.videolan.org/vlc/index.html Bye, bearophile

Re: Video of my LDC talk @ FOSDEM'14

2014-05-27 Thread bearophile via Digitalmars-d-announce
Kai Nacke: In the same folder are also the videos of the other LLVM related talk. I have appreciated the An approach for energy consumption analysis of programs using LLVM talk, they even have an annotation that statically enforces a certain function to consume less than a specified amount

Re: Real time captioning of D presentations

2014-06-01 Thread bearophile via Digitalmars-d-announce
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

Re: Interview at Lang.NEXT

2014-06-04 Thread bearophile via Digitalmars-d-announce
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

Re: Interview at Lang.NEXT

2014-06-04 Thread bearophile via Digitalmars-d-announce
Adam D. Ruppe: Of course, sometimes the type still matters, Haskell programmers have a very different attitude toward types. They do a kind of type-driven programming, even in small programs. They lay down the data types (like the algebraic data types that describe the data structures of

Re: Interview at Lang.NEXT

2014-06-04 Thread bearophile via Digitalmars-d-announce
Nick Sabalausky: In my experience, using heavy dynamic typing throughout a program creates far more work (mainly debugging) than it avoids. Even in tiny ~100 line programs, I've spent large amounts of time tracking down bugs a sane compiler would have immediately pointed out with a

Re: Interview at Lang.NEXT

2014-06-05 Thread bearophile via Digitalmars-d-announce
Nick Sabalausky: to three lines of tests for every one line of real code is considered rapid development, My Python development is just development, it's not meant to be particularly rapid :-) And I don't think a 3:1 ratio is too much. Among the testing code I also count the doctests, the

Re: Interview at Lang.NEXT

2014-06-07 Thread bearophile via Digitalmars-d-announce
Burp: Do you also have so much testing code in haskell? I am still a newbie in Haskell, so my Haskell usage patterns are not significant (but if you still want an answer: from what I've seen so far I need so much time and thinking to craft every single line of Haskell code that later

Re: Chuck Allison's talk is up

2014-06-07 Thread bearophile via Digitalmars-d-announce
Andrei Alexandrescu: http://www.reddit.com/r/programming/comments/27e5d7/dconf_day_1_talk_3_a_real_d_in_programming/ The built-in can be deprecated. And the compromise solution is to return the result from the reverse() of Phobos. Sometimes breaking your the rules a little is the best thing

Re: K-Nearest Neighbor + pointger alignments

2014-06-10 Thread bearophile via Digitalmars-d-announce
Ali Cehreli: I wonder what bearophile's response will be. ;) Despite looking like a silly sequence of optimizations, I do have some general comments on that text. Thanks to Kenji (https://github.com/D-Programming-Language/dmd/pull/3650 ) this code is now valid: void foo(size_t N)(ref

Re: hap.random: a new random number library for D

2014-06-10 Thread bearophile via Digitalmars-d-announce
Joseph Rushton Wakeling: Thanks in advance for all testing and feedback. I have appreciated to use this generator (but I am not yet sure how much good it is. I have seen it's fast and sufficiently good for some of my simpler purposes): http://en.literateprograms.org/R250/521_%28C%29

Re: hap.random: a new random number library for D

2014-06-10 Thread bearophile via Digitalmars-d-announce
Kagamin: Pass it by reference, I see no reason why MT can't be pure. I meant strongly pure :-) Bye, bearophile

Re: hap.random: a new random number library for D

2014-06-10 Thread bearophile via Digitalmars-d-announce
Joseph Rushton Wakeling: However, I don't see any reason why one couldn't have a strongly pure function that purely transforms state, which could be wrapped by an RNG class So can you can generate random values in strongly pure functions with this? You can allocate the RNG class inside the

Re: DConf 2014 Day 1 Talk 4: Inside the Regular Expressions in D by Dmitry Olshansky

2014-06-10 Thread bearophile via Digitalmars-d-announce
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

Re: hap.random: a new random number library for D

2014-06-10 Thread bearophile via Digitalmars-d-announce
Joseph Rushton Wakeling: Forgive me if I'm missing something obvious, but as it stands I don't see how the R250/521 algorithm you pointed me to can be strongly pure. Sorry, the R250/521 idea and the strongly pure idea are unrelated to each other. but wouldn't that be a memory allocation

Re: hap.random: a new random number library for D

2014-06-10 Thread bearophile via Digitalmars-d-announce
Joseph Rushton Wakeling: I'll implement R250/521 for you, though. Please stop, I am not worth that, and I don't even know how much good that generator is. So for you it's better to focus on more important matters of the new random module. Extra generators can be added later if needed.

Re: DConf 2014 Day 1 Talk 4: Inside the Regular Expressions in D by Dmitry Olshansky

2014-06-12 Thread bearophile via Digitalmars-d-announce
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

Re: DMD 2.066 Alpha

2014-06-13 Thread bearophile via Digitalmars-d-announce
Steven Schveighoffer: To that end, I thought we were moving towards a more scalable solution: like !final or final!false or final(false), which could be nice for metaprogramming. This is a small problem: void foo(in int x) { auto y = x; y++; // error } The current solution is

Re: core.checkedint added to druntime

2014-06-18 Thread bearophile via Digitalmars-d-announce
Walter Bright: https://github.com/D-Programming-Language/druntime/pull/839 Why aren't functions with ubyte/byte/short/ushort arguments included? -- Here Lionello Lunesu has suggested a __traits(valueRange, expression) for built-in values:

Re: core.checkedint added to druntime

2014-06-18 Thread bearophile via Digitalmars-d-announce
Walter Bright: Because there is no ubyte/byte/short/ushort math in C, C++ or D. There is only int/long math. A little of ubyte math is present, perhaps for this you add uinc, sinc, udec, sdec functions to core.checkedint that support ubyte/byte/short/ushort types too: void main() {

Re: hap.random: a new random number library for D

2014-07-13 Thread bearophile via Digitalmars-d-announce
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

Re: hap.random: a new random number library for D

2014-07-13 Thread bearophile via Digitalmars-d-announce
Joseph Rushton Wakeling: What really matters to me is stuff like Sample and Cover, where we can readily expect that they may be called in inner loops of the program, and so having lots of allocations via new would be a big problem. So, it follows that the current helper functions (sample,

Re: DConf 2014 Day 2 Talk 7: Tiny, Ubiquitous Machines Powered by D by Michael D. Franklin

2014-07-15 Thread bearophile via Digitalmars-d-announce
The talk was nice, and it's the chance I was waiting to ask a question to the speaker. I've read a very nice paper (+ slides) about using some specialized but simple type system rules to make less bug-prone the bit-twiddling kind of code, Bit-Level Types for High-Level Reasoning by Ranjit

Re: DConf 2014 Day 2 Talk 7: Tiny, Ubiquitous Machines Powered by D by Michael D. Franklin

2014-07-15 Thread bearophile via Digitalmars-d-announce
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

Re: DConf 2014 Keynote: High Performance Code Using D by Walter Bright

2014-07-16 Thread bearophile via Digitalmars-d-announce
Andrei Alexandrescu: http://www.reddit.com/r/programming/comments/2aruaf/dconf_2014_keynote_high_performance_code_using_d/ Despite Walter is used to pipeline programming, so the next step is to also handle failures and off-band messages in a functional way (without exceptions and global

Re: DConf 2014 Keynote: High Performance Code Using D by Walter Bright

2014-07-16 Thread bearophile via Digitalmars-d-announce
Despite Walter is Sorry, I meant to write, Now Walter is... Bye, bearophile

Re: DConf 2014 Keynote: High Performance Code Using D by Walter Bright

2014-07-20 Thread bearophile via Digitalmars-d-announce
Andrei Alexandrescu: Just read the slides, very interesting. There are many papers, books and articles around that explain the same things, but that explanation is easy to understand even for people not used to functional programming (as I still partially am). I think it would be

Re: DConf 2014 Keynote: High Performance Code Using D by Walter Bright

2014-07-22 Thread bearophile via Digitalmars-d-announce
Don: I think that approach is more convincing for functional languages than for D, especially if you are limited to a single return type. Hopefully someday we'll have good enough tuples in D (including their destructuring), this is similar to having multiple return values. Bye,

Re: DConf 2014 Lightning Talks

2014-08-01 Thread bearophile via Digitalmars-d-announce
Ali Çehreli: Ali Çehreli's (first speaker) slides are at http://acehreli.org/AliCehreli_assumptions.pdf It's a nice slides pack. Now in Phobos there's also assumeUTF (https://d.puremagic.com/issues/show_bug.cgi?id=10162 ). See also: https://issues.dlang.org/show_bug.cgi?id=9682 It

Re: COFF support for Win32 merged

2014-08-17 Thread bearophile via Digitalmars-d-announce
Jacob Carlborg: A pull request [1] by Rainer Schuetze which adds COFF support for Win32 has recently been merged by Walter. It seems to be enabled using the -m32mscoff flag. I have just recompiled dmd, but I don't see that new compiler switch (dmd 2.067). I am compiling in a wrong way?

Re: COFF support for Win32 merged

2014-08-17 Thread bearophile via Digitalmars-d-announce
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

Re: COFF support for Win32 merged

2014-08-17 Thread bearophile via Digitalmars-d-announce
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

Re: COFF support for Win32 merged

2014-08-17 Thread bearophile via Digitalmars-d-announce
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

Re: D 2.066 is out. Enjoy!

2014-08-18 Thread bearophile via Digitalmars-d-announce
Vladimir Panteleev: I agree, I am also surprised that 2.066 was released despite the regressions. There is an apparently endless stream of regressions, I have found another today (https://issues.dlang.org/show_bug.cgi?id=13321 ). I think D is not yet at the stage of its development where

Re: D for the Win

2014-08-20 Thread bearophile via Digitalmars-d-announce
Andrei: http://tomerfiliba.com/blog/dlang/ struct PascalString { Field!ubyte length; Also see if UDAs plus compile-time introspection is helpful. auto stream = cast(ubyte[])\x05hello.dup; Perhaps this is enough, and avoids one allocation: immutable stream =

Re: Fix #2529: explicit protection package #3651

2014-08-22 Thread bearophile via Digitalmars-d-announce
Dicebot: All I want is that whatever decision Walter makes to happen sooner than in few years from now. There are other pending patches, like the support for the nice [$] syntax by Kenji. I keep thinking there's gotta be a way to do this without language changes. or I keep thinking there

Re: D for the Win

2014-08-24 Thread bearophile via Digitalmars-d-announce
Mike: Then I add change only #6 above, and remove the excessive function attributes, Maybe I'll make a pull request for it. I don't think users should have to decorate their code like a Christmas tree I don't agree, function attributes are not excessive, they are idiomatic in D. Bye,

Re: Damncheck - a property-based testing library

2014-09-09 Thread bearophile via Digitalmars-d-announce
George: I was hoping to get some feedback from the community regarding the quality of the code and if something can be written the D-way. I have also written a blog post about the process (http://blog.zakhour.me/post/d/damncheck-on-building-a-property-based-testing-library-for-d/) Eventually

Re: Multiple alias this is coming.

2014-09-18 Thread bearophile via Digitalmars-d-announce
IgorStepanov: I've created pull request, which introduces multiple alias this. Can someone show one or more usage cases? Thank you, bye, bearophile

Re: Multiple alias this is coming.

2014-09-18 Thread bearophile via Digitalmars-d-announce
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

Re: DMD v2.066.1-rc2

2014-09-20 Thread bearophile via Digitalmars-d-announce
Andrew Edwards: The second release candidate for v2.066.1 is now available for testing. Binaries may be obtained at http://wiki.dlang.org/Beta_Testing/. Happy testing. In the site there is a link named DMD v2.067.0-b1. Perhaps it should be named DMD v2.067.0-a1 because it's an alpha

Re: dfix 0.1.1

2014-10-28 Thread bearophile via Digitalmars-d-announce
Brian Schott: https://github.com/Hackerpilot/dfix Sounds like a very good start :-) Bye, bearophile

Re: D is for Data Science

2014-11-24 Thread bearophile via Digitalmars-d-announce
Dmitry Olshansky: Why is File.byLine so slow? Seems to be mostly fixed sometime ago. Really? I am not so sure. Bye, bearophile

Re: D is for Data Science

2014-11-24 Thread bearophile via Digitalmars-d-announce
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

Re: D is for Data Science

2014-11-25 Thread bearophile via Digitalmars-d-announce
weaselcat: I see array.sort is planned for future deprecation, what does future fall under? For us that activate warnings in dmd (because for a design mistake they are disabled on default, but hopefully this will be fixed in future) in the latest github version of the compiler it gives a

Re: D is for Data Science

2014-11-28 Thread bearophile via Digitalmars-d-announce
Tomer Rosenschtein: Awesome article. Paper of the week is a modest word for this. The D code is not good. Bye, bearophile

Re: D is for Data Science

2014-11-28 Thread bearophile via Digitalmars-d-announce
CraigDillabaugh: Maybe not good by the standards of this group, but it does represent the efforts of someone doing 'real work', so I think it is worthwhile. Perhaps part of the cause of the low quality of the code in that blog post is the design of D language is not bondage enough. This

Re: forum.dlang.org is now using DCaptcha

2014-12-02 Thread bearophile via Digitalmars-d-announce
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

Re: bessel[IJKY] functions

2014-12-25 Thread bearophile via Digitalmars-d-announce
Ilya Yaroshenko: Ported from r-project: http://code.dlang.org/packages/bessel If you like to write the full path like std.math.isNaN, then you can also use static imports. Perhaps it's worth adding pre/post-conditions to the functions. The indentations probably have a mix of tabs and

Re: GCCJIT Bindings for D

2014-12-27 Thread bearophile via Digitalmars-d-announce
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

Re: GCCJIT Bindings for D

2014-12-28 Thread bearophile via Digitalmars-d-announce
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

Re: GCCJIT Bindings for D

2014-12-28 Thread bearophile via Digitalmars-d-announce
Iain Buclaw: 1.086s: bfgccjitd-runtime-O2 1.139s: bfgccjitd-runtime-O1 2.759s: bfgccjitd-O1 3.646s: bfgccjitd-O2 4.959s: bff-O2 Five times faster than bff is a lot :-) My best timings are usually around two times faster than bff. I guess gccjit is not an average JIT-tter. Bye,

Re: let (x,y) = ...

2015-02-19 Thread bearophile via Digitalmars-d-announce
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

Re: let (x,y) = ...

2015-02-19 Thread bearophile via Digitalmars-d-announce
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

Re: let (x,y) = ...

2015-02-19 Thread bearophile via Digitalmars-d-announce
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

Re: let (x,y) = ...

2015-02-19 Thread bearophile via Digitalmars-d-announce
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

Re: This Week in D, issue 1

2015-01-13 Thread bearophile via Digitalmars-d-announce
Adam D. Ruppe: I've started writing a weekly D newsletter. Here's the first issue, any feedback welcome! http://arsdnet.net/this-week-in-d/jan-12.html Seems good. Major Changes = They are weekly, so perhaps Changes is enough. If you can, add two or three little images to the page, like

Re: This Week in D: Issue #4

2015-02-11 Thread bearophile via Digitalmars-d-announce
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

Re: D idioms list

2015-01-08 Thread bearophile via Digitalmars-d-announce
ponce: I'm not familiar with the terse, range-heavy, UFCS style that has emerged from Phobos In Rosettacode I have inserted tons of examples of that coding style. An example, given a tuple of arbitrary length, with items all of the same type, how do you compute the total of its items?

Re: Gary Willoughby: Why Go's design is a disservice to intelligent programmers

2015-03-25 Thread bearophile via Digitalmars-d-announce
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

Re: Gary Willoughby: Why Go's design is a disservice to intelligent programmers

2015-03-30 Thread bearophile via Digitalmars-d-announce
Ola Fosheim Grøstad: So, it will just fade way in the sea of JavaScript wannabe replacements. Maybe, but Google is using it for Google Ads. Which is their primary business? Still, a bit early to say what happens next. Perhaps next some kind of blend of Typescript and Dart will become part