So, instead of making a scanner and a parser and so forth, is therew any code available that'll spit out an AST? That'd be nice.
I know that there's the FreePascal source (handy dandy!), but I see no AST being produced there...
Th reason I want this is because, well, I'm sick and tired of having to program in languages that don't have compile time type checking (like PHP and Java, where you don't know anything is wrong until you've installed it and are testing it).
Besides, it'd be nice if you could write:
procedure TMyWebApp.Init; [client] begin ... UserNameEdit.OnExit:=CheckAvail; ... end; procedure TMyWebApp.CheckAvail; [client] begin if not UserAvail(UserNameEdit.Text) then begin ShowMessage('That username you can''t have!'); UserNameEdit.Focus; end; end; function TMyWebApp.UserAvail(name:String):Boolean; [server] begin result:=dbquery('SELECT Count(*) FROM users WHERE name=%1',[name])[0].value=0; end;
Seems pretty cool, don't it?
This would be translated for you... with AJAX and stuff. (Yay!)
Client:
<script language="javascript"> function Init() { GetObj("UserNameEdit").OnExit=CheckAvail; } function CheckAvail() { if (AjaxCall("UserAvail",GetObj("UserNameEdit").Text)) { window.alert('That username you can''t have!'); GetObj("UserNameEdit").Focus; } } </script>
Or something like that...
And the server:
function TMyWebApp_UserAvail($name) { return=(dbquery('SELECT Count(*) FROM users WHERE name=%1',[$name])[0]->value==0); end;
Something like this...
But details need to be worked out... Anyone else see the benefits? 1 unified language to work with... built in database access framework in OODBMS style (preferable anyway), security (preferred also), and support for a host of environments (flash actionscript, html, java, cell phones and EVEN win32 apps!) all in one language, one environment, from 1 source.
Compile for target (here it's the LAMP target

Debugging support would be nice too... Yeah, it all needs some work (10000 man-hours worth) but it would be great! YOU would want a copy!
I think...
And please don't say I should go with C++ as the source language. That will be a target, not a source (as C++ is notoriously hard to read (and write) and produces the buggiest programs (ie windows) ever (with buffer overrun vulnerabilities, any1 hear that before?).
So, pascal it is.
Anyway, I figured I'd put it out there if someone has some input or comments...