It's the 2nd week of Schemepy. I'm glad to say that I have a roughly finished guile back-end now. All existing (including some newly added ones) passed without any problem. However, I've also make some non-trivial interface changes:
toschemeis an instance method instead of a static method ofVMnow.fromschemeandtypeis instance methods ofVMinstead ofSCMnow.
Symbol class for Scheme symbols) make it impossible to run mithro's oldguile back-end unless some non-trivial patches applied.
Both changes due to inter-converting a Scheme lambda and a Python callable. For example, you can convert a Scheme lambda to a Python callable and then call it:
func = vm.fromscheme(vm.eval("(lambda (x) (* x 2))"))
func(4) # => 8
But a Scheme lambda can't be called independent of a VM, so the converted callable wrapper should remember the VM where the lambda was from. So fromscheme should be a method of VM instead of SCM, which is also unaware of the VM.
I was going along three lines at a time:
- Designing the interface.
- Writing the testcases.
- Writing the implementation.
Now there're 3 tasks for me in a short-term:
- Finish the guile back-end: This includes adding profile support for VMs and various auxiliary functions to the VM. Though the core part of the back-end has been finished, this is still not an easy task. That's because it is not just finishing the back-end, it is also finishing the interface which is much harder. The interface should remain stable after established.
- Testing: I'll try to get/stole/borrow test-cases from other projects to do thorough test for my Schemepy with guile back-end as a Scheme implementation.
- Benchmarking: I'll port the pyscheme to the new interface, write benchmarking test cases and run the benchmarks to compare the performance of the guile back-end and the schemepy back-end.
No comments.