Scheme
is a dialect of LISP
- second-oldest popular language still in use, since 1958
!As there are many versions of Scheme
, we need to choose some specific of them. We are going to use
TinyScheme-R7 - it is a small interpreter written in a single C
file, so we easily prepare versions to run in Windows, in browser, on server etc. Everyone could grab it
and compile for mor special platform (e.g. Linux, OS X, BSD).
There are some disadvantages - like pool error handling etc - but we can improve this by and by since it is our
own version, derived from original TinyScheme
- thing which was used in GIMP image editor.
Main improvements in TinyScheme-R7
are some features from newer R7RS standard, some bugfixes and few
features to tailor it specifically for our needs.
scheme.exe
- ready executable.make
on content of the archive.We don't have yet docs and tutorials for our TinyScheme-R7
specifically, so you may use any Scheme
tutorial or manual you like (verifying your code with emulator or running it locally).
Recommended resources are:
Interpreted languages are not that fast as compiled. Python
code, for example, may be 20 times slower than
similar program in C
. It is similar in our case. As the server can't hang too long when running your solution,
it has some internal restriction on number of steps executed - currently, 3 mln
. These steps are calls of
Scheme
expressions, e.g. here are 4 calls:
(* 5 3)
Two calls for every argument, one for function name (yes, "*"
) and one call for function calculation itself.
When testing, you can call (eval-count)
function (non-standard of course) to check this counter and make
some conclusions.
There could be various reasons of failure. Try to analyze what is happening.
Try to get some sense from "verdict" given by checker. Check your code with emulator (or better with interpreter
downloaded to your machine) - remember other versions of Scheme
may behave differently from one used by the
checker.
Feel free to complain at forum - since functionality is new, it may be buggy. Tell if you have difficulties with emulator or local interpreter - perhaps we can improve it.