Of course the CGI-application would avoid any binding to visual LCL components. But having a simple switch that - using supposedly very similar {$ifdefs as are distinguishing between design and compile state right now - allows for either creating a CGI executable or a LCL enabled stand alone application would be really nice to have and seems to be doable (I'll take a look once I got the package running completely).
No, that makes no sense. The best you can do is create a "standalone" app that has an embedded Web server - see the ExtPascal site for doing this. This might have some application although I think it's fairly limited since you would still need to distribute the entire Ext JS package of JS controls with your app and the app would still need to be run in a browser.
VCL/LCL are too different from Ext JS and so I explicitly decided to avoid any runtime dependency on or compatibility with LCL. Here's a simple example of the problem you would have trying to "map" LCL to ExtPascal. The TExtFormLabel can probably be thought of as analogous to the VCL/LCL TLabel, but only in a crude way. TExtFormLabel has an Html property that has no analog in TLabel. You can set the Html property not only to use an HTML fragment for rich text (bolding, etc.), but also to display an image (<img src="mypic.jpg" />). How would you reproduce this with TLabel? You probably wouldn't and instead you would just lose this property altogether. With VCL/LCL you would use a TImage, which encodes the image in the .lfm file and streams it in at runtime - with HTML you need to have the image in an external file, either created in advance or created on the fly.
That's probably one of the biggest problems with the VCL/LCL/CLX approach - you end up deracinating the native widgetset, eliminating much of what is interesting and novel about it.
Note that you could develop both a desktop app and Web app that share quite a bit of code if you seperate the UI from everything else. You would then design two different UI's, one with VCL/LCL, one with ExtPascal. My toolkit's converter can even help with this if you have an existing VCL/LCL app and you want to start with the same form layout in the Web app. Of course, this raises the question of whether a Web app should look and behave like a desktop app. In some case, it might make sense but for other types of Web apps that probably wouldn't work out very well. But that's a different topic.
Also, if you look at the Gecko SDK port for Lazarus, it's possible you could create an embedded-server ExtPascal app that also eliminates the need to run the app in a browser, per se. Instead, you would run it in a TGeckoBrowser control, which fully supports JS, etc. This might provide more control over the app and could include some desktop functionality along with the "Web" app.
http://wiki.lazarus.freepascal.org/GeckoPortThanks.
-Phil