Live data from Hacker News

Common Lisp Object System (CLOS)

hescaide.me

31–40 of 90 posts

Re: Common Lisp Object System (CLOS)

#31

Earlier quoted context omitted.

You cannot use Common Lisp without the CLOS. The fact that you can delude yourself into thinking that most of the time you don't have a reason to use it is what makes it so great.

You absolutely can use it without CLOS. It was an afterthought poorly bolted on that was worse than its predecessor in most ways as to be portable. It didn't exist when CLtL1 was written and barely existed when CLtL2 was released.

This "afterthought ... poorly bolted ... worse than its predecessor" is a type of HN comment that's too common. Not being a CLOS or Lisp user, I have no idea why you say this and can learn nothing from it.

HN's really starting to put me off with suchlike rife blanket-damning posts that are uninformative and usually come from people who have little experience.

Re: Common Lisp Object System (CLOS)

#32
post #19
post #9

One thing bad is the word 'class'. What it is supposed to even mean? It was some fancy concept by stupid Normen when defining Simula. My Simula teacher said that you could just translate it as "design" as in "design of car and its implementation". Anyways Python's "class" is even worse: class c: a=10 print c.a c.a=13 print c.a I cannot think any English word to replace the "class". The word I am thinking of could be…

Even C++ does not need ‘class,’ as it already has ‘struct’ that it inherited from C. (A saner language would just use the word ‘type.’)

Or as it's lived in all of java culture (and beyond) that isn't infested by that very special thought universe that exists around the landmarks of j2ee, "beans" and the spring framework, "classes" are just namespaces for organising your code that may or may not also happen to identify the type of a struct. A good term for that mindset would be "post OOP". As someone from that group, all I could think reading that CLOS post was "cute, the author really believes in all those early OOP promises? Must be a time traveler from the 20th century!" Actually checked the date, but then on the other hand they didn't have blogs yet when OOP was the future.

Re: Common Lisp Object System (CLOS)

#33
post #13

Earlier quoted context omitted.

"Object"? Though that creates ambiguity between definition and instances of the definition.

You just nailed it :) Maybe instead of "Class" and "Object" we should use "Definition" and "Instance".

I dunno, replacing all instances of defclass with defdefinition makes programs seem a bit silly.

Re: Common Lisp Object System (CLOS)

#34
post #21

Meh.. I code in Common Lisp at home and Java professionally and I've never understood why people praise the CLOS so much. Like the author says, 99% of the time you don't have a reason to use OOP, and the few times you do you'd prefer to use as little as possible to keep everything sane. It's also one of the few parts of CL which are not optimized well by default, using structs or other basic data structures instead o…

> rather than having to create interfaces I don’t know about that. To me, interfaces is the best thing since sliced bread, “OOP” or not. In particular, they bring some sanity to the design in the modern C++, where you would use templates in the lower level parts of the application, for performance, and interfaces at the higher level, for sanity.

[deleted]

Re: Common Lisp Object System (CLOS)

#35

Earlier quoted context omitted.

You absolutely can use it without CLOS. It was an afterthought poorly bolted on that was worse than its predecessor in most ways as to be portable. It didn't exist when CLtL1 was written and barely existed when CLtL2 was released.

This "afterthought ... poorly bolted ... worse than its predecessor" is a type of HN comment that's too common. Not being a CLOS or Lisp user, I have no idea why you say this and can learn nothing from it. HN's really starting to put me off with suchlike rife blanket-damning posts that are uninformative and usually come from people who have little experience.

It wasn't elaborated on because it wasn't part of the core point of the comment, which was someone claiming falsely that to write Common Lisp you needed to use CLOS, which you absolutely don't.

You wouldn't go into why JavaScript is bad to point out that you don't need to write JavaScript to make a web page. You would just note that JavaScript was a late addition to the web and wasn't the first language usable on it.

Plenty of people were writing CL before CLOS existed.

Re: Common Lisp Object System (CLOS)

#36
I've been exploring CLOS for the past couple of weeks.

From what I can tell, it seems especially nice for a system that needs extreme flexibility. I like to program MUDs and rougelikes as side projects, and after initial exploration, CLOS seems perfect for that - it can enable certain interactions that I would otherwise have to spend a lot of work and design achieving in other languages. It turns what feels like a chore in other languages into something fun.

I would imagine that how much this is a pro or con depends upon the work you do. Some might see such potential flexibility as error prone and overly complex because the domains they work in don't require such complexity. But others might see it as the building blocks for a domain with complex interactions that they have to build regardless of the language they use.

Re: Common Lisp Object System (CLOS)

#37

Earlier quoted context omitted.

You absolutely can use it without CLOS. It was an afterthought poorly bolted on that was worse than its predecessor in most ways as to be portable. It didn't exist when CLtL1 was written and barely existed when CLtL2 was released.

This "afterthought ... poorly bolted ... worse than its predecessor" is a type of HN comment that's too common. Not being a CLOS or Lisp user, I have no idea why you say this and can learn nothing from it. HN's really starting to put me off with suchlike rife blanket-damning posts that are uninformative and usually come from people who have little experience.

Indeed, this type of threads always remind me that HN is not the same as it used to be. If you wish to learn about something (including about its worth), it's not the right place. Read books; read and write code; form your own opinions.

Re: Common Lisp Object System (CLOS)

#38
post #5

> I don’t know the exact implementation details of CLOS, but I feel that it can be easily replicated in C This makes me think he's barely scratched the surface of what CLOS has to offer.

“Easily” is a stretch, but with a few Lisp->C idiom translations, you could follow along straightforwardly with “The Art of the Metaobject Protocol”[1]. [1] https://mitpress.mit.edu/9780262610742/the-art-of-the-metaob...

I've read the MOP too. I seriously doubt that this is the case. There is a lot just below the surface in CLOS that a casual encounter would not reveal. This post [1] by Joe Marshall gives a taste of how these features can go unnoticed until you need them, then you appreciate CLOS for these things.

[1] CLOS!? https://www.ca.crh.com/host-http-funcall.blogspot.be/2013/07...

Re: Common Lisp Object System (CLOS)

#39

Earlier quoted context omitted.

This "afterthought ... poorly bolted ... worse than its predecessor" is a type of HN comment that's too common. Not being a CLOS or Lisp user, I have no idea why you say this and can learn nothing from it. HN's really starting to put me off with suchlike rife blanket-damning posts that are uninformative and usually come from people who have little experience.

Indeed, this type of threads always remind me that HN is not the same as it used to be. If you wish to learn about something (including about its worth), it's not the right place. Read books; read and write code; form your own opinions.

Yes and no, books are fab but words from the genuinely wise can save you a lot of otherwise wasted time so I always appreciate for knowedgeable advice as well.

Re: Common Lisp Object System (CLOS)

#40

Earlier quoted context omitted.

This "afterthought ... poorly bolted ... worse than its predecessor" is a type of HN comment that's too common. Not being a CLOS or Lisp user, I have no idea why you say this and can learn nothing from it. HN's really starting to put me off with suchlike rife blanket-damning posts that are uninformative and usually come from people who have little experience.

It wasn't elaborated on because it wasn't part of the core point of the comment, which was someone claiming falsely that to write Common Lisp you needed to use CLOS, which you absolutely don't. You wouldn't go into why JavaScript is bad to point out that you don't need to write JavaScript to make a web page. You would just note that JavaScript was a late addition to the web and wasn't the first language usable on it.…

Then "You absolutely can use it without CLOS" would have sufficed.

You opined in addition on the quality of clos. That could have been very useful if you'd explained it.

Post reply on HN