quote:
Original post by PeterTarkus
Squirrel looked rather interesting, lot of cool ideas put into it.
I have not looked at the source code much yet though or tried it.
I have been playing with Tiny Scheme alot lately :-)
The only drawback to scheme is that it is very hard to read, I think it is even harder to read then Perl scripts. It is actually a super simple language though at the foundation.
Scheme/Lisp hard to read? Yes and no. It's much like any language, I remember learning BASIC years ago. Looked like greek to me then, then C; "what's all those '*' and '{' for?", and Lisp; "woah, so many brackets!", Perl looked familiar and yet everyone had there own way of writing it, and Python; "huh, were are all the brackets!?".
In the end, so long as it's not completely brain dead (Cobol?), and persist, you grok it. Most people though are used to Algol styled languages, so functional ones (try OCaml, Haskell) freak people out more!
I think it might be wise to not freak people out in the case of this new proposed scripting language, unless of course that's the point of it?
Me, I like Scheme/Lisp just as much as C/C++/Java. However I seem to write much more of the latter than the former. Perhaps
what we need is a little crash course...
[Lisp: Crash Course]
Write numbers as numbers, strings surrounded by double quotes, symbols as just names, lists as '(' then zero or more things seperated by spaces then ')'. To evaluate something, numbers and strings are themselves, and symbols are their current value, but lists of the form (function arg1 arg2 ... argN) mean evaluate arg1 through argN in turn, then pass them to function, which gives you the result. Exceptions; if something is preceed by a quote, then you don't evaluate it. If the function is "special" then you don't evaluate any of it's arguments. You now need to understand all the provided functions, and if they are "special" or not.
---
So given that you could start reading Lisp. Here's something familiar in nature, but not syntax (clue: defun is short for define function, the second argument is the name of the function, thirdly is a list of symbols standing for the arguments, and the rest is how to evaluate that function);
(defun factorial (n) (if (== n 1) 1 (* n (factorial (1- n)))))
Notice anything? No types... it's dynamic! It's also using recursion. Scary stuff if you've not seen that sort of thing before. Fortunately Lisp has always had side effects, so you can use iteration and do I/O. Some even let you specify types and have OO! It's also pretty easy to write an interpreter for, I have one somewhere which I wrote in under a day, sub 1000 lines that does pretty much everything you need for a scripting language. Of course nobody in their right mind would use it as a scripting language right?
Anyways, I need to stop this and some more code in Emacs, finish some textures I was working on in Gimp. Perhaps I'll just complete that last level on Jak and Daxter... :-)
--
Harvey Thompson (aka Viper)
Software Engineer/Games Researcher, UK.
[edited by - Viper3369 on April 22, 2004 8:27:39 AM] [edited by - Viper3369 on April 22, 2004 8:29:27 AM]