How D may replace PHP & ASPX on the Web!!!

Matthew Ong ongbp at yahoo.com
Tue Jul 26 08:48:30 PDT 2011


On 7/20/2011 1:24 AM, Adam Ruppe wrote:
> Matthew Ong
>> The KEY idea that I am trying to suggest is the modeling of the D Web
>> Framework that could beat google go
>
> Go's offering for web apps is very, very poor (at least it was last
> I checked when they did that "web apps in go" advertisement). It
> seemed content with offering only the bare minimum.
>
> D is already much better.
>
That is great news.

>>   The framework itself should be a single pid within the OS.
>
> Why?
>
> Note btw: D already has this. My cgi.d can be used with an embedded
> http server, meaning all data is handled by a single process.
CGI is ok. I played with CGI back in the days of perl in unix+apache httpd.

>
> But I recommend against it because that's less robust. If the one
> process dies, everyone suffers.
>
If there is way of handling the session from

This is what I have in mind with three processes:
1) Httpd with thread pools that handles multiple request and respond 
including web services.
2) Login/ACL/SessionID handling process that can do IPC(No network) and 
logs some activities. Routinely save the sessionID info into a file base 
database. Interact with (1) for authentication and session.
3) Monitoring (1) & (2) using some IPC to probe both the process health
and may execute some garbage collection instructions.


> It also doesn't scale as well as a multiple process approach, but
> this is surely my implementation more than anything else.
>
>
> There are things I kinda like about single process, but the
> robustness is a huge hit against it.
>
>>   Browser site time format might
>> allow hacker to mess the time info of attacks.
>
> No, you still use one time format inside the app. Timezone
> translation is only done for user input and output.
>
>> I actually in favor the Microsoft asmx + aspx approaches here, but
>> the aspx and asmx must be within the same SINGLE PID memory space.
>
> It looks like that has a lot in common with web.d.
>
> In web.d, you implement a service like this:
>
> ===
> class MySite : ApiProvider {
>     int add(int a, int b) { return a+b; }
>     string sayHello(string name) { return "Hello, " ~ name ~ "!"; }
> }
> ===
>
>
> If you're in the same process, you can call the functions directly:
>
> ===
> auto api = new MySite();
> assert(api.add(1, 2) == 3);
> ===
>
> It's just a regular class, so you call methods normally if you're
> local. If you are on a remote server, a very similar interface
> lets you call the functions remotely.
>
> Javascript example:
>
> MySite.add(1, 2).get(alert); // calls alert(3);
>
> You can also do other languages, nested calls, custom formats, etc.
>
> Anyway, this is super fast if local - it's just a method call - and
> reasonably fast and accessible if remote, while giving nice looking
> code.
>
> It gets really cool when you start using enums, alias, and structs
> though.
>
Are you able to zip up those into a single file that is compilable and
email it to me for testing? Show me how to setup, perhaps we can take it 
further into better level. I am new to D, but have seen many enterprises 
environment.

Does the webservices give some thing like this or a proper WSDL?
http://www.webservicex.net/ws/wscatlist.aspx

Another thing:
The java script works on IE, Chrome and firefox? If yes, that is great.
If not, please have generate WSDL that can allow java/.NET/PHP to 
interact with. That will open up the D WebFramework integrations.

I am currently working for a purely .NET environment company and can 
have resources to test that out. Java and PHP is free.


>> True, but many many web application is currently not yet mobile
>> ready because they are stuck in the CGI model(Aspx/JSP/Strut)
>> rather than the full MVC model like asmx + aspx.
>
> Meh, those fancy sites tend to work worse in my experience.
>
They did not model it properly. Perhaps D community could.


>
>> I am on +0800GMT what time zone you are on?
>
> I'm at GMT - 0400


-- 
Matthew Ong
email: ongbp at yahoo.com



More information about the Digitalmars-d mailing list