Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Great tutorial, or greatest tutorial?

Name: Anonymous 2010-08-28 9:35

http://en.wikibooks.org/wiki/Write_Yourself_a_Scheme_in_48_Hours
This must be the greatest tutorial available to people keen to learn both HASKALL and SICP's protagonist SCHEME !!!!!!!

Name: Anonymous 2010-08-28 17:00

>>11
I'm pretty sure you can model a dynamic language in Haskell.
Lisps are usually not untyped, instead you have all your usual types and the types are tagged. You can easily describe all the Lisp datatypes in ML or Haskell. The idea is that you use a statically typed language as a meta-language, but the language its interpreting (or compiling) has of course different rules than the host language.

And no, Lisps aren't made of ``cons cells'', cons cells are just a very useful abstraction for a 2 valued structure which can hold any 2 objects (the car and the cdr), and are typically used to implement linked lists (chained cons cells with a nil or '() object to end the list - also known as a proper list), however besides linked lists, you tend to have a variety of other objects such as strings, classes, instances, arrays, characters, numbers(bignums, fixnums, complex, rational, etc) structures, conditions, hashtables, functions, pathnames, streams and so on (however, at the low-level you usually just have your integers, arrays and structures/instances, which themselves get reduced to tagged buffers or just plain data (ints or buffers). here's a listing of possible implementations: functions - structures containing a code buffer and other metadata. numbers - fixnums or buffers. strings - arrays of chars. chars - tagged integers. instances - structures. classes - instances of metaobjects. structures - tagged arrays. arrays - tagged buffers (bytes). hashtables - structures or instances. conditions - instances. pathnames - instances/strings. streams - structures of instances. cons - structure or something more optimized. fixnum - just native integers or tagged integers. bignum - buffers, and so on...). If I think about possible internal implementations, I don't really see what trouble you would have implementing it in Haskell ( I don't really know that much Haskell, but I know ML).
It should also be noted that Lisps without cons cells are perfectly possible, but the standard library would suffer somewhat and a different representation for linked lists would be needed, also certain nice tricks would just not be possible. The language however could exist just fine without cons cells, even though it wouldn't really be a classical Lisp. Frankly, I don't see that much point in replacing them as I think they make a lot of things much easier and in some usage scenarios, even faster, however a Lisp based on arrays instead of cons cells might be slightly interesting albeit also weird.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List