Can we all please stop overreacting?
Ok, let's clear some things up. #0: I do not represent Tango in any official capacity. I am posting this because I can see this situation spinning out of control and I just want everyone to stop trying to strangle each other. Believe it or not, we're all (ostensibly) on the same side here. #1: Tango didn't block SHOO's code. I cannot find any indication that anyone representing Tango /ever/ said SHOO copied from us. Based on what Kris has said in IRC [1] and from asking Lars, the intent, if not the specific content, was this: At casual examination, SHOO's code looks similar to Tango's. There were no demands to block SHOO's code, no cries of theft. Kris phoned Walter to let him know about there being a *potential* issue. This was a courtesy given that Walter has demonstrated extreme caution when it comes to IP issues. Kris could have posted it on the newsgroup, but I suspect he didn't because he would have been flamed for accusing SHOO of stealing. It is also worth pointing out that if the case is simply that SHOO's code has a similar API, then there is little reason to block the code. If copyrighting an API was possible, the Wine and Mono projects would have been burned to the ground and had the earth beneath them salted years ago. Nevermind the fact that Tango's time API is derived from Microsoft's in .NET. If Walter /had/ adopted SHOO's code, and it was similar to Tango's, he's far more likely to have problems with Microsoft. #2: Tango is not deliberately licensed to prevent cooperation with Phobos. I've seen cries from several parties that Tango should just re-license to Boost so that changes can be incorporated into Phobos. I've also seen a few accusations that the current situation was engineered to prevent any code from being pulled into Phobos. This is nonsense. Firstly, keep in mind that Phobos wasn't always under a single, unified license. Bits of it were Public Domain, bits were modified BSD. Tango was started several years ago, and expecting them to have anticipated Walter's move to Boost is simply unreasonable. Second, Tango is the merging of two prior projects: Ares and Mango. This is where Tango's original BSD+AFL license comes from. The Tango maintainers are legally required to honour their obligations to the contributors of those projects. Thirdly, the Tango maintainers have *ALREADY TRIED* to change Tango's license. They wanted to move to just Apache 2.0 on the basis that it was similar enough to the AFL to allow this without too much trouble. The problem was that of the 50-odd contributors, there are people who they simply couldn't get in contact with. Without express permission, they *CANNOT* legally change the license to something incompatible. Walter has suggested two things recently; one was that Tango simply be relicensed as Boost. As I've noted above, they just can't. Walter also suggested that all new code be licensed under Boost. The maintainers do not want to go down this road because they have expended considerable time and effort attempting to bring Tango down to a single license. Tango's current dual-license state has been cited as a pain point for users. My own personal experience is that I was very unsure for a very long time how to legally make use of Tango. [2] Licensing all new code under Boost would drive Tango straight back into a situation the maintainers have been trying to get out of. They're also worried that any attempt to purge Tango of all code they can't get relicensed would tie up the whole project for months while code was carefully audited, rewritten, retested, redebugged, etc. Let me also point out something that seems to be routinely ignored in these arguments: there is nothing, *ABSOLUTELY NOTHING* which prevents code being taken from Tango and then being incorporated into Phobos. It does not require other modules to be licensed any differently. It simply requires the attribution clause to be acknowledged. This is unpalatable, I understand. But this is no different to Walter's suggestion that Tango be dual-licensed under both BSD and Boost. Nor is it different to finding some other library you want to include and having to honour the licensing terms. The upshot of all the above is that it's simply not practical at this moment in time to change Tango's license. - Now, could we all please stop with the personal attacks and demonisation of the other side? This isn't a war, for Pete's sake. Some Tango devs noticed similarities between SHOO's code and Tango. Kris phoned Walter privately to let him know and give him a chance to either inspect the code himself or possibly ask SHOO to clarify whether the code was based at all on Tango. No demands, no threats. As far as I can see, most of what's happened since then has been a massive overreaction. - In closing, I'd like to link directly to some of the threads in question. These all took place on the Phobos developers' list; until yesterday, I had no idea
Re: Can we all please stop overreacting?
lurker wrote: FeepingCreature Wrote: Phobos1 is shit. The Tango devs know this, the Phobos devs know it. Anyone who denies it has never compared the Phobos and Tango sourcecode. It's impossible to verify those claims because reading the Tango source might taint one's mind and after that one wouldn't be allowed to contribute any code to Phobos anymore. Well, there are other objective means. This is a subjective statement: but as someone who has used D extensively over the past several years, including both Phobos and Tango, I honestly believe that Tango is generally of a higher quality. Except for Tango's Zip code which is an abomination and should be killed with fire--the original author is clearly a talentless hack. Your simple solution is never gonna happen. You're not freaking Alexander the Great, cutting the Gordian Knot. The way D2 is going is the best solution for both sides, imho; but _anything_ that prevents Tango/Phobos interop in D2, or pushes away Tango devs, or pushes away Phobos devs - should be treated as a *severe* threat to the future of the language. We *absolutely need* to present a unified front in D2. We fucked this up once already; let's not repeat that experience. The Tango developers could have handed over all copyrights to Walter or Phobos. This would solve the licensing problems if anything needs to change later. I don't know how many times this has to be explained. To quote myself: Thirdly, the Tango maintainers have *ALREADY TRIED* to change Tango's license. They wanted to move to just Apache 2.0 on the basis that it was similar enough to the AFL to allow this without too much trouble. The problem was that of the 50-odd contributors, there are people who they simply couldn't get in contact with. Without express permission, they *CANNOT* legally change the license to something incompatible. Many open source projects such as MySQL do this. (Aside: I find it somewhat amusing that you're suggesting the Tango devs should relinquish all claim on their work; the same thing the FSF asked for in order to include the GDB patches.) Instead they yearned the attribution. Which one is more important, personal fame or potential solid enterprise support? If the library isn't rocket science or doesn't cure the cancer, what value does the attribution have then? We've already established that this is a legal issue, not one of ego. It'd be nice if you refrained from personal attacks. The new Phobos licensing is altruistic, it reflects the modest mentality of the contributors. The Boost license still requires source to contain attribution. Lars commented in his post that he doesn't like the binary attribution requirement. But he's stuck with it because of the code's heritage. As I tried very hard to explain, this is not about attempting to sabotage D or Phobos or, for that matter, anyone or anything. Please, PLEASE stop with the needless rhetoric and hate.
Re: Decimal Arithmetic module available
BCS wrote: ... Maybe we need a std.arithmetic.* for all the a little more than just a number types. Phobos with subpackages?! Blasphemy! That's what those filthy Tango heathens do and everyone knows that's just morally WRONG. (Yes, I know about std.c.*.)
Re: Tango 0.99.9 Kai released
Nick Sabalausky wrote: Yigal Chripun yigal...@gmail.com wrote in message news:hl204m$m8...@digitalmars.com... Starting with Vista, MS exposed the ability to have symlinks and hardlinks on windows, just run help mklink in a cmd.exe. In reality NTFS supported this for a long time now (IIRC, since circa 2000) but the problem is that the windows shell/cmd.exe is always late at providing access to new NTFS features - they're always late by at least one version of windows so this is why you can't do that on XP even though the NTFS version that comes with XP does support it. Oh, so at least in theory, symlinks should still be possible on 2k/XP given a third-party tool to manage them and avoidance of using them on the command-line and in batch files? Given that SysInternals had a tool for doing hard links on 2000+, but no tool for doing symlinks, I doubt it. I recall reading something about how symlinks were new to Vista specifically; not simply a tool to make them, but something changed in NTFS or the system's support for it.
Re: Tango 0.99.9 Kai released
Nick Sabalausky wrote: strtr s...@spam.com wrote in message news:hkuc5h$2hj...@digitalmars.com... Nick Sabalausky Wrote: If you grab the Tango+DMD bundle from the Tango site, then it's exactly the same as installing DMD/Phobos: Just unzip, set path, and run. So I shouldn't need to change anything at all in my project? All Phobos calls will by default be handled correctly? That's nice. ... This is what I'd recommend for D1. This is pretty much the way I do it and I find it very easy: ... In F:\Programs\DigitalMars, I have: - dmd-1.035-tango-0.99.8 - dmd-1.051 - dmd-1.051-tango-trunk Then there's dmdenv.cmd on the PATH: @ECHO OFF IF %1== GOTO DEFAULT IF %1==? GOTO LIST set DMDVER=%1 GOTO DOIT :LIST echo List of available DMD versions: pushd F:\Programs\DigitalMars dir /ad /b dmd-* popd goto END :DEFAULT SET DMDVER=default :DOIT echo Adding dmd-%DMDVER% to PATH... PUSHD F:\Programs\DigitalMars SET PATH=%CD%\dmd-%DMDVER%\bin;%PATH% POPD :END Prior to compiling anything, I just run `dmdenv BLAH` to get the correct compiler on the path. No messing around with junctions or deleting or copying.
Re: Descent generated documentation
torhu wrote: On 10.07.2009 14:41, Ary Borenszweig wrote: You can select the maximum visibility: private, protected or public. (in the original UI in the plugin for Java there's also package, but... where does package fall? private package protected? protected package public? I think neither, mmm...) I'd say the first order is right. package is 'private to the library', but protected is available in subclasses everywhere. Actually, a better idea might be to insert Javascript to allow filtering visibility. Just calling a library? Default to showing only public members. Want to subclass something? Switch to show protected. Doing development on it? Switch to show package/all.
Re: Descent generated documentation
Ary Borenszweig wrote: Ary Borenszweig escribió: Hi all! So... I've been playing around with generating ddocs from Descent. phobos: http://downloads.dsource.org/projects/descent/ddoc/phobos/ Tango: http://downloads.dsource.org/projects/descent/ddoc/tango/ I've updated the docs. New things: - Visibility is respected - Everything except templates are listed (also nested types are listed) - Modifiers are shown - Public imports are listed (but it doesn't work quite well, I'll check it) - Module level documentation is shown - Inherited methods are shown Still no expand/collapse thingy. Regarding visibility, would it be onerous to have a switch somewhere that lets you produce internal documentation that shows private and protected members? But this is quite cool; always nice to have another alternative. :)
Re: dmd 1.046 and 2.031 releases
Andrei Alexandrescu wrote: bearophile wrote: Jason House: Hardly. There seemed to mostly be complaints about it with Andrei saying things like I can't believe you don't see the elegance of the syntax. In the end, Andrei commented that he shouldn't involve the community in such small changes and went silent. He was wrong. Even very intelligent people now and then do the wrong thing. Of course the latter statement is true, but is in no way evidence supporting the former. About the former, in that particular case I was right. Andrei Now, now. Let's all play nicely together... I don't like the `case a:..case b:` syntax. It doesn't matter. The functionality is in place and the syntax has a sane explanation and rationale. Unless there's some egregious problem aside from being a bit on the ugly side [1], it's just bike-shedding. And I'm so, SOOO sick of bike-shedding. Please, let's all just move on. [1] like me. My girlfriend disagrees with me on this, though. *I* think she's crazy, but I'm not exactly inclined to try and change her mind. :)
Re: dmd 1.046 and 2.031 releases
Ooooh... looks very nice. Thanks again, Walter. :) Incidentally, the links to Final Switch Statement and Case Range Statement in the changelog for 2.031 are broken.
Re: dmd 1.046 and 2.031 releases
Walter Bright wrote: Daniel Keep wrote: Ooooh... looks very nice. Thanks again, Walter. :) Actually, a lot of people worked on this release, not just me. True; but it's getting harder to keep track of. How about this? Thanks, mixin(reduce!a~`, `~b(D_CONTRIBUTORS)).
Re: Incorporating LINQ, State Diagrams Templating and Package Extension Into Java
Raju Renjit. G wrote: This paper gives a method to incorporate table like data types into any programming languages (any language that does not have structs or classes, for example fortran). When such a thing is done it is very easy to incorporate SQL directly into the language. I mean I do not use any specialized classes to implement this (for the time being I do not have any other name for it. So I use the name LINQ.) So this proposal can be used with int, float, etc. LINQ to SQL is also done without any specialized classes. The title of that sub section is ``Passing SQL statements without quotes. It is just a trick and there is nothing complicated in it. That would make it similar to writing SQL statements on the interface of a database. And the proposal is not specific to any database like Oracle or MySQL or SQL Server. The next section contains a proposal for incorporating state diagrams as a feature of an Object oriented PL in an object oriented way except for polymorphism. In the prop osal the actions for each transitions in the diagrams can be written elsewhere. So something can be used to encapsulate only the underlying graph and the transitions can be written elsewhere (It is almost like drawing the diagram on paper. But a program cannot use pictures. So it is almost like drawing a graph.). The next section contains a proposal for incorporating templating as feature of a programming language in an object oriented way. If this is incorporated into a language, then compilation will become: First execute an object oriented program by the complier which in turn generates the actual program to be complied (well, all these done programatically and not retrieved from a database). So this will enable code reuse. The next section contains something like the generalized switch statement, array and list transformations, temporary expressions, the match loop etc. They are not complex. Please visit http://arxiv.org/abs/cs/0504025 . Also you will find an elegant way to have operator overloading in it. And also a new framework for object oriented programming languages. Good grief. http://en.wikipedia.org/wiki/Paragraph
Re: OT: Flash (Was: Re: Taunting)
Robert Fraser wrote: Daniel Keep wrote: The only way Flash will die if if at least the following happen: ... 5. Silverlight replaces it (and then we're all doomed). Then we'd just be exchanging one problem for another (arguably) worse one.
Re: Taunting
Nick Sabalausky wrote: Daniel Keep daniel.keep.li...@gmail.com wrote in message news:gv6ddk$1ko...@digitalmars.com... Possessing a burning hatred of Flash isn't going to get everyone else to stop using it. If that worked, we'd have killed off IE6 years ago. Either build a better system and get it installed on 90% of the world's PCs or learn to live with it. :P Ok, so there's a lot retarded lemmings running around believing youtube isn't an absolute abomination to the web. And people like us who ARE capable of knowing better have a responsibility do whatever we can (even if it's nothing more than complain) to NOT help encourage such F%^ stupidity. Bottom line is, Flash (ok, at least most uses of it, not all), and especially flash-embedded video, needs to die. Throwing our hands into the air and exclaiming Gee, it's too hard to make that happen! and blindly joining the masses of lemmings has got to be the absolute stupidest most self-defeating and downright irresponsible response to such a situation I've ever seen. Enron/MS/Apple/whatever is screwing us over! Let's just shut up and learn to live with it! And your response is one of the most over-reactionary I've seen. There's a difference between doing nothing and not doing anything useful. I advocate, where I can, not using Flash. I try to let people know that having a site depend on JavaScript is stupid. I tell people to develop sites in vanilla HTML and then add JS and Flash if they want to optionally enhance the site, not to make it require them. I also upload stuff to the likes of Google Video and Youtube when I want to share video because I don't stick my head in the sand and pretend the real world doesn't exist. When there is a viable alternative, I'll use that. But there isn't. You want to change that? Grab the Mozilla source and start making patches to improve the HTML5 video support. Write a plugin for IE that adds support for the video element. Create an easy to use GUI that transcodes from any format into Theora and then helps you upload it. Do anything other than just yell at people for using the best option available to them and offer nothing in return.
OT: Flash (Was: Re: Taunting)
grauzone wrote: Daniel Keep wrote: Obviously the large number of people using such sites are trying to prove you wrong. :P They just don't know it better. They probably think their PC isn't fast enough for fullscreen video playback and so on. Maybe they don't even know what's making their web browsers / websites so slow. And what component is responsible for playing ads with SOUND. Perhaps, but they DO have Flash installed in a JavaScript-enabled browser. And anyway, there are always going to be lemmings who think the internet is called Explorer and that removing Windows is illegal. To be fair, the alternatives aren't much better. Embedding a WMV or MOV is even more annoying, and Java's just a tremendous pain in the arse. It'd be nice if the current efforts to standardise video in HTML5 could do away with Flash video et al, but I'm not holding my breath on that. There's no technical reason why YouTube couldn't provide a download link for the hidden flv/mp4 file the flash player loads. Actually, there _was_ one video, where YouTube provided a direct link, but that was an exception. In fact, hiding the link to the actual video file seems to be some kind of soft DRM. Like all almost kinds of DRM, it's breakable, but it requires an effort 0. I don't want to support this. Maybe for ad revenue? At least, I *think* YouTube has ads. I have AdBlock installed, so it's hard to tell... (And for video sites like YouTube, I'm not actually missing anything.) Suit yourself, but it's not all garbage. download youtube video Can't see a download button anywhere on YouTube. Obviously, Google forces users to install Flash. Possessing a burning hatred of Flash isn't going to get everyone else to stop using it. If that worked, we'd have killed off IE6 years ago. Firefox had tremendous success as IE replacement. If you want to go that far, Flash had success as Java replacement. Firefox didn't get to where it is because of hate. It got there because a lot of people worked VERY hard to push it into the public consciousness. Lots of advertising and word-of-mouth. Flash got to where it is because it let people watch shiny animations. Doing animations in Java is non-trivial because it's a programming language, not a content authoring system. Flash had a really easy to use editor and a small runtime download. You can't get rid of Flash by loudly shouting you should all stop using it because it sucks, and you can't replace it with anything so you have to stop watching all those funny LOLCAT videos you love so much. People will hate you for telling them they're not allowed to watch humorous videos of cats because I don't like Flash. Anyway, I'm not really fond of the idea of foreign, unknown programs running in my web browser. If you think about it, it's ridiculous. At least from the security point of view. I don't think you can avoid it. Let's say we could excise the plugin APIs from every browser tomorrow. I guarantee you that someone will release a new browser with a badly thought-out plugin API the day after. Not long after that, someone will write the new must have plugin, and then it'll start all over again. What's the old saying? All programs expand until they can read mail? s/read mail/be arbitrarily extended/. Either build a better system and get it installed on 90% of the world's PCs or learn to live with it. :P There are dozens of open source video players. Projects like ffmpeg provide good backends for audio/video decoding. And I think even the builtin Windows Media Player can play mp4. -- Daniel Those aren't a replacement and you know it. If using standalone players worked, Flash wouldn't exist today. People will always prefer being able to see a video in their browser over having to launch an external application. I've seen people use truly horrific embedded players even when a use an external application option WAS provided. And people will continue to use Flash as long as producers keep using it. And they'll keep using it so long as it's the only system with near complete ubiquity. You post video in any other format, and you CANNOT be reasonably certain your viewer can see it. Incidentally, you say ffmpeg is good, but I suspect that most of the actually *useful* parts of it are illegal. And hell, there's still the odd video file that I just can't get to play because it's using the latest version of Quicktime or WMV or something. I still remember having to install Windows Media Player, Apple Quicktime *and* RealPlayer just to have a reasonable chance of watching anything on the net. And even then, you had an out-of-date version 90% of the time. As an actual user, I *prefer* there being a single, ubiquitous format that I can view almost anywhere. The last thing I want to do is return to the hell of a million different, incompatible formats each requiring their own player software. The only way Flash will die if if at least
Re: Slide design
The subjects I did the best in and learned the most at uni were the ones where I didn't *have* to take notes and could concentrate on what the lecturer was trying to teach us. Force students to take notes and the only thing they'll learn is how to write fast. -- Daniel
Re: Metaprogramming in D tonight at the NWCPP
Walter Bright wrote: Georg Wrede wrote: That hit me too. I've been using PP or OO just because, never really thinking. But there are some advantages to using a straight, long document. It's a /lot/ faster to create the presentation. You don't have to split stuff into screenfulls (or fight with the presentation software!) And once on stage, scrolling back is way easier and faster! And you can sroll to exactly where you want, instead of to the nearest screenful. Heh, now I can say if it's good enough for Walter Bright on a big butt guru forum, I can use it, too! Everyone I talked to who was there didn't like it. I've switched to OO Impress! There's always S5: it lets you make slideshows in HTML. http://meyerweb.com/eric/tools/s5/ -- Daniel
Re: Slide design
Walter Bright wrote: ... o pdf renders a lot better than html. Why that should be, I don't know, but it is obviously better. I could be the old Mac feature. From what I recall, Apple is fanatical about the on-screen display of something matching, as closely as possible, the on-page display. This means that when they render text, they render it without adjusting the glyphs to fit the pixel grid. This tends to lead to slightly blurrier text on-screen. Since PDF is for print output, it probably does the same thing. Firefox would be using the system text libraries which fit glyphs to a pixel grid, and often don't antialias at low point sizes. ... o Of course I miss the D source code highlighting that Ddoc does. You should be able to copy+paste HTML with its formatting in-tact. o Impress doesn't seem to be able to do tables. Bummer. I know that 3.0 does. Just don't use too many of them, or Impress will start coughing up blood. ... -- Daniel
Re: Metaprogramming in D tonight at the NWCPP
Awww! I wanna see how it ends! :D -- Daniel
Re: RangeExtra 10^-20
Simen Kjaeraas wrote: dsimcha wrote: RangeExtra version 10^-20 is officially out. It consists of a small and hopefully growing number of ranges that didn't make it into the new Phobos that I've gotten working reasonably well and I feel eventually belong in Phobos. Docs / What's there: http://cis.jhu.edu/~dsimcha/rangeextra.html Code: http://dsource.org/projects/scrapple/browser/trunk/rangeextra/rangeextra.d License: Dual licensed, Phobos license or BSD (Tango style). I had hoped reindex would give me access to true 'random' access ranges, but it seems this does not work: auto b = reindex!( uniform( 0, this.length ) )( [0,1,2,3,4].dup ); :p If I had to take a guess, I'd say it was because uniform isn't defined in the context of reindex. Maybe this: import std.random; void foo() { auto b = reindex!((i){ return uniform(0,5); })( [0,1,2,3,40.dup ); } I don't think there's any way to get the length. -- Daniel
Re: dmd 2.029 release
Andrei Alexandrescu wrote: Steven Schveighoffer wrote: On Thu, 23 Apr 2009 09:24:59 -0400, Andrei Alexandrescu seewebsiteforem...@erdani.org wrote: Steven Schveighoffer wrote: This has to go into object.d and be part of the runtime, where std.range doesn't exist. There is nothing stopping you from calling: streamOut(outputrange.put); So I'd rather have a sink function. It must be a sink _object_ so it can hold its own state. And it must support put() so it integrates with statically-bound output ranges. interface OutRange { void put(... a number of overloads ...); } I see now, yes I agree (I think that was don's original request anyways). That interface has to go in the runtime, though. We may not be able to do this using templates... it has to be a virtual function in Object to be on-par with toString. This means struct interfaces are a requirement if you want to use ranges :( We're in good shape actually. OutRange as a dynamic interface and an implicit interface using .put against a struct will work just as well with templates. (The template doesn't care whether obj.put(x) is a virtual call or statically-bound call.) Andrei We may not be able to do this using templates... it has to be a virtual function in Object to be on-par with toString. Note that toString is a virtual method. You are proposing replacing toString with a template. You cannot have virtual template methods. Ergo, new toString would be inaccessible without the actual type, and certainly not at runtime. -- Daniel
Re: dmd 2.029 release [OT]
BCS wrote: Hello Christopher, Nick Sabalausky wrote: The absolute worst of all though is when an app (*cough* skype *cough*) decides that close and the 'close' button should mean don't close anything at all, but minimize to tray instead. That should be a firing squad offense ;) I'd be killing my IM client constantly if not for that feature. I pretty much expect it of any application that's meant to be running for a long time and only rarely needing user interaction (such as a bittorrent client). yah, for some programs you rarely want to close the program but often want to close the UI. This is one place where I think Mac OS X gets it right. It's a massive pain to close the last document open in OpenOffice.org before opening a new one, only to realise that now you have to sit through the loading screen again. -- Daniel
Re: dmd 1.043 alpha for FreeBSD 7.1
Walter Bright wrote: cemiller wrote: How about just making version and debug identifiers case-insensitive? Aren't they already in their own special namespace; they're special-case (pun intended). Because then I have to explain why some identifiers are case sensitive and some or not for the next few decades. g Currently, you'll have to explain why one identifier is lowercase while the others are mixed case for the next few decades. I thought one of the big strengths of D was dropping compatibility where it made sense and improved things. No one is going to be copy+pasting C code into D complete with #ifdef's and expecting it to work. Aside from that, which of the following is easier to explain to programmers? Platform version identifiers are mixed case and named for the consumer name of the platform. API version identifiers follow the same rule. Platform version identifiers may be any case and are sometimes named after the identifier used in that platform's C compiler, possibly changed to remove underscores, unless we didn't like that identifier in which case we might be using another one. This made up one could be the name of the platform, the name of the OS, or something else. -- Daniel
Re: dmd 1.042 and 2.027 releases
dsimcha wrote: == Quote from Don (nos...@nospam.com)'s article It's just you. g. The win32 build works fine for me. Never mind, it looks to be related to some strange options my IDE is passing to DMD. Just tell it to stop passing -hcf [1]. -- Daniel [1] HCF: Halt and Catch Fire, an old PDP-11 opcode, I believe. :P
Re: dunit r247
Christopher Wright wrote: bearophile wrote: What's the advantage of: expect(foo(5), equals(3) | greaterThan(5)); Compared to: expect(foo(5) == 3 | foo(5) 5); What error message should that give? The former gives: Expected: equal to 3 or greater than 5 But was: whatever value foo(5) returned The latter gives: Assertion error What about this syntax? check!(% == 3 || % == 5)(foo(5)); This could display: Expected: (% == 3 || % == 5) for value of foo(5). Then you don't have to dick about writing classes when you want to test something. Rule one of a good API: get out of my way. :D -- Daniel
Re: dmd 1.041 and 2.026 releases
Walter Bright wrote: Leandro Lucarella wrote: Walter Bright, el 5 de marzo a las 11:37 me escribiste: Tomas Lindquist Olsen wrote: Compiling on linux from source is broken! Looks like you forgot to include the total.h file! You don't need it, I'll fix the makefile. total.h is for precompiled headers, which don't even exist on gcc. I don't know exactly what you mean, but: http://gcc.gnu.org/onlinedocs/gcc/Precompiled-Headers.html I suppose it's been added since the last time I looked. gcc has thousands of switches. There are days when I can get upset at you for not implementing feature X. I really need X, damnit. Do you have any idea how badly I want X?! ... And then I do something that requires me to look at the man page for gcc. And then I die a little inside. It's strange at times, but I do appreciate that you take a considerable amount of convincing. It's a bit like the situation with Archchancellor Mustrum Ridcully from Discworld; he holds the view that if someone is still trying to explain something to him after about 2 minutes, it must be worth listening to, and if they give up earlier, it was not worth bothering him with in the first place. Obviously, s/minutes/years/ :P -- Daniel
Re: Open source dmd on Reddit!
Walter Bright wrote: Andrei Alexandrescu wrote: One improvement from the language could come from dropping the parens requirement for mixin, in which case: mixin bitfields! uint x : 2, int y : 3, uint z : 2, bool flag : 1, ; Have to resolve the ambiguity with template mixins for that to work. mixin:blah mixin.blah mixin!blah If you do something like this, I'd just want this to work: mixin!bitfields(uint x : 2) I use mixins with CTFE functions WAY MORE than I use them with templates. Incidentally, writing something that parses the above language for bitfields wouldn't be too hard. I've done something similar for defining properties. -- Daniel
Re: Open source dmd on Reddit!
Walter Bright wrote: Daniel Keep wrote: I use mixins with CTFE functions WAY MORE than I use them with templates. I'm not surprised. I feel the template mixins were probably a mistake. Well, there's really a few things at play here: 1. I use templates for simple forward code generation based on types. I use CTFE for complex code generation that requires parsing or any customisability more involved than specifying what T is. 2. Because of most of this, most of my templates are self-contained while my CTFE is meant to be mixed in to another context. 3. String mixins let me insert functionality and execute it in a single line. If I use a templated function, it doesn't have access to its context. If I mix it in first, then I have to have a second line to invoke it. That is, this: mixin(doStuff); versus mixin doStuff; _doStuff(); 4. An added issue is that there is *no way* to replicate this with templates: mixin(` private int _storage_foo; public int foo() { return _storage_foo; } public int foo(int v) { return _storage_foo = v; } `); This is generally an issue where I have a mixin that implements some interface, but needs backend wiring exposed in places to the mixin-ing context. Ideally, I'd be able to do this: mixin Foo; template Foo { private int _counter_foo; mixin private int _storage_foo; public int foo() { ++_counter_foo; return _storage_foo; } public int foo(int v) { ++_counter_foo; return _storage_foo = v; } } This way, I can specify that the protection attributes are referring to the mixin-ing context, and not to the template itself. I think the major issue is that string mixins represent a superset of template mixin functionality. I wouldn't say they were a mistake: more that they haven't kept pace. At the end of the day, string mixins are indispensable as a safe form of text substitution... but they are a still a hack that should, in most cases, be replaced with better language facilities. -- Daniel
Re: Boost.ScopeExit based on D's scope(exit)
Georg Wrede wrote: Walter Bright wrote: Georg Wrede wrote: And now a major gripe: I have just spent *half a day* trying to figure out what's wrong when I try to use shebang with rdmd. I was basically using hello.d with a shebang. And with rdmd I got this peculiar error message: .d'nnot read file ' /usr/local/digitalmars/dmd1040/linux/bin/rdmd: Couldn't compile or execute ./numma.d. Just now I figured it out: numma.d was a copy of hello.d, which of course has Windows line endings. Aaaaghh! Is that a bug in rdmd or elsewhere? We should as far as possible work seamlessly with different line endings. No, it's bash having a problem. And I wouldn't make a bug report, it's too much to ask that all of linux is made msdos-file proof. :-) The shebang stuff stumbles on a ^M at the end. I tested it without rdmd and got the same problem. Ray, when Cygwin asks if you want to use MSDOS newlines, you say YES! Of course, then it chokes on anything extracted from a tarball... -- Daniel
Re: Just one more thing...
Max Samukha wrote: On Tue, 03 Mar 2009 20:05:28 +1100, Daniel Keep daniel.keep.li...@gmail.com wrote: Bill Baxter wrote: On Mon, Mar 2, 2009 at 11:55 AM, Daniel Keep daniel.keep.li...@gmail.com wrote: Frits van Bommel wrote: Sean Kelly wrote: Daniel Keep wrote: extern(C) void __identifier(blah$UNIX2003)(int); That would be awesome. A beneficial side-effect is that I can finally get rid of all those mixins that are just doing this: mixin(`void `~name_of_fn~`(int a) { // ... rest of function ... }`); I'm sure you've thought of this, so why can you not do mixin(`void `~name_of_fn~`(int a) { implementation_of_function(a); }`); or mixin(`alias implementation_of_function `~name_of_fn~`); Simple enough to break: mixin(Property(foo, int)); mixin(Property(bar, float)); You can't use alias. You have to have some way of generating unique symbol names in a context you don't have any control over. As of 1.039, it seems to be possible to generate unique symbols in a reasonable way (not well tested): template UniqueAlias(string member, string idName, int id = 0) { static if (is(typeof(mixin(this. ~ idName ~ ToString!(id) mixin UniqueAlias!(member, idName, id + 1); else mixin(alias ~ member ~ ~ idName ~ ToString!(id) ~ ;); } unittest { class A { int x; } class B : A { int y; void foo() {} template Bar() {} mixin UniqueAlias!(x, m); mixin UniqueAlias!(y, m); mixin UniqueAlias!(x, m); mixin UniqueAlias!(foo, m); mixin UniqueAlias!(Bar, m); } auto s = new B; s.m0 = 1; s.m1 = 2; assert(s.x == 1); assert(s.y == 2); assert(s.m2 == 1); s.m3(); alias B.m4!() bar; } There are also little issues with this like how the name of the function, when debugging, won't be what you expect it to be. No, you can't use templates because you can't mixin functions with non-public protection with templates. -- Daniel Yes, this is definitely an improvement... char[] Foo(char[] name) { const char[] uid = createUniqueAlias(name); return `private void `~uid~`() { blah; }` ~ `private alias `~uid~` `~name~`;`; } class Bar { mixin(Foo(baz)); } Wait, no; that won't work. createUniqueAlias won't have access to the enclosing scope. I'll have to do this: char[] Foo(char[] name) { return ` mixin CreateUniqueAlias!(uid); mixin(private void ~uid~() { blah; }); mixin(private alias ~uid~ `~name`;); `; } class Bar { mixin(Foo(baz)); } Now I get TWO string-escaped mixins AND a meaninglessly named function mixed into my instantiating code's scope! Plus, since I need to refer to the unique name, I have to store it somewhere... and now THAT can collide with other symbols! I'm not saying it's not a neat trick; I've used the exact same thing a few times. But it's not a solution to *this* problem. -- Daniel
Re: Compiler Construction seminar, Sep 20-22
Walter Bright wrote: In Astoria, Oregon, on September 20-22 I'll be hosting a Compiler Construction seminar along with Cristian Vlasceanu. http://www.astoriaseminar.com/compiler-construction.html It'll be a two day intensive course in how compilers work and how to build them. Curse you, Pacific ocean, CURSE YOU! -- Daniel
Re: Just one more thing...
Sean Kelly wrote: One somewhat weird issue that we may have to face at some point is that Posix functions whose behavior was changed have had the symbol for the new function changed to _blah$UNIX2003, with the old function left in place. Since D can't declare symbols like this, we may end up having to add shims in C or post-process object files if it turns out that the old implementation of a function isn't sufficient. I'd love to hear of a better solution here. extern(C) void __identifier(blah$UNIX2003)(int); A beneficial side-effect is that I can finally get rid of all those mixins that are just doing this: mixin(`void `~name_of_fn~`(int a) { // ... rest of function ... }`); :D -- Daniel
Re: QtD 0.1 is out!
Yigal Chripun wrote: On Sat, Feb 28, 2009 at 11:05 AM, Yigal Chripunyigal...@gmail.com wrote: I agree with the above but there is still a small issue here: A module is a single file and when you have several large classes that are tightly coupled you can get a very big file with thousands of lines. what if i want to put each class in its own file? besides, the notion of a module is somewhat redundant - it's functionally a static struct. You can do this with mixins or aliases. Honestly, something I'd like to see is to extend the import syntax to allow you to import symbols from other symbols. For example: module foo; struct bar { static void baz(); } module main; import foo.bar; void main() { baz(); } this is related to D's compilation model which is copied from C/C++ and it seems to me that this model is outdated. C#'s model of assemblies and metadata seems more capable. for instance there's no need for header files, that info is stored in the metadata of the assembly. Given that D name mangling contains most if not all of a function's interface, it sometimes makes me wonder why we can't just import a .lib file. Heck, stick an extra symbol on the end called _D_Interface if you must. :) I also think that source code organization should be orthogonal to the organization of the deployment executables (assemblies in .net) something simillar to namespaces in C#. There are times where I hate this. The problem is that this seems to encourage very flat hierarchies in .NET code, with everything jammed together. What really exacerbates the situation is that namespaces can be added to by any library at any time. For example, I had some code in C#, and I couldn't for the life of me figure out what I was supposed to link to. Because the examples had multiple libraries all dumping their stuff into the same namespace, it was impossible to work out where any given symbol was coming from. I ended up having to manually go through every goddamn library with the object browser to figure it out. Enforcing the module-file thing can be annoying at times, but nowhere near as bad as having no indication whatsoever where something is defined. -- Daniel
Re: Just one more thing...
Walter Bright wrote: Jarrett Billingsley wrote: On Sat, Feb 28, 2009 at 10:52 PM, Daniel Keep daniel.keep.li...@gmail.com wrote: extern(C) void __identifier(blah$UNIX2003)(int); A beneficial side-effect is that I can finally get rid of all those mixins that are just doing this: mixin(`void `~name_of_fn~`(int a) { // ... rest of function ... }`); Yes, please, Jesus I'd love that. Put it as an enhancement request on bugzilla! Your wish is my I'll probably do it if it benefits me too in some way. http://d.puremagic.com/issues/show_bug.cgi?id=2698 :P -- Daniel
Re: QtD 0.1 is out!
Eldar Insafutdinov wrote: David Ferenczi Wrote: I'm glad to see this release and the progress of qtd! Coudl you please provide a link to the tutrial? Many thanks! Eldar Insafutdinov wrote: It didn't take very long after previous post to make a first implementation of signals and slots(thanks to great people from #d) which means that you can actually start doing something useful. 0.1 is probably most suitable tag for this release. Again - see tutorials for how to use signals. tutorials are in trunk/examples http://code.google.com/p/qtd/source/browse/#svn/trunk/examples No files in this directory. Well that sucks. Oh well, I... hey, wait a second... *unblocks javascript* No files in this directory, but there ARE subdirectories! Sometimes, I really wish there was a way to electrocute people for making their sites break without Javascript... -- Daniel (Not angry at you, Eldar; angry at Google. They should know better :) )
Re: QtD 0.1 is out!
BCS wrote: Reply to Bill, On Fri, Feb 6, 2009 at 9:00 AM, Daniel Keep daniel.keep.li...@gmail.com wrote: You want to use JS to make the site more usable? That's great! But you DO NOT break basic functionality to do it. EVER. If you can't figure out how, you're not qualified to be writing JS for web pages [3]. [...] what I want to known is what happened to that last footnote! I believe I was going to make a comment to the effect that it's fine to make websites like this for the purposes of learning. I decided that I was probably going a bit far in attempting to clarify myself. -- Daniel
Re: OT: Scripting on websites [Was: Re: QtD 0.1 is out!]
Ary Borenszweig wrote: lol :) Yeah, well, for a directory listing they could have shown the full tree, but if it's too big then it's ugly, and browsing folder by folder (like dsource) is slow for me. The point is that instead of giving you a sub-optimal but functional alternative, they give you none. It's like not putting in wheelchair access ramps on the argument that they're inconvenient due to being a longer path than the stairs. You are right in that replacing href= with onclick= just for a link is stupid. Not just stupid; there's a whole circle of hell devoted to people who do that. They sit in endless thirst with water coolers everywhere. The catch is the taps have been replaced with low-resistance jobbies that require a special spanner to turn. Such spanners were never built. But... why Javascript hurts you that much? What did it do to you? Leaving aside Javascript the language and talking about JS as used in browsers, it's not the language itself. It's how it's used. It's the constant needless use of it that breaks the user experience. I think I enumerated all the big ones previously. Let's say you're moving house, and ask someone to help. They come over, and are really helpful. But every five minutes, they bitch-slap you and kick you between the legs. Then go back to being helpful. Eventually, you're going to throw them out no matter HOW helpful they is. Bad web developers have abused JS so much, so often and for so long, that I've decided it's less stressful to run with JS disabled. Don't even get me started on sites based entirely on Flash... -- Daniel
Re: QtD 0.1 is out!
Nick Sabalausky wrote: Bill Baxter wbax...@gmail.com wrote in message news:mailman.658.1233882921.22690.digitalmars-d-annou...@puremagic.com... http://adblockplus.org/en/subscriptions I'm not exaggerating when I say that for a few months before I found that addon, using the web was so bad I was *very* close to abandoning use of the web entirely. What kind of sites do you go that are so bad? I find things a little annoying without FlashBlock, and I have Firefox's default popup blocking on, but with those two things, I don't see much of anything all *that* annoying in my day-to-day web use. So I'm wondering if it has to do with the sites you frequent or something? Or is it just your threshold for tolerating an ad or two is so much lower than mine? FlashBlock is another one of my essential addons :) Let me put it this way: I don't have any sort of documented reading disability (ex, I've always done well on reading comprehension tests). But dispite that, I find it nearly impossible to read anything more than a single trivial sentence whenever there's anything moving, blinking, spinning, a slideshow, etc anywhere near the text (or when there's a voice reading it to me). It's not just annoying, it's a genuine distraction that my mind is simply unable to block out. Plus, as far as I'm concerned, there shouldn't be any moving, spinning, pulsating, animating crap to be blocked out of my mind in the first place. I run AdBlock, NoScript, FlashBlock and Nuke Anything Enchanced. And if I DO see an ad get through all that, I add the company to my mental people I will never buy from list. I'm an advertiser's worst nightmare. -- Daniel
Re: Descent 0.5.4 released
Ary Borenszweig wrote: New features: - Compile-time view (Window - Show View - Other - D - Compile-time View): allows you to see things from the compiler point of view, which applies some transformations to the source code. For example you can see what happens when you do a foreach, when you invoke an extension method, when you do operator overloading; know what type has an auto variable; how struct fields are accessed?; compiler optimizations. It also removes conditionals that evaluate to false, and shows the results of mixins in-place. As always, this is far from perfect and a lot of things can be improved. For the lazies, I'll later upload a video about this. :-) I've found one limitation of this, and it's a really weird one. It seems that some combination of a double-quoted string inside a backtick-quoted string in a statement under a static if causes this to fall over and break it's legs. The CT window just shows stuff like this: !descent.core.dom.compilationu...@17c858d I've attached the smallest test case I was able to make; hope it helps, because this is just about the BEST thing ever. As someone who makes heavy use of meta-programming, this is fantastic. Incidentally, the backtick-quoted string seems to make the editor VERY confused; try starting a `` literal, and pressing Enter inside. Now imagine trying to write a big code mixin like that... - Now hovering over a mixin (over the mixin keyword) shows it's result in a popup. *Glee* - Now hovering over a function or template instance with ctrl+shift shows it's compile-time result (with shift only: it's source code). Indeed, it does! This is SO awesome; now I don't have to muck about with pragma(msg,...) and compile-time formatting to check and make sure I'm not feeding the compiler garbage. [snip] Enjoy! I've never been big on IDEs; I never felt that they had enough advantages over a plain text editor to make up for the slowness and restrictions. But this is just so freaking awesome, I'm seriously considering moving over to Descent for my D development. It's just a pity I can't have my Vim editing commands, too :P -- Daniel const TestMixin = ` public void dispose() { static if( is( this.opDispose() ) ) try { this.opDispose(); } catch( Exception e ) { // TODO: add some sort of callback for failed disposals. For // now, write to stderr. Stderr.format(Disposal of {} failed with: {}, this, e); } } `; class TestClass { mixin(TestMixin); } void main() { return; }
Re: Introduction to ArcLib Updated...
Denis Koroskin wrote: On Wed, 21 Jan 2009 07:46:04 +0300, Jarrett Billingsley jarrett.billings...@gmail.com wrote: On Tue, Jan 20, 2009 at 10:11 PM, Clay Smith clayasau...@gmail.com wrote: Thanks for the suggestion. http://svn.dsource.org/projects/arclib/downloads/screenshots/arc01_freeuniverse.jpg http://svn.dsource.org/projects/arclib/downloads/screenshots/arc02_dazel.png http://svn.dsource.org/projects/arclib/downloads/screenshots/screenshot.png If you set their SVN mime-type to image/jpeg, they'll show up in the browser (instead of having to download them). I bet you are using firefox, right? I have no problem with it under Opera. That's because Firefox is following the standard, and Opera isn't. I can't remember if it's defined in the HTTP or HTML specs, but the browser is supposed to always act on the mime type, irrespective of what the URL is. -- daniel
Re: DMD 1.039 and 2.023 releases
Bill Baxter wrote: [snip] in C# they use the same syntax as the c pre-processor for conditional compilation and such even though C# doesn't have a pre-processor and the syntax is interpreted by the compiler. the above would be something like: void doSomething(T)(int i) { if (i == 0) { #if (is(T == A)) A.SomeAlias x; #elif (is(T == B)) B.SubType x; #else T x; #endif x = ... whatever } else int y = x; } D can always revert to this kind of syntax for compile time code. I kinda like that, actually, but I doubt it'll be very popular around here. --bb The '#' has a nice connotation for anyone who's used to C/C++, given that those statements are handled at compile time. The problem, of course, is that they're really nothing like C preprocessor statements. They have a different syntax, and completely different capabilities. What's more, you can't mix them across statements/expressions, so I suspect it would just cause more confusion. Additionally, there's this: #endif Unless you plan on moving all control structures to BASIC/pascal style, I don't think it's wise to start mixing them all over the place. I do like the idea of a scopeless block syntax in theory, though it's not something that's really been an issue for me. -- Daniel