salmanahmad / silo

The Silo Programming Language
0 stars 0 forks source link

Automatically infer non-resumable functions #127

Open salmanahmad opened 10 years ago

salmanahmad commented 10 years ago

If a function does not make any blocking calls, it should be marked as non-resumable. This should be done automatically by the compiler with no programmer intervention. Basically the function special form should have resumable(yes | no | infer).

The main issue of concern is that pre-compiled code may now break in non-obvious ways because a developer may use a blocking call which would cause the function to be marked as resumable, but client code may not know this because the external API has not changed. However, I think this is a bad reason to not support this. Basically, I should catch all ClassNotFoundExceptions, NoClassDefFoundErrors, and JVMVerifierErrors. I should examine them to determine if they are likely caused by the target function because made to be resumable and then print a pleasant error message to the user saying, "Recompile your (the client-side) code the function has changed its API".

Keep in mind most of the thing this will not be an issue since people will using "silo run" not "silo compile" and even when they do "silo compile" they will not be compiling all the time...

salmanahmad commented 10 years ago

Also look into how OCaml handles this with type inference and changing APIs. It does not seem to be a problem for them.

salmanahmad commented 10 years ago

I believe java.lang.IncompatibleClassChangeError is the exception that would be thrown.

salmanahmad commented 10 years ago

Also, another point to keep in mind is that when I create a new build that downloads dependencies, whenever I install or copy a dependency, it should automatically do a "make clean" so it forces a re-compilation.

salmanahmad commented 10 years ago

Just to also add some clarity to this, the main issue here is that it is easy to accidentally to break backwards-incompatibility.