Compile script before running through code

Is it possible to compile a script before passing each line? My impression is that the code is compiled line by line.

I want to start a server that does some calculations. When start the server, all code should be compiled so that the first user hasn’t to wait.

The compilation unit in Julia is a function, so you should probably place the contents of your script in a function and precompile that.

Ok, the code is in a function. Do I have to add a special command in the source to force full compilation?

There are ways to achieve this, as hinted at in my post in your other thread. Maybe this is of interest to you: