Can a scala program be running on a browser with disabled java plugin (as scala is compiled to a jvm bytecode)? In other words: is the jvm disabled provided the java browser plugin is disabled?
Or does Scala run server-side and I am confused?
Can a scala program be running on a browser with disabled java plugin (as scala is compiled to a jvm bytecode)? In other words: is the jvm disabled provided the java browser plugin is disabled?
Or does Scala run server-side and I am confused?
Scala is almost always run on the server or as a normal desktop "java" application.
I suppose it would work perfectly well as an applet, if it doesn't add any confusion to the security model, but if applets are disabled I presume you can't run any JVM code at all.
If I estimate it correctly, you can have both: Server-side and Client-side.
In case you want to use it on the server, it's called a Servlet and compiled to a JSP-application.
In case you want to use it on the client, it's an Applet and runs in the JVM. And that's what the user disables in his browser-settings.
As far as I know it, java and scala compiles to the same type of bytecode which is executed by the JVM.
Therefore, you cannot use neither Scala nor Java if the user has the plugin disabled. The browser cannot distinguish between these two.
The only java program which "runs in a browser" is an applet; any class extending java.applet.Applet
will serve this purpose. As a scala class can extend a java one, it is therefore perfectly possible to write an applet in scala.
However, this cannot run if java is disabled in the browser as scala runs on the Java Virtual Machine. (In fact, there's no difference between a compiled scala program and a compiled Java program - they are both bytecode, which is run on a JVM
)
Applets are not particularly common however, and most scala code will be server-side in practice. When you see people talking about scala and the web, they are most probably talking about Lift, which is a (server-side) web-framework for Scala.
Regarding Lift, the server side runs Scala, but the client side runs automatically generated Javascript, which does not need the jvm.