2 inspiration / lineage questions

117 views
Skip to first unread message

Ben

unread,
Jun 29, 2013, 12:36:55 AM6/29/13
to juli...@googlegroups.com
Was CLOS a motivation behind the multiple dispatch? http://en.wikipedia.org/wiki/Common_Lisp_Object_System

Isn't Julia a Lisp, but with M-expressions? http://en.wikipedia.org/wiki/M-expression

Cheers,
Ben

Stefan Karpinski

unread,
Jun 29, 2013, 10:06:29 AM6/29/13
to Julia Dev
I can see how one could maybe see Julia as an M-expression implementation, but I have to say that I'm not really clear on what exactly M-expressions were supposed to be. So maybe? If this is the case, it wasn't really our intention. The similarity to whatever M-expressions might have been probably derives from the fact that we wanted a language with syntax, but which was nevertheless homoiconic. We didn't want this because being homoiconic is a great thing in itself, but because we wanted to be able to cleanly and effectively generate code at run time and have real macros, and representing your language's expression in data structures the language can manipulate is the way to do this. This approach *is* very heavily influenced by experience with various Lisps, in particular Scheme.

There are some similarities to CLOS in that Julia is a multiple dispatch system and has generic functions, etc., although, again, being like CLOS was not a motivation. The motivation was more along the lines of "how can we design a system where it's possible to cleanly define extensible numeric operations in the system itself *and* implement them efficiently?" rather than "can we make something like CLOS?" Dynamic multiple dispatch happens to be necessary for making numeric operators work correctly without baking them into the language spec. We omitted many features that CLOS has – like dispatch on values or any sort of meta-object protocol. We also included features that CLOS lacks which we found necessary, such as the ability to do diagonal dispatch (e.g. foo{T}(x::T, y::T) = ...). There seem to be more similarities between Julia's dispatch system and Fortress' than CLOS, but they stem from the two languages trying to solve the same problems, not from direct inspiration either way.

One thing we have tried very hard to do is not invent new terminology for existing ideas like multiple dispatch, generic functions, macros, etc. Making up new names for old, well-defined ideas with clear, generally accepted meanings doesn't do anyone any favors.

Ben

unread,
Jun 29, 2013, 8:28:13 PM6/29/13
to juli...@googlegroups.com
Thanks a ton for the lengthy response Stefan! This stuff goes a long way in putting together a mental map for me.

- Ben
Reply all
Reply to author
Forward
0 new messages