Back from beyond the grave
Hello.
Long time, no post. I don’t really have an excuse for that. Just generally being busy and not having a huge amount of time for personal projects. Hopefully I will get a little time over christmas.
I’ve done a little here and there, but nothing that seemed worthy of an update.
Today, I have started back into my Lisp interpreter. I fixed a load of minor bugs. I’ve added small amounts of other functionality. For example, I have added a type, similar to Lua’s lightuserdata. To test it, I made a set of functions for file manipulation. That, combined with the eval function I already had allows me to define (purely in Lisp) functions for including files.
Some of the things I’d like to add include a more robust type system, with user defined types. This could then be extended with types defined in C++. In order to do this properly I would like to implement reference semantics. I would then like to add some static type checking, with type inference. I don’t know how easy this will be to implement within a Lisp style syntax. In addition, I will probably need to implement some form of garbage collection.
At the moment, I think that it would be best to go for a C# style approach, where a type can be defined as having value or reference semantics only once, not like C++ where it can be done on a per parameter basis. The type of parameters can be optionally specified using a colon, like this:
(defun foo (a:int b:string c:File) /* ... */)
The types would be optional. The compiler would attempt to deduce any variables with undeclared types by their usage. Functions could be overloaded. Picking an unambiguous overload will cause me trouble too, I can only guess, especially considering that not all types will be known statically.
Well, these are some of the ideas I’d like to see if I can implement. I’ll try to keep updating this site periodically as I get different things to work, or not work.