June 05, 2010
BCS wrote:
>> The most popular blog entry I wrote for DDJ, was the one on converting
>> assembler code to C, based on my ongoing trenchwork actually doing it
>> with optlink. 
> 
> BTW: how does that go?
> 

veeeeeerrrrrreeeee    sssssslllllllooooooollllllllyyyyyyy
June 05, 2010
Hello Walter,

> BCS wrote:
> 
>>> The most popular blog entry I wrote for DDJ, was the one on
>>> converting assembler code to C, based on my ongoing trenchwork
>>> actually doing it with optlink.
>>> 
>> BTW: how does that go?
>> 
> veeeeeerrrrrreeeee    sssssslllllllooooooollllllllyyyyyyy
> 

if(progress > 0) Ok();

-- 
... <IXOYE><



June 05, 2010
"Eric Poggel" <dnewsgroup@yage3d.net> wrote in message news:huck02$1rel$1@digitalmars.com...
> On 6/4/2010 11:13 AM, Adam Ruppe wrote:
>> On 6/4/10, Eric Poggel<dnewsgroup@yage3d.net>  wrote:
>>> I prefer D to PHP, but writing a web app in D would take me much longer due to the lack of web-oriented libraries.
>>
>> What kind of stuff would you need? I admit I did spend several weekends doing prep work on libraries before proposing it to the client - had to write mysql, cgi, http get and post, my xml code, and some helper functions to extend std.json before I was confident enough in having the libraries to propose it, but now I have that, and can share if it sounds useful.
>>
>> The only place where library lacking has hit me so far is interfacing with Facebook. For that part of the app, I still use PHP. I'd like to port it eventually, implementing oauth and such in a nice, generic way, but I haven't gotten around to it yet... still, the vast majority of what I need I can do now in plain D.
>
> It would be nice to have a web library for D, but my web development has been almost exclusively for shared hosting environments.  Also, most web developers know PHP while zero know D.  Clients would see that as lock-in.

A lot of clients I know wouldn't know the difference anyway, and thus wouldn't misinterpret it as lock-in. (Guess I've been lucky in that regard :) ) Although, if a client is really savvy (not that that's common), they'd know that 1. While PHP developers are abundant, *good* PHP developers are about as rare as any non-mainstream language and 2. When you know how to code in a language, transferring those skills to a similar language (for example, imperative-to-imperative) is fairly easy (That's a fact that, unfortunately, seems to be completely unknown by non-programmers, especially HR people...which is one of the reasons I consider HR people to be nothing but worthless morons that collect a paycheck without contributing anything worthwhile to society, and in fact, only serve to drag society down. It *should* be their job to know such things, but they don't, and those societal leeches get paid anyway...I even talked to one headhunter (they're like HR people but even worse) who was actually stupid enough to blurt out "I don't know anything about programming, but I can identify people who are good at it"...riiiight, like that's even conceivably possible outside her hometown of looneyville...but I'm veering waaay offtopic...).

Regarding support for custom cgi on shared hosts: I looked into that recently on the shared hosts I typically deal with, and it turned out to be more widely supported than I thought. Maybe I've just been lucky on that too, but it could be you're underestimating the support for it like I was.

Also, even if support for a language among shared hosts is small, the only way that's ever going to change is if a lot of developers want it. And the only way that's ever going to happen (these days) is if there's a good web library for the language. (Not that that'll guarantee success, but it would be a necessary step.)


June 05, 2010
Thu, 03 Jun 2010 21:34:05 -0400, Adam Ruppe wrote:

> I recently rewrote a huge PHP application in D2. It isn't a completely fair comparison, since the PHP was written by, well to be polite, PHP "programmers", but the results were pretty astounding.
> 
> 90% reduction in lines of code [!], 200% improvement in speed under heavy load (only 50% improvement under light load, still good, but not as good), and the code is actually maintainable! Also, the original took about a year for the first team to write. My D rewrite took 6 weeks. Oh yeah, and the PHP is riddled with security holes. Not so much with the D.

News at eleven! A rewrite of a shitty old version is better than the original. Now this proves that especially D2 should be used for rewriting everything! How surprising.
June 05, 2010
On 6/5/10, retard <re@tard.com.invalid> wrote:
> A rewrite of a shitty old version is better than the original.

The really interesting thing is how D on plain old CGI also performed better than fairly popular PHP applications as well, like phpBB3, WordPress and MediaWiki (determined by comparing individual pages that did basically the same thing. Not exactly though, so not a fully fair comparison)
June 05, 2010
On 06/05/2010 09:10 AM, Adam Ruppe wrote:
>
> The really interesting thing is how D on plain old CGI also performed
> better than fairly popular PHP applications as well, like phpBB3,
> WordPress and MediaWiki (determined by comparing individual pages that
> did basically the same thing. Not exactly though, so not a fully fair
> comparison)

Why is this interesting? D is a static, compiled, "system" language designed to be near the speed of C. PHP is a scripting language, similar to Perl, but built to make web coding easier.

And I agree with "retard" that if you rewrite something crappy (or even not so crappy), the new version will be better than the original. If you want your article to be taken seriously, you'll have to show code written in idiomatic PHP that benefits from being written in idiomatic D.
June 05, 2010
On 6/5/10, Jeff Nowakowski <jeff@dilacero.org> wrote:
> Why is this interesting? D is a static, compiled, "system" language designed to be near the speed of C. PHP is a scripting language, similar to Perl, but built to make web coding easier.

The reason I did the benchmarks was because I was talking to someone about it, and he said "yeah, php sucks, but isn't CGI really slow?" It isn't, not with D.

If you don't address request speed and scalability, nobody's going to listen to the other benefits. Opening with a statement like "200% faster" keeps their attention.

The biggest benefit, however, isn't running speed, but instead code maintainability.

> If you
> want your article to be taken seriously, you'll have to show code
> written in idiomatic PHP that benefits from being written in idiomatic D.

That's the plan. I'm hoping to write this up next weekend.
June 05, 2010
On 06/06/10 00:06, Adam Ruppe wrote:
> On 6/5/10, Jeff Nowakowski<jeff@dilacero.org>  wrote:
>> Why is this interesting? D is a static, compiled, "system" language
>> designed to be near the speed of C. PHP is a scripting language, similar
>> to Perl, but built to make web coding easier.
>
> The reason I did the benchmarks was because I was talking to someone
> about it, and he said "yeah, php sucks, but isn't CGI really slow?" It
> isn't, not with D.

It isn't anyway, at least not with fastcgi - take mod_php vs php in fcgi, fcgi is far *far* faster.

> If you don't address request speed and scalability, nobody's going to
> listen to the other benefits. Opening with a statement like "200%
> faster" keeps their attention.

That is a huge speed improvement, always a good opening statement!

> The biggest benefit, however, isn't running speed, but instead code
> maintainability.

Being the only two languages I'd call myself fluent in, I'd definitely call D easier to maintain than PHP... I guess this is easily debatable though.

>
>> If you
>> want your article to be taken seriously, you'll have to show code
>> written in idiomatic PHP that benefits from being written in idiomatic D.
>
> That's the plan. I'm hoping to write this up next weekend.

June 06, 2010
On 6/5/10, Robert Clipsham <robert@octarineparrot.com> wrote:
> It isn't anyway, at least not with fastcgi - take mod_php vs php in fcgi, fcgi is far *far* faster.

My numbers are all plain old vanilla CGI; fcgi would probably be better yet.

My hypothesis is that CGI gets its reputation because it has a relatively high start up cost, so it gets horrible numbers for hello world benchmarks. But, start up is a small percentage of a real world program's actual running time, so for most non-trivial programs, having faster code quickly erases CGI's initial deficit.
June 06, 2010
"Adam Ruppe" <destructionator@gmail.com> wrote in message news:mailman.111.1275779198.24349.digitalmars-d@puremagic.com...
> On 6/5/10, Jeff Nowakowski <jeff@dilacero.org> wrote:
>> Why is this interesting? D is a static, compiled, "system" language designed to be near the speed of C. PHP is a scripting language, similar to Perl, but built to make web coding easier.
>
> The reason I did the benchmarks was because I was talking to someone about it, and he said "yeah, php sucks, but isn't CGI really slow?" It isn't, not with D.
>

Yea, justified or not, it's a very prevailant belief in the web dev world that CGI == slow (since the whole process is reloaded on every request). In fact, until Adam mentioned his results, I had been wondering how CGI's overhead compared to the speed hit from using something like PHP (Of course, it probably depends on other things too, like Win vs Unix, Apache vs IIS, how much processing is actually done to generate the page, etc). And there's a lot of web devs and managers out there who would never even think to question their ingrained belief that CGI is slow. There's fastcgi, of course, but a lot of web devs (and managers) have never even heard of that.