Is actionscript 3.0 strong enough to finally be my sole server-side language?
Actionscript 3.0 is much more powerful than its previous versions. Does th开发者_如何学JAVAis mean that I can start using it as my sole server-side language? can it connect to the database just like coldfusion or php? What is it that it can't do on the server-side?
Thanks
Short answer: NO, ActionScript 3 is client-side, since Flash is client-side technology.
Long answer: Haxe
short answer: YES
use redtamarin
http://code.google.com/p/redtamarin/
redtamarin allow you to run AS3 code on the command line and also on the server side
you will have native API for file system access, sockets, standard streams (stdout/stderr/stdin), operating system info, etc.
Now it depends what you need to do server side.
If you need to access databases, redtamarin have no API to do that yet (coming in a future version).
But you need to do CGI, run your own HTTP server or socket server, yes redtamarin can do all that.
edit:
proof here http://www.burrrn.com
this web site is entirely programmed with ActionScript 3.0 on the backend
- it run an ABC (ActionScript Bytecode) program as CGI
- it processes HTTP verbs GET / POST /PUT / DELETE / etc.
- it connect to 5 CouchDB databases
- all the navigation, pages, etc. are generated by code adding data into templates and then rendering HTML pages
- it processes form data, do RESTful API in JSON / XML, as well as basic / digest authentification
- and much much more
All that, again, in ActionScript 3.0 with redtamarin as the runtime
so I can definitively answer yes
RedRocket Server is an example of AS3 running server-side. I don't know how far along the project is, but you might want to check it out.
Sure you can use ActionScript 3 as server side language. Check www.components4developers.com. We have an n-tier tool that allows an application server to host AS3 functionality, Java functionality, C++ and Delphi functionality in the same server at the same time. The functionality (called services) can make interservice calls (to other services in the app server).
Similarly they can be called from clients written in C++, Delphi, PHP, Java, ActionScript 3, pure C and more.
best regards Kim Madsen
How strong it is largely depends on your own requirements, and the job at hand.
What you could do is list the requirements that matter to you, for example, documentation, ease of debugging, community support, vendor support, ease of deployment etc. For each language you want to compare, score how each one does on these requirements.
If you score Actionscript 3 the highest, you'll have answered your own question :)
However, one of your requirements is "can develop server-side code for HTML generation like PHP", and you'll find Actionscript scoring rather low there. While a limited server-side actionscript is available in Flash Media Server, it is more for providing services to client-side Flash applications than delivering HTML.
精彩评论