coltkirk has left #lisp ["ERC (IRC client for Emacs 26.1)"]
<ku>
so can anyone suggest me a tool that would let me embed lisp in c to work like macros? alternatively, suggest a nice to use regex library for sbcl?
pierpal has joined #lisp
<equwal>
1: Why would you embed lisp in C? 2: cl-ppcre
Demosthenex has joined #lisp
<equwal>
Using C from lisp might be a good idea.
fikka has quit [Ping timeout: 246 seconds]
mejja has joined #lisp
<ku>
I am more looking for a preprocessor for c that would let me fudge syntax or at least generate code better
<equwal>
like yacc?
<ku>
that seems like it would be pretty involved to set up
<ku>
wouldn't I need to define all of Cs existing syntax?
<equwal>
When in Rome, do as the Romans?
fikka has joined #lisp
<equwal>
Otherwise you are writing a C preprocessor in lisp.
<jasom>
The C preprocessor is turing complete, so you could implement a lisp in the C preprocessor.
<equwal>
Never used it, but I imagine it is a turing tarpit situation.
<jasom>
well you have to #include yourself in order to make it turing complete.
graphene has quit [Remote host closed the connection]
Bicyclidine is now known as bike
graphene has joined #lisp
pioneer42 has joined #lisp
fikka has quit [Ping timeout: 250 seconds]
robdog has quit [Ping timeout: 252 seconds]
Mr-Potter_ has quit [Quit: Leaving]
graphene has quit [Remote host closed the connection]
graphene has joined #lisp
<jasom>
the only really non-standard part is using macros for preprocessor directives if you change the #d and #a it works still in gcc today
<jasom>
it does not define nil, but does treat () as self-evaluating
robdog has joined #lisp
anewuser has joined #lisp
robdog has quit [Ping timeout: 252 seconds]
fikka has joined #lisp
nirved has quit [Ping timeout: 252 seconds]
fikka has quit [Ping timeout: 250 seconds]
elfmacs has joined #lisp
arescorpio has joined #lisp
fikka has joined #lisp
fikka has quit [Ping timeout: 246 seconds]
marusich has joined #lisp
fikka has joined #lisp
ealfonso has joined #lisp
zch has joined #lisp
pioneer42 has quit [Quit: Leaving.]
lmy9900 has joined #lisp
fikka has quit [Ping timeout: 250 seconds]
marusich has quit [Ping timeout: 268 seconds]
cmatei has quit [Ping timeout: 244 seconds]
robdog has joined #lisp
lmy9900__ has joined #lisp
fikka has joined #lisp
lmy9900 has quit [Ping timeout: 250 seconds]
robdog has quit [Ping timeout: 268 seconds]
anewuser has quit [Ping timeout: 246 seconds]
lmy9900_ has joined #lisp
Jesin has quit [Quit: Leaving]
fikka has quit [Ping timeout: 250 seconds]
lmy9900__ has quit [Ping timeout: 250 seconds]
anewuser has joined #lisp
wusticality has joined #lisp
lmy99____ has joined #lisp
marusich has joined #lisp
lmy9900_ has quit [Ping timeout: 250 seconds]
Necktwi has quit [Quit: leaving]
Jesin has joined #lisp
lmy9900 has joined #lisp
wusticality has quit [Ping timeout: 252 seconds]
lmy9900_ has joined #lisp
fikka has joined #lisp
lmy9900__ has joined #lisp
lmy99____ has quit [Ping timeout: 268 seconds]
SaganMan has joined #lisp
lmy990___ has joined #lisp
lmy9900 has quit [Ping timeout: 250 seconds]
lmy9900_ has quit [Ping timeout: 246 seconds]
fikka has quit [Ping timeout: 268 seconds]
lmy9900__ has quit [Ping timeout: 240 seconds]
lmy9900 has joined #lisp
lmy990___ has quit [Ping timeout: 268 seconds]
lmy9900__ has joined #lisp
lmy990___ has joined #lisp
lmy9900 has quit [Ping timeout: 250 seconds]
wilfredh has quit [Quit: Connection closed for inactivity]
lmy9900__ has quit [Ping timeout: 240 seconds]
lmy9900 has joined #lisp
lmy990___ has quit [Ping timeout: 250 seconds]
lmy99____ has joined #lisp
lmy990___ has joined #lisp
lmy9900 has quit [Ping timeout: 240 seconds]
fikka has joined #lisp
buffergn0me has quit [Ping timeout: 268 seconds]
lmy9900 has joined #lisp
Necktwi has joined #lisp
lmy99____ has quit [Ping timeout: 246 seconds]
xkapastel has quit [Quit: Connection closed for inactivity]
lmy990___ has quit [Ping timeout: 250 seconds]
dddddd has quit [Remote host closed the connection]
fikka has quit [Ping timeout: 250 seconds]
ebrasca has joined #lisp
wusticality has joined #lisp
igemnace has quit [Quit: WeeChat 2.3]
lmy9900__ has joined #lisp
ku has quit [Quit: blap]
lmy9900 has quit [Ping timeout: 268 seconds]
pjb has quit [Read error: Connection reset by peer]
wusticality has quit [Ping timeout: 250 seconds]
pjb has joined #lisp
lmy9900 has joined #lisp
lmy9900_ has joined #lisp
lmy9900__ has quit [Ping timeout: 250 seconds]
lmy990___ has joined #lisp
lmy9900 has quit [Ping timeout: 268 seconds]
lmy99____ has joined #lisp
lmy99____ has quit [Client Quit]
lmy9900_ has quit [Ping timeout: 246 seconds]
<LdBeth>
Of course is possible to implement language with only rewriting
lmy990___ has quit [Ping timeout: 250 seconds]
rumbler31 has joined #lisp
fikka has joined #lisp
milanj has quit [Quit: This computer has gone to sleep]
fikka has quit [Ping timeout: 244 seconds]
buffergn0me has joined #lisp
aja042 has joined #lisp
<no-defun-allowed>
so i got an asdf system loaded into jscl today
<no-defun-allowed>
i didn't port asdf unfortunately, but i did write an OPEN which does HTTP requests and got split-sequence loaded
esrse has joined #lisp
skidd0 has quit [Quit: WeeChat 2.2]
fikka has joined #lisp
dacoda has joined #lisp
dacoda has quit [Remote host closed the connection]
dacoda has joined #lisp
dacoda has quit [Remote host closed the connection]
dale has joined #lisp
dacoda has joined #lisp
fikka has quit [Ping timeout: 250 seconds]
elfmacs has quit [Quit: WeeChat 2.3]
lmy9900_ has joined #lisp
arescorpio has quit [Read error: No route to host]
dacoda has quit [Remote host closed the connection]
fikka has joined #lisp
lmy9900_ has quit [Ping timeout: 250 seconds]
fikka has quit [Ping timeout: 250 seconds]
lmy9900 has joined #lisp
lmy9900_ has joined #lisp
[X-Scale] has joined #lisp
orivej has joined #lisp
xkapastel has joined #lisp
X-Scale has quit [Ping timeout: 245 seconds]
[X-Scale] is now known as X-Scale
steiner has quit [Ping timeout: 250 seconds]
lmy9900__ has joined #lisp
lmy9900 has quit [Ping timeout: 250 seconds]
lmy9900 has joined #lisp
lmy9900_ has quit [Ping timeout: 244 seconds]
lmy9900_ has joined #lisp
lmy9900__ has quit [Ping timeout: 250 seconds]
robdog has joined #lisp
lmy9900 has quit [Ping timeout: 246 seconds]
mejja has quit [Quit: mejja]
lmy9900 has joined #lisp
robdog has quit [Ping timeout: 252 seconds]
fikka has joined #lisp
lmy9900__ has joined #lisp
lmy9900_ has quit [Ping timeout: 272 seconds]
buffergn0me has quit [Remote host closed the connection]
lmy9900 has quit [Ping timeout: 250 seconds]
lmy9900 has joined #lisp
buffergn0me has joined #lisp
fikka has quit [Ping timeout: 250 seconds]
Necktwi has quit [Quit: leaving]
Necktwi has joined #lisp
orivej has quit [Ping timeout: 268 seconds]
lmy9900__ has quit [Ping timeout: 272 seconds]
Necktwi has quit [Client Quit]
Necktwi has joined #lisp
robotoad has joined #lisp
lmy9900 has quit [Ping timeout: 250 seconds]
lmy9900 has joined #lisp
lmy9900_ has joined #lisp
lmy9900__ has joined #lisp
dacoda has joined #lisp
dacoda has quit [Remote host closed the connection]
wusticality has joined #lisp
dacoda has joined #lisp
lmy990___ has joined #lisp
dacoda has quit [Remote host closed the connection]
dacoda has joined #lisp
Jachy has joined #lisp
lmy9900 has quit [Ping timeout: 250 seconds]
nowhere_man has quit [Ping timeout: 252 seconds]
arescorpio has joined #lisp
lmy9900_ has quit [Ping timeout: 268 seconds]
lmy9900 has joined #lisp
lmy9900__ has quit [Ping timeout: 246 seconds]
lmy9900__ has joined #lisp
lmy990___ has quit [Ping timeout: 250 seconds]
fikka has joined #lisp
lmy9900 has quit [Ping timeout: 268 seconds]
lmy9900_ has joined #lisp
fikka has quit [Ping timeout: 250 seconds]
lmy9900__ has quit [Ping timeout: 240 seconds]
fikka has joined #lisp
lmy9900__ has joined #lisp
lmy99____ has joined #lisp
lmy9900_ has quit [Ping timeout: 246 seconds]
lmy9900_ has joined #lisp
lmy9900__ has quit [Ping timeout: 246 seconds]
lmy99____ has quit [Ping timeout: 244 seconds]
lmy9900 has joined #lisp
lmy9900__ has joined #lisp
lmy9900_ has quit [Ping timeout: 246 seconds]
lmy9900 has quit [Ping timeout: 250 seconds]
arescorpio has quit [Remote host closed the connection]
lmy9900 has joined #lisp
Lycurgus has quit [Quit: Exeunt]
lmy9900__ has quit [Ping timeout: 245 seconds]
lmy9900__ has joined #lisp
lmy9900 has quit [Ping timeout: 250 seconds]
lmy9900 has joined #lisp
lmy9900_ has joined #lisp
lmy9900__ has quit [Ping timeout: 268 seconds]
lmy9900__ has joined #lisp
lmy9900 has quit [Ping timeout: 240 seconds]
lmy9900_ has quit [Ping timeout: 250 seconds]
<beach>
Good morning everyone!
lmy9900_ has joined #lisp
lmy990___ has joined #lisp
lmy9900__ has quit [Ping timeout: 268 seconds]
lmy9900_ has quit [Ping timeout: 250 seconds]
lmy990___ has quit [Ping timeout: 240 seconds]
lmy9900 has joined #lisp
lmy9900_ has joined #lisp
Kaisyu has quit [Quit: Connection closed for inactivity]
wusticality has quit [Remote host closed the connection]
dale has quit [Quit: dale]
lmy9900 has quit [Ping timeout: 268 seconds]
lmy9900 has joined #lisp
bike has quit [Quit: Lost terminal]
Necktwi has quit [Quit: leaving]
Necktwi has joined #lisp
lmy9900__ has joined #lisp
nullheroes has quit [Quit: WeeChat 1.9.1]
lmy9900_ has quit [Ping timeout: 250 seconds]
nullheroes has joined #lisp
lmy9900 has quit [Ping timeout: 272 seconds]
lmy9900__ has quit [Ping timeout: 250 seconds]
SaganMan has quit [Ping timeout: 244 seconds]
froggey has quit [Ping timeout: 268 seconds]
wusticality has joined #lisp
zch has quit [Quit: Leaving]
zch has joined #lisp
froggey has joined #lisp
sjl_ has quit [Ping timeout: 246 seconds]
rozenglass has quit [Remote host closed the connection]
<makomo>
beach: morning!
Necktwi has quit [Quit: leaving]
Necktwi has joined #lisp
Necktwi has quit [Client Quit]
SaganMan has joined #lisp
lmy9900 has joined #lisp
Necktwi has joined #lisp
Necktwi has quit [Client Quit]
lmy9900_ has joined #lisp
lmy9900 has quit [Ping timeout: 246 seconds]
lmy9900 has joined #lisp
rumbler31 has quit [Remote host closed the connection]
Inline has quit [Quit: Leaving]
lmy9900_ has quit [Ping timeout: 250 seconds]
wusticality has quit [Ping timeout: 252 seconds]
wusticality has joined #lisp
lmy9900_ has joined #lisp
hiroaki has joined #lisp
wusticality has quit [Read error: Connection reset by peer]
vlatkoB has joined #lisp
lmy9900 has quit [Ping timeout: 268 seconds]
Necktwi has joined #lisp
lmy9900 has joined #lisp
makomo has quit [Ping timeout: 250 seconds]
lmy9900_ has quit [Ping timeout: 240 seconds]
robdog has joined #lisp
<LdBeth>
Morning
lmy9900__ has joined #lisp
lmy9900 has quit [Ping timeout: 246 seconds]
graphene has quit [Remote host closed the connection]
lmy9900_ has joined #lisp
rumbler31 has joined #lisp
graphene has joined #lisp
lmy9900__ has quit [Ping timeout: 268 seconds]
lmy9900__ has joined #lisp
lmy9900_ has quit [Ping timeout: 246 seconds]
rumbler31 has quit [Ping timeout: 244 seconds]
orivej has joined #lisp
makomo has joined #lisp
lmy9900 has joined #lisp
robdog has quit [Ping timeout: 268 seconds]
lmy9900_ has joined #lisp
lmy9900__ has quit [Ping timeout: 244 seconds]
lmy9900__ has joined #lisp
lmy9900 has quit [Ping timeout: 246 seconds]
lmy9900 has joined #lisp
fikka has quit [Ping timeout: 246 seconds]
lmy9900_ has quit [Ping timeout: 250 seconds]
robdog has joined #lisp
<beach>
Hello LdBeth.
lmy9900__ has quit [Ping timeout: 246 seconds]
marusich has quit [Quit: Leaving]
lmy9900 has quit [Ping timeout: 245 seconds]
lmy99____ has joined #lisp
fikka has joined #lisp
robdog has quit [Ping timeout: 252 seconds]
fikka has quit [Ping timeout: 245 seconds]
lmy9900 has joined #lisp
SaganMan has quit [Quit: WeeChat 1.6]
lmy99____ has quit [Ping timeout: 246 seconds]
hiroaki has quit [Remote host closed the connection]
lmy9900_ has joined #lisp
fikka has joined #lisp
robdog has joined #lisp
hiroaki has joined #lisp
frodef has joined #lisp
lmy990___ has joined #lisp
lmy9900 has quit [Ping timeout: 272 seconds]
fikka has quit [Ping timeout: 250 seconds]
lmy9900_ has quit [Ping timeout: 240 seconds]
lmy9900 has joined #lisp
robdog has quit [Ping timeout: 252 seconds]
lmy990___ has quit [Ping timeout: 250 seconds]
Necktwi has quit [Quit: leaving]
xkapastel has quit [Quit: Connection closed for inactivity]
buffergn0me has quit [Remote host closed the connection]
buffergn0me has joined #lisp
fikka has joined #lisp
lmy9900__ has joined #lisp
lmy990___ has joined #lisp
lmy99____ has joined #lisp
lmy9900 has quit [Ping timeout: 268 seconds]
fikka has quit [Ping timeout: 250 seconds]
lmy9900 has joined #lisp
lmy9900__ has quit [Ping timeout: 250 seconds]
lmy990___ has quit [Ping timeout: 250 seconds]
lmy9900__ has joined #lisp
lmy99____ has quit [Ping timeout: 246 seconds]
lmy990___ has joined #lisp
lmy9900 has quit [Ping timeout: 250 seconds]
lmy9900 has joined #lisp
lmy9900__ has quit [Ping timeout: 244 seconds]
Necktwi has joined #lisp
lmy9900_ has joined #lisp
lmy990___ has quit [Ping timeout: 250 seconds]
lmy9900 has quit [Ping timeout: 246 seconds]
fikka has joined #lisp
robdog has joined #lisp
<splittist>
morning all
<no-defun-allowed>
morning splittist
pfdietz has quit [Ping timeout: 268 seconds]
pfdietz1 has joined #lisp
fikka has quit [Ping timeout: 244 seconds]
pfdietz1 is now known as pfdietz
JohnMS_WORK has joined #lisp
robdog has quit [Ping timeout: 252 seconds]
equwal has quit [Ping timeout: 268 seconds]
fikka has joined #lisp
lmy9900__ has joined #lisp
fikka has quit [Ping timeout: 244 seconds]
lmy9900_ has quit [Ping timeout: 250 seconds]
frgo has quit [Remote host closed the connection]
frodef has quit [Read error: Connection reset by peer]
lmy9900 has joined #lisp
shifty has quit [Ping timeout: 250 seconds]
lmy9900__ has quit [Ping timeout: 244 seconds]
fikka has joined #lisp
lmy9900_ has joined #lisp
angavrilov has joined #lisp
fikka has quit [Ping timeout: 245 seconds]
lmy9900 has quit [Ping timeout: 268 seconds]
lmy9900_ has quit [Ping timeout: 250 seconds]
fikka has joined #lisp
Necktwi has quit [Quit: leaving]
lmy9900 has joined #lisp
lmy9900_ has joined #lisp
frgo has joined #lisp
frgo has quit [Remote host closed the connection]
lmy9900__ has joined #lisp
frgo has joined #lisp
fikka has quit [Ping timeout: 240 seconds]
lmy9900 has quit [Ping timeout: 246 seconds]
lmy9900 has joined #lisp
lmy9900_ has quit [Ping timeout: 268 seconds]
lmy9900__ has quit [Ping timeout: 250 seconds]
lmy9900_ has joined #lisp
pierpal has quit [Remote host closed the connection]
Necktwi has joined #lisp
lmy9900 has quit [Ping timeout: 246 seconds]
Demosthenex has quit [Ping timeout: 250 seconds]
lmy9900 has joined #lisp
Demosthenex has joined #lisp
fikka has joined #lisp
lmy9900_ has quit [Ping timeout: 250 seconds]
lmy9900_ has joined #lisp
lmy9900__ has joined #lisp
lmy9900 has quit [Ping timeout: 272 seconds]
runejuhl has quit [Ping timeout: 250 seconds]
lmy9900 has joined #lisp
lmy9900_ has quit [Ping timeout: 244 seconds]
lmy9900_ has joined #lisp
<shka__>
good morning
<beach>
Hello shka__.
lmy9900__ has quit [Ping timeout: 250 seconds]
lmy9900__ has joined #lisp
kajo has quit [Ping timeout: 264 seconds]
lmy9900 has quit [Ping timeout: 246 seconds]
lmy9900 has joined #lisp
lmy990___ has joined #lisp
lmy99____ has joined #lisp
varjag has joined #lisp
lmy9900_ has quit [Ping timeout: 250 seconds]
drewes has joined #lisp
lmy9900_ has joined #lisp
lmy9900__ has quit [Ping timeout: 250 seconds]
lmy9900 has quit [Ping timeout: 246 seconds]
lmy990___ has quit [Ping timeout: 245 seconds]
lmy99____ has quit [Ping timeout: 268 seconds]
lmy9900 has joined #lisp
<elderK>
Guys, is it possible to create a structure instance using make-instance rather than make-foo?
lmy9900__ has joined #lisp
lmy9900_ has quit [Ping timeout: 246 seconds]
lmy9900 has quit [Ping timeout: 245 seconds]
jochens has joined #lisp
<jackdaniel>
make-instance is guaranteed to work on standard-classes, I think you can't conformingly use it to create instances of structure-class
<elderK>
jackdaniel: If so, what would be the point of setting (:constructor nil)?
<elderK>
You'd wind up with a situation where you've defined a structure but cannot create it.
lmy9900__ has quit [Client Quit]
<jackdaniel>
you may insert structures with a reader macro #s
<elderK>
True
<jackdaniel>
also you may include *your* structure in some other which may have a constructor
<beach>
elderK: There is a very easy solution to your problem.
<jackdaniel>
that way you give a clear signal, that you do not wish to have instances of foo
<beach>
elderK: Don't use structures. Use standard classes/objects intstead.
<beach>
instead.
<jackdaniel>
I don't think there is a problem, just a curiosity
<beach>
elderK: jackdaniel is right. MAKE-INSTANCE has methods specialized to only SYMBOL and STANDARD-CLASS, so it is not guaranteed to work for structures.
<beach>
elderK: I am willing to bet that there is no particular reason for you to use structures rather than standard classes/objects.
gigetoo has quit [Remote host closed the connection]
<jackdaniel>
complexity-wise one may wonder, if this question couldn't be inverted: if he is fine with structures then is there a particular reason to use standard-class over structure-class (structure instances are objects). This is rethorical, standard-class has plenty of adventages over structures and I'm sure elderK is unaware of some of benefits using them.
gigetoo has joined #lisp
milanj has joined #lisp
<elderK>
beach: I am using them because I don't have to define the accessors.
<beach>
That is a pretty lousy argument.
<elderK>
It's a slightly better argument when it's involving macros and would require me to construct accessor names.
<beach>
I don't understand that.
<shka__>
elderK: use classes unless you really know that you need something specific from structs
<beach>
shka__: structures are instances of classes too.
<shka__>
yeah, but you know what i mean
<beach>
shka__: That's why I carefully write standard classes/objects.
<shka__>
eh, ok
<shka__>
elderK: still doing that binary types thing
<beach>
shka__: I think we should encourage newbies to use the right terminology.
<shka__>
beach: ok, agreed
* beach
seems to be in a rotten mood again today, so will stop intervening in this discussion.
<beach>
elderK: Good luck with your structs.
hhdave has joined #lisp
<shka__>
i said it before, and i say it again, binary types style of issues suggest MOP based solution with modified slot-value-using-class
<shka__>
which should be both more flexible AND easier to understand
<jackdaniel>
I don't even understand this description
fikka has joined #lisp
<jackdaniel>
but that may be due to lack of coffee
<elderK>
shka__: That sounds like using a bazooka to kill an ant. The problem is simple. Create an instance of a structure (or class) by deserializing stuff from an octet vector.
<elderK>
I fail to see why a MOP is required here.
<elderK>
We have the definition of our structure, we have the slots, we know their precise offsets and types, etc.
Lycurgus has joined #lisp
<elderK>
We can generate code that is, for the most part, pretty tight in terms of what it has to do.
heisig has joined #lisp
<elderK>
The "binary" part of this only comes in when we're serializing the structure, or deserializing it.
<no-defun-allowed>
yeah you should be fine with a standard class for...what was it? parsing binary objects? i think it was that. you'll be fine
lmy9900_ has joined #lisp
hhdave_ has joined #lisp
<elderK>
I mean, sure, if you really wanted, you could have some crazy metaclass that would ALWAYS store its stuff in binary. But that would be stupid, it'd mean you'd constantly be serializing / deserializing slot values. Or you'd have some kind of cache.
hhdave has quit [Ping timeout: 246 seconds]
hhdave_ is now known as hhdave
<elderK>
I see no value in that added complexity.
anewuser has quit [Ping timeout: 250 seconds]
<shka__>
elderK: it is arguable easier to generate implementation of generic function for serialization and deserialization during initialization of the metaclass then dance around with macros
lmy9900__ has joined #lisp
<elderK>
shka__: What do you think I'm doing? I'm writing macros that generate the serialization and deserialization functions.
<jackdaniel>
structure class makes also sense exactly because of the known offsets (writing it and reading to it for exchange with some high-performant protocol may prove beneficial while being a bottleneck if you have a standard class)
<elderK>
But for various reasons, I am providing a define-binary-structure macro, which does a lot of checking and well, processing. Say, to make sure that all of the slots are of types that can be serialized, computing the offsets, etc.
esrse has quit [Ping timeout: 268 seconds]
<shka__>
elderK: well, yes, i am saying that it is EASIER to do it on MOP level then do it with just macros
<elderK>
Okay, why?
<jackdaniel>
because cool kids use MOP these days ;) shka__: you are forcing him to use your preferred programming style. it may be easier for you while some other approach may be easier for him
lmy9900 has joined #lisp
<shka__>
you have access to effective slot definitions (and relevant types) so inheritence does not hurt
<shka__>
jackdaniel: that's not about my preference
lmy9900_ has quit [Ping timeout: 244 seconds]
<elderK>
shka__: Right, so you're saying "Get the slots of the class, then write them all using generic functions, hurrah!"
<elderK>
Where as I am saying: I don't need to do that. I can generate the precise code to do it /all/ for a structure.
<jackdaniel>
it is, but I don't think I'm able to convince you, so I won't continue ;)
<elderK>
The offsets are wired into the generated code.
<jackdaniel>
that said I don't think I have anything interesting to add to this discussion
xkapastel has joined #lisp
<elderK>
shka__: Also, how does that help me ensure that slot types are all serializable types?
<shka__>
consider (defclass foo () ((%a))) (defclass bar (foo) ((%a)))
<shka__>
i don't see how to deal with that easiely with just macros
<elderK>
It's pretty simple. It doesn't matter that the slots have the same name.
<elderK>
What matters is who is the superclass. You serialize the superclass part first, before the subclass.
<elderK>
So you don't even care what the names and stuff are.
<jackdaniel>
(hint: he doesn't need to deal with it, fact that you need to deal with it is the exact argument against using classes, you need to keep a mental bookmark of how slots are inherited)
<elderK>
You just serialize it in progn order.
<jackdaniel>
standard classes* ;)
<shka__>
elderK: so you think that those are two slots?
<shka__>
jackdaniel: actually good point
<elderK>
Also: What makes you think the stuff I am deserializing are *LIsp* things?
<jackdaniel>
I'm not suprised that I've made a good point, I've considered it being good from the very beginning ;-) see you later
lmy990___ has joined #lisp
lmy9900__ has quit [Ping timeout: 272 seconds]
<shka__>
jackdaniel may be actually right, and you are better of with structs
<shka__>
sorry for confusion
<elderK>
I /will/ take a look at the MOP, though. Due dilligence and all that.
<shka__>
if we can abstract from your particular issue for a moment
lmy9900__ has joined #lisp
<shka__>
in example i wrote, bar class has on slot, despite inheritance from foo
<elderK>
shka__: Sure. Go ahead?
<shka__>
you may want to read it up, it will save you some headache in the future
lmy9900 has quit [Ping timeout: 268 seconds]
<elderK>
shka__: Right. As far as I understand CLOS, the slots are kind of combined. So, if multiple superclasses define the same slot, or a subclass defines a slot with the same name, they are combined and all effectively are the same slot, with options that are combined suitably.
<elderK>
At least, that is AFAIU and I do have to read up on it.
<shka__>
yes, also it has funny inpact on :type option
<shka__>
in your case
<shka__>
that's why it would be hard to do it with just macros, but rather easy with MOP
<shka__>
again, i think that jackdaniel actually has a good idea
nirved has joined #lisp
<shka__>
just sticking to structs would be a better idea
<elderK>
Right. But note that by using my own macros for defining binary structures, I can enforce various requirements / restrictions. I can ensure that any "binary structure" that is defined, can be serialized and deserialized. This limits the amount of cases I have to deal with.
lmy990___ has quit [Ping timeout: 250 seconds]
<shka__>
yes, obviously
<shka__>
personally i would simply raised condition in shared-initialize is slots are somehow incompatible, but that's just my preference at this point
robdog has joined #lisp
lmy9900 has joined #lisp
<shka__>
thing is, that as slong as you allow for inheritance in your types, you will have to deal with crap like changing superclass, slot names conflict and so one
<elderK>
True. And that is an issue. I will take a look at the MOP. Are there any introductory references to it that you could recommend?
<elderK>
I mean I won AMoP but it's been a long, long time since I read it.
<shka__>
AMOP, but it is not introductory reference
<shka__>
anyway, if you are fine with struct semantics, it is probabbly a better choice if you want to just use macros
lmy9900__ has quit [Ping timeout: 246 seconds]
<shka__>
especially because of what jackdaniel said earlier
<elderK>
Another thing I'm having trouble with, is keeping my lines <= 80. Even breaking expansion into lots of small helper functions, I'm having a tough time keeping things short.
<shka__>
pratice makes perfect :-)
robdog has quit [Ping timeout: 264 seconds]
<elderK>
:( It's just I wind up passing long lists of parameters. I also don't abbreviate, so, I will write say, "slot-description" instead of "slot-desc
lmy9900 has quit [Ping timeout: 245 seconds]
<elderK>
:( I kind of feel like I'm being boxed in.
lmy9900 has joined #lisp
<elderK>
One solution could be the use of special variables. But then, I've read they are hell on wheels for people to deal with.
<elderK>
At least, if used to simply avoid passing long parameter lists down.
<elderK>
Probably slower, too.
<shka__>
you can simply wrap you parameters in object
lmy9900_ has joined #lisp
<shka__>
it makes life easier :-)
<Jachy>
OOP: The CLOS Perspective has a MOP section that's more introductory, example is a persistent object store.
<elderK>
it does, but that means you have to come up with a nice name for that "parameter pack" :)
milanj has quit [Ping timeout: 250 seconds]
lmy990___ has joined #lisp
<elderK>
Jachy: I've not heard of that book. Who are the authors?
<elderK>
shka__: Also, keep in mind I'm writing this library primarily for Mezzano. I'll need to ask Froggey if Mezzano supports NOP
<Jachy>
Andreas Paepcke put it together but it's kind of a collection of papers from him and otherse.
<elderK>
*MOP
<elderK>
Thanks Jachy. I'll check it out.
lmy9900 has quit [Ping timeout: 246 seconds]
<Jachy>
The hardcover has the same sort of illuminated manuscript art that AMOP has too (same artist even) if you're into that sort of thing. ;)
lmy9900_ has quit [Ping timeout: 268 seconds]
lmy9900__ has joined #lisp
lmy990___ has quit [Ping timeout: 268 seconds]
milanj has joined #lisp
lmy99____ has joined #lisp
lmy9900 has joined #lisp
<elderK>
Jachy: I enjoyed the AMOP cover and stuff :)
<elderK>
Same with SICP too.
lmy9900_ has joined #lisp
<elderK>
When AMoP arrived, I was genuinely wowed by it
<elderK>
:)
lmy9900__ has quit [Ping timeout: 246 seconds]
fikka has quit [Ping timeout: 272 seconds]
<elderK>
shka__: And hey, I'm sorry if I came down hard on you. I didn't mean to. But truth is, I'm starting to feel really frustrated. I didn't mean to take that out on you. So, thank you for your advice. I will look into MOP. It may, as you've said, make my life a lot easier.
<elderK>
And it'd probably be a good idea to take a break from hacking and read a book if I'm feeling frustrated anyway :)
lmy9900__ has joined #lisp
lmy99____ has quit [Ping timeout: 246 seconds]
<elderK>
beach: One question I have for you - as I was taking a look a SICL - is how you're exporting symbols from your packages. From what I could see, the packages would define the name of a package but not often any symbols to export. I haven't looked at the code in detail, but are you using some other mechanism to export the symbols or are you just referring to them via ::?
lmy9900 has quit [Ping timeout: 246 seconds]
<beach>
I think we have been through this once before...
<elderK>
beach: I've never asked you about SICL before?
<beach>
I define one package that contains only the symbols to export.
<elderK>
Oh, yes, we have talked about that.
<beach>
In this case, it is typically the COMMON-LISP package.
wigust has quit [Ping timeout: 250 seconds]
<beach>
Then there are several packages that :USE the package meant for client use.
lmy9900 has joined #lisp
<beach>
In those packages are defined the implementations related to the symbols in the main package.
fikka has joined #lisp
lmy9900_ has quit [Ping timeout: 250 seconds]
<elderK>
Sorry. I just thought it was really nice, was all. I also thought it interesting how you had like, lots of .asd in subdirectories. Does that require any special setup for ASDF? Like, to tell it to recurse down the directory tree, rather than just look at the top-level project directory?
<beach>
Therefore, those implementation packages don't need to export very much at all, sometimes nothing.
<beach>
No, nothing special is required.
lmy9900_ has joined #lisp
<beach>
I define a "module" roughly as a directory, an ASDF system definition and a package.
<elderK>
Intresting. I didn't know ASDF recursed by default - I thought that required you to like, you know, tell it to do that for certain directories.
<beach>
It doesn't recurse.
<beach>
It just knows where all the ASDF files are.
<beach>
So when one ASDF system definition :DEPENDS-ON another one, then the other one is automatically found since ASDF knows them all.
<elderK>
:) I'll take a closer look at your work. FWIW, one thing I did notice was how clean the code seemed to be.
<beach>
You just need a link to the top directory from ~/quicklisp/local-projects and then run (ql:register-local-projects)
<elderK>
Ah, right.
<beach>
elderK: Thanks.
<elderK>
:) I'm not using QuickLisp yet. :P
<beach>
It works in similar ways with just ASDF as well.
lmy9900__ has quit [Ping timeout: 246 seconds]
<beach>
Just make the top directory known to ASDF.
<beach>
I think you can put a link in ~/.local/share/common-lisp or something like that.
lmy9900 has quit [Ping timeout: 240 seconds]
<elderK>
Aye. I had to create a configuration file of sorts for ASDF to find stuff
<elderK>
I figure you're familiar with that.
<beach>
That's stuff I tend to forget after having learned it in the past.
lmy9900 has joined #lisp
arbv has quit [Ping timeout: 252 seconds]
<beach>
Not enough room in my small brain I guess.
<elderK>
Fair enough :)
<jackdaniel>
ASDF (among others) have two two locate-system strategies: one is :tree and one is :directory (or flat, don't remember)
<elderK>
jackdaniel: Yeah, that's the one. Tree checks the directory and its children. Directory doesn't.
<jackdaniel>
first one walks the directories while the second one looks only for asd at known locations
<elderK>
"Known locations." I'll have to reread that part :) Thanks.
<jackdaniel>
they are listed in ASDF manual afair
<jackdaniel>
one is ~/common-lisp
<jackdaniel>
moreover you may provide your own search function
Demosthenex has quit [Ping timeout: 246 seconds]
<jackdaniel>
and locate-system will use it. I think that's what QL uses
lmy9900_ has quit [Ping timeout: 244 seconds]
fikka has quit [Ping timeout: 240 seconds]
<elderK>
Checking out SICL now. It'll be interesting to see if it works with my source-registry configuration. I expect I will learn a lot from SICL :)
<beach>
There is not much you can do with SICL at the moment, other then studying the code and compile some modules. And you might be able to run the bootstrapping procedure in its current state.
Demosthenex has joined #lisp
lmy9900__ has joined #lisp
jochens has quit []
<elderK>
Hey, if I can learn to better manage my projects and packages and stuff based on stuff I read in SICL, then it's time super well spent.
<elderK>
:D
<beach>
Oh, sure. All I am saying is that it is not quite ready for general use yet.
lmy9900 has quit [Ping timeout: 272 seconds]
<shka__>
oh no quid-pro-quo was removed from quicklisp :(
<ogamita>
elderK: the funny thing about structures, is that CL actually contains two object systems. A simple "static" one, with single inheritance, the structures, and a more complex and "dynamic" one, with multiple inheritance, run-time introspection and reflexion, the CLOS.
<ogamita>
elderK: the same generic functions can be used for both, but you can easily add other object system (cf. for example KR (Knowledge Representation, from the Garnet project)), and other ways to dispatch methods (including if you want, compilation-time dispatch, using eg. compilation-macros).
lmy9900 has joined #lisp
<elderK>
ogamita: I kind of wish I had a CL mentor of sorts.
<elderK>
:( Unfortunately they don't have any Lisp groups where I live :(
<ogamita>
Make one! Perhaps using meetup,com ?
lmy9900_ has joined #lisp
<jackdaniel>
studying inlined-generic-functions may be a well spent time
<elderK>
jackdaniel: I'd be happy to spend time learning about them. Are there any resources you could suggest?
<jackdaniel>
it is a library excercising mop dispatch capabilities
hhdave_ has joined #lisp
<ogamita>
elderK: there's this dilema, between using the most generic and high level tool, vs. using the most specific tool. Lisp doesn't favor one approach over the other, it provides a bunch of tools, and of metatools to let you write yet other tools. It's a question of style (and sometimes, constraints from the problem) what tool and what kind of approach you choose.
hhdave has quit [Ping timeout: 250 seconds]
hhdave_ is now known as hhdave
<beach>
elderK: What do you expect from a mentor?
<ogamita>
elderK: IMO, the right thing to do (as soon as you're writing real programs, not just school exercises to learn the language), is to always use your own abstractions, and use macros to generate the code choosing one tool or the other.
<elderK>
beach: I've never had a mentor so to be absolutely honest, I'm not sure.
Demosthenex has quit [Ping timeout: 246 seconds]
lmy9900__ has joined #lisp
<elderK>
beach: But I guess at a minimum, I don't know, just... guidance, I guess. On how to improve, in which directions to focus my learning, etc.
lmy9900 has quit [Ping timeout: 268 seconds]
<ogamita>
elderK: ie. never write defclass. Write a define-entity or a define-<thing> or anything there is in your domain. Then write a macro to expand either a defclass, a defstruct or something else, depending on the other constraints of the application. Then, when you'll need to change the implementation, you will only have to change a bunch of macros, and your program will stay the same, high level.
<elderK>
ogamita: That's what I've been trying to do. I feel like... I'm comfortable with the language now. But I haven't yet learned how to best apply it.
lmy9900_ has quit [Ping timeout: 250 seconds]
Demosthenex has joined #lisp
lmy9900 has joined #lisp
<ogamita>
(never use nth, elt, gethash or aref, write your own accessors (they can use those "low-level" CL operators), and use only your own abstract operators in your program.
<elderK>
This is why I have been working on a binary-types kinda system so that I can spend time building stuff that I'm particularly interested in.
<ogamita>
(never use nth, elt, gethash or aref, write your own accessors (they can use those "low-level" CL operators), and use only your own abstract operators in your program.
<ogamita>
elderK: this is well explained in sicp.
<beach>
elderK: As I think I have already told you, I am willing to give you some guidance. However, if I do that, it is with hopes that you will one day contribute software, documentation, etc. that I think is worthwhile, to the community. If I find it likely that this will never happen, I will drop it.
<elderK>
ogamita: Right. But would you use aref and friends at the lower level?
<elderK>
beach: My goal is to contribute meaningfully to Mezzano. And, since I am particularly interested in "systems stuff", to contribute systems to make doing "systems stuff" easier.
<elderK>
I like how close knit the CL community is. I most certainly want to be part of that :)
<beach>
Sounds good to me.
<elderK>
It's like the thing I've been working on, has been solely to improve stuff I've seen in Mezzano.
lmy9900__ has quit [Ping timeout: 250 seconds]
dacoda has quit [Ping timeout: 268 seconds]
<beach>
Again, sounds good to me. I don't know Mezzano myself, but it seems to be a project in the right direction.
shifty has joined #lisp
<ogamita>
elderK: come to ELS!
fikka has joined #lisp
<elderK>
It is very impressive :) And combines pretty much all the things I learn about or do. Learn CL and about compilers, as well as working on kernel-level stuff which I'm used to. It just seemed like a natural fit :)
hhdave has quit [Ping timeout: 268 seconds]
<elderK>
ELS? :)
<beach>
European Lisp Symposium.
<elderK>
Oh, god, I wish. That's ANOTHER dream.
<beach>
What is preventing you?
<elderK>
Unfortunately, I live in New Zealand.
<beach>
Nice place, but that is not a problem.
<elderK>
In the future? Nothing. But for now? I'm a student and I have very little money.
hhdave has joined #lisp
<beach>
Set up a crowdfunding site.
<elderK>
That would require me to have a large body of friends or colleagues that would contribute, no?
<ogamita>
elderK: next one is April 1st-2nd, in Genova, Italy. If you're married, no conjoin can resist a travel to Italy ;-)
<elderK>
Heh
<beach>
elderK: No, only a few rich ones.
<beach>
elderK: There are some of those here.
<ogamita>
As a student, perhaps you could get something from the University to come to this conference?
<Jachy>
You could also see if your school would offer support to further your academic goals.
<beach>
That too.
<ogamita>
elderK: you have a few months to write a lisp paper !
lmy9900 has quit [Ping timeout: 245 seconds]
<elderK>
ogamita: Maybe one day :) I know too little at current. But I'm working on it >:)
<elderK>
beach, Jachy: I will check the dates. You know, I might just start a crowdfunding thing for it.
<beach>
elderK: Where in New Zealand do you live?
<elderK>
I live in Dunedin, South Island.
<Jachy>
Does ELS have the same hack as other cons where if you submit a paper/talk that gets rejected the organizers offer you a reduced rate?
<beach>
elderK: Oh, nice!
fikka has quit [Ping timeout: 268 seconds]
<elderK>
Thanks :)
<beach>
elderK: I was there for the Australian Linux conference, more than a decade ago.
<elderK>
I've been spent time around most of the country, mostly working in the past. I like Dunedin because it's large enough to have all the things you'd mostly want and small enough to be easily traversed by those with poor eyesight :)
lmy9900 has joined #lisp
<beach>
elderK: And I toured the Central Otago Pinot Noir wine district.
<elderK>
beach: Any chance that was in 2005? :D
<elderK>
I was there, too :D
<beach>
Possibly, yes.
<beach>
Let me go check my T-shirt. :)
<elderK>
God, for me, that was a real "pinch yourself and check you're awake" kind of day.
<elderK>
I was 18 at the time, it was just, amazing to see so many of my heroes there. Like Pat Volkerding.
lmy9900_ has joined #lisp
<beach>
elderK: 2006. I think it was in Australia in 2005.
<elderK>
2006 it was then :)
<beach>
I lived in Auckland at the time.
<ogamita>
elderK: use a Common Lisp program (written by ITA software on sbcl, bought by Google) : https://www.google.com/flights#flt=DUD./m/0hknf.2019-03-30*/m/0hknf.DUD.2019-04-03;c:EUR;e:1;sd:1;t:f
<elderK>
Wow! Where abouts? A few years back I lived and worked up there. Initially in the CBD, then out in Ellerslie.
<ogamita>
elderK: and discover you can get a flight for 1091 euro. (to and back).
<ogamita>
elderK: this is only 200 per months till April! Can't you spare that?
trafaret1 has quit [Read error: Connection reset by peer]
Necktwi has quit [Quit: leaving]
ykm has quit [Quit: Yaaic - Yet another Android IRC client - http://www.yaaic.org]
ykm has joined #lisp
lmy9900__ has quit [Ping timeout: 250 seconds]
Necktwi has joined #lisp
<elderK>
Jachy: I'm enjoying the book so far - OOP: The CLOS perspective.
<elderK>
I find it interesting that like, defmethod is apparently the intended way to create most generic functions. I've always defined my GFs via defgeneric first.
Demosthenex has quit [Ping timeout: 250 seconds]
<shka__>
elderK: and you should keep doing that ;-)
SaganMan has joined #lisp
Demosthenex has joined #lisp
Demosthenex has quit [Ping timeout: 244 seconds]
makomo has quit [Ping timeout: 246 seconds]
Demosthenex has joined #lisp
robdog has joined #lisp
<elderK>
:)
hhdave_ has joined #lisp
hhdave has quit [Ping timeout: 268 seconds]
hhdave has joined #lisp
robdog has quit [Ping timeout: 252 seconds]
zch has quit [Remote host closed the connection]
<beach>
elderK: You should definitely use DEFGENERIC explicitly. I don't know where you got the contradicting information.
hhdave_ has quit [Ping timeout: 246 seconds]
zch has joined #lisp
<beach>
elderK: Using DEFGENERIC allows you to set the name of the parameters correctly, to set the method combination, the method-class, the generic-function class, the argument precedence order, etc.
<beach>
elderK: Even more importantly, DEFGENERIC is what is seen by client code, so you can attach documentation to it, put them in a file that defines a complete protocol, etc.
<shka__>
yup, essentially the only case when implicit GF definition are acceptable are internal (not exported) accessors to slots
zch has left #lisp [#lisp]
zch has joined #lisp
zch has quit [Client Quit]
gilez has quit [Ping timeout: 244 seconds]
confusedwanderer has joined #lisp
Necktwi has quit [Quit: leaving]
Necktwi has joined #lisp
milanj has quit [Quit: This computer has gone to sleep]
<elderK>
Thanks guys.
<elderK>
I got it from OOP: The CLOS Perspective.
<elderK>
I'm glad the defgeneric-first way is like, considered good form. I was doing it mostly because it felt subjectively... cleaner to me.
<luis>
shka__: do you define GF for exported accessors?
<elderK>
Oddball qusetion: When is it a good idea to deifne your own conditions? And are there any patterns or idioms for doing so? For example, if you have an error that is say, similar to undefined-function (which is a subclass of cell-error), should you create another condition that is also a subclass of cell-error?
<beach>
luis: I certainly do.
<elderK>
luis: Me too.
<Xach>
me 3
<luis>
Interesting.
<Xof>
18 years of DEFMETHOD-but-no-DEFGENERIC style warnings
<beach>
elderK: I think it is a good idea to define your own conditions pretty much all the time. You then give client code the choice of catching only that condition type or the superclass.
<elderK>
Even though I still feel uncomfortable defining GFs before the associated "class." I know - in CLOS, classes do not own methods. GFs own methods, that are specialized for various types. But, coming from C++, it still feels weird :D
<luis>
I'm pretty sure those style warnings were how I learned about DEFGENERIC to begin with. :-)
<beach>
Heh!
Necktwi has quit [Client Quit]
<elderK>
beach: So, would you create your own subclass of cell-error then? I have seen a kind of pattern about where people define their own "root condition" for say, their system. And have lots of subclasses of that.
gxt has quit [Ping timeout: 268 seconds]
<elderK>
Like, regardless of whether their conditions fit the semantics of those provided by CL.
<beach>
elderK: Yes, possibly with my own mixins if that is called for.
<elderK>
I need to learn about mixins. It's a concept that is pretty foreign to me.
gilez has joined #lisp
<beach>
It exists in C++.
<beach>
At least I think so, from memory, a long time ago.
anewuser has quit [Quit: anewuser]
<luis>
elderK: I've programming using CLOS long enough that the class-centric approach now feels weird.
robdog has joined #lisp
Necktwi has joined #lisp
frgo has quit [Remote host closed the connection]
robdog has quit [Ping timeout: 264 seconds]
kajo has joined #lisp
<Xach>
luis: annoying to constantly think "which of multiple participating objects 'owns' this functionality"
<elderK>
Aye. It will be nice to be... released from that.
<elderK>
It's going to take some time to get past the kneejerk "UGH, WEIRD" feeling in some places.
<elderK>
:)
<elderK>
I'm getting there though.
<elderK>
As for mixins, are there any resources that are worth a look?
<elderK>
I'm enjoying OOP: The CLOS Perspective so far, although I'm very very early in the text. I find the history of it quite fascinating.
<elderK>
The contrasting between the various OO "types" is also really interesting :)
<elderK>
:) It's going to take me a few days, maybe even a week, to work through the OOP: The CLOS Perspective.
<elderK>
And then I will probably read AMoP, another week or so.
<elderK>
I expect to be referring to AMoP continously after reading it, reference style, after I digest the concepts.
<elderK>
I really wish we had Matrix-style "Kung Fu" upgrades :P
<Xach>
elderK: you can have a long happy CL life without mop hacking at all.
<Xach>
it is a good example of a useful protocol, and worth studying, even if you don't tweak the protocol in practice.
drewes has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Necktwi has quit [Quit: leaving]
Necktwi has joined #lisp
<elderK>
Xach: Good to know
<elderK>
:) Always wise to be aware of the different ways you can solve a given problem.
robdog has quit [Ping timeout: 268 seconds]
ggole has joined #lisp
milanj has joined #lisp
<Odin->
If you have nails, screws, and rivets, it's very useful to know when each is appropriate. :)
gxt has joined #lisp
<elderK>
:D Exactly!
<elderK>
The problem is, of course, that study alone is not sufficient to really develop a solid intuition of when to use stuff.
crsc has quit [Quit: leaving]
<elderK>
That requires a large amount of time, trial and error.
<elderK>
Ah well :) Rome was not built in a single day.
runejuhl has joined #lisp
<elderK>
:P What we need is a hyperbolic time chamber :P
frgo has joined #lisp
<margaritamike>
Does SBCL have a built in library of generic utility data structures like the C++ STL or Java Utils package?
<elderK>
margaritamike: You might want to look at the SBCL manual. It does have a lot of extensions. But, CL itself provides many data structures out of the box.
<elderK>
Hash tables, lists, dynamic arrays, vectors, etc.
<elderK>
It's not all just "list processing" :)
<margaritamike>
sets also?
<elderK>
margaritamike: There are also a large number of libraries available in QuickLisp (and on Cliki) that provide various data structures.
dddddd has joined #lisp
<elderK>
margaritamike: Sets are provided by CL but they are implemend using bits or using lists. If you want something more performant than that, say, tree-powered or other, you might want to look into some of the libraries available on QuickLisp.
<elderK>
Such as FSet and friends.
<margaritamike>
Ok :)
frgo has quit [Ping timeout: 245 seconds]
<margaritamike>
I wonder why provided sets aren't tree-powered. They are in every other language
<margaritamike>
Atleast we have them I guess
<_death>
in some cases a hash-table can also make sense as a set representation
<margaritamike>
:[
<elderK>
margaritamike: I'd argue because tree-based sets can be synthesized easily enough. Also note that many languages with such things "in the box" are much newer than CL.
<elderK>
The other thing, of course, is that "naive sets" using lists and stuff /can/ be a lot faster than tree-based solutions, depending on the data itself and the number of elements.
<elderK>
Definitely take a look at FSet and stuff though :) I mean, even if say, a red-black tree isn't included in CL as standardized, it's most definitely provided by some library :)
<margaritamike>
Well I'm trying to get SBCL added to some popular online judges at the moment, such as Kattis and Timus (will be trying for Codeforces at some point), but not too successful.
<margaritamike>
Solving problems on those sites requires using only what the languages provides. No external libraries, unless they were made by you and the source code for them must be included in the source file of-course.
<margaritamike>
Just wondered how powerful the SBCL primitives were.
<margaritamike>
In terms of performant datastructs.
<margaritamike>
Seems like it has most of everything one would need to solve problems on those sites by default.
<margaritamike>
Only reason I was a little curious about the list-based set is concern of not passing the time limit put in place for problems that resolve around set-like datastructs. But there are ways to get around that.
ykm has quit [Remote host closed the connection]
<elderK>
I'm afraid I cannot help you more on this topic. I'm not sure how far various online services are willing to go to do things. You could argue that the "competition Lisps" would be running in an image loaded with many useful libraries.
<elderK>
Of course, you'd then have to provide such documentation to the competitors.
<_death>
another candidate representation could be a sorted vector.. in short, you need to define the ADT you need and decide based on that
jgkamat has quit [Ping timeout: 252 seconds]
<Jachy>
I would think every language would have its popular beyond-the-stdlib set of libs loaded for it in such a competition.
<margaritamike>
The sites mostly follow the same rules as the IOI and ICPC, maybe being slightly more lax. Barebones of the language only. No libraries unless written by you and included in the submitted code.
<elderK>
I'm not sure what level the competitions are being held at, either. I'd assume that you know, if it's really performance driven, the competitors will be able to implement say, an RBT implementation fairly quickly. I mean even a "naive recursive RBT" implementation is going to be fast enough in most all cases.
<elderK>
Or of course, just use a BST. Again, fast enough in almost all cases unless the data really is "degenerate."
Essadon has joined #lisp
<elderK>
margaritamike: Is C offered by these services?
<elderK>
Because it would suffer the same problems here, in terms of not having lots of stuff.
<Jachy>
Also seems unfair to allow for implementation specific beyond-stdlib utilities in languages that have actual standards.. there are a lot of gcc extensions, would those be allowed?
<elderK>
I mean, C offers less than CL in that regard.
jgkamat has joined #lisp
Essadon has quit [Max SendQ exceeded]
<margaritamike>
Yeah, although it's not used as much since people have to write their own custom libraries and include the source code in their submissions.
<elderK>
margaritamike: That surprises me.
Essadon has joined #lisp
<margaritamike>
An example of supported languages on Kattis. I think they're the closest to adding SBCL support so far https://open.kattis.com/help
<elderK>
Maybe contribute a "Kattis CL lib"? :) Or "Competitive CL Complement" or something :P
robdog has joined #lisp
<elderK>
Like, some minimal and "freestanding" implementation of handy ADTs.
<elderK>
But then, you might as well use LIL or FSet.
<elderK>
Unless you're like me, and like doing things yourself :D
<margaritamike>
With an O(n) access set, idk if an SBCL implementation using the common library would clear the 2 seconds.
<margaritamike>
But it's all good. Someone can just write their own for this problem, if not.
<elderK>
Aye :)
<elderK>
Good luck :D It can't be easy getting like, these services to offer support for new stuff.
astronavt has quit [Quit: Leaving]
<margaritamike>
Yeah wish I was wealthy to bribe them with money lol.
frgo has joined #lisp
<margaritamike>
I got help here making a github repo solving a problem they requested though and giving the online judge various results like solved, time limit exceeded, memory exceeded, etc.
<_death>
margaritamike: here you can just have a vector for the first sequence of numbers, which will be sorted because they are given in order, and for the second sequence you search a subsequence of that vector
<margaritamike>
It's a step in the right direction!
<Jachy>
I did a HS competition once that allowed Java or C++, one of the problems was solveable with a couple regexes. Poor C++ users had to do things the long way with parser code. :) Unfortunately I don't think SBCL has a built-in regex lib...
<margaritamike>
:p
<elderK>
Jachy: C++ does these days.
<margaritamike>
Yeah having these online judges provide Lisp as a provided language can definitely expose highschoolers to a gamified way of learning Lisp.
<margaritamike>
ehhh lotta redundancy in that sentence
<margaritamike>
ok off to work
<Jachy>
elderK: It had it back in the old days too with Boost.
Necktwi has quit [Quit: leaving]
<elderK>
Jachy: And of course, if you're on a UNIX-like, there are the system libraries too :D
<elderK>
Seeya margaritamike!
<Jachy>
Ah that's true, maybe you can break out to the system with sb-ext ;)
<elderK>
:) Still, always CL-PPCRE, no?
Necktwi has joined #lisp
<margaritamike>
Folks, one more question.
<Jachy>
Depending on how sandboxed the compo environment is, you could use sb-ext's run external program function to go download cl-ppcre. =P
<margaritamike>
Why hasn't the LISP standard been updated with goodies like distributed computing support or a regex library?
<_death>
because it's a standard, not a wiki page
crsc has joined #lisp
<shka__>
margaritamike: essentialy no money to work on standard and most of useful things can be a portable library
ebrasca has quit [Read error: Connection reset by peer]
<shka__>
which was point of having a standard in the first place!
<_death>
if you can get lisp vendors and users to agree on something and have funding to employee a new committee, go ahead ;)
<_death>
*employ
* shka__
starts kickstarter xD
ebrasca has joined #lisp
<ogamita>
elderK: you know that you can define methods in the defgeneric form: (defgeneric foo (x) (:method ((x string)) "hello") (:method ((x number)) 42) ...)
<margaritamike>
shka__: Where did the money go? Where did it come from when LISP was updating its Standard? Why did it stop? How can the community bring it back?
<shka__>
margaritamike: you are slightly confusing
<shka__>
*confused
<margaritamike>
Is that why people like Guy Steele walked away from LISP?
<shka__>
thing is, common lisp is not a grass root language
<shka__>
in fact it is pretty much industrial standard
<margaritamike>
O_o
<shka__>
but industry moved away from lisp towards other languages largely
<margaritamike>
Why?
<shka__>
and CL was slightly late for WWW boom
<shka__>
multitude of reasons, really
<shka__>
and most of them are non-technical
<shka__>
so, anyway, CL is any official ANSI standard, like C
<elderK>
ogamita: Yup, sure do :) So far, I don't really like doing that unless the methods are very, very simple.
<ogamita>
elderK: you should define your own conditions, as soon as you want to handle them (or you want the clients of your library to be able to handle them).
<shka__>
while for instance python has de facto standard of cpython but that's it
<elderK>
ogamita: Is it ever advisable to subclass a condition type already provided by CL /other/ than error or simple-error?
<ogamita>
elderK: depends. Sometimes, a single generic function dispatches over different types in a bunch of methods that must work very closely one to the other. Othertimes, the classes we dispatch on are more unrelated one to the other. In the later case, defmethod is more indicated.
<shka__>
now, getting ANSI standard out takes few years of work
ebrasca has quit [Remote host closed the connection]
<elderK>
I'm very new to conditions - I've mostly been using error and warn in my stuff so far with an eye to "I have to learn more about conditions soon!"
<ogamita>
elderK: definitely, notably, when you have more slot to qualify the condition.
<shka__>
but upside is that it is a good standard most of the time ;-)
<shka__>
so it is not as easy as "let's put this crap into new release because we can" kind of business
<Jachy>
Consider that C++ with all its usage share still took from '98 to '03 (don't even remember if anything worthwhile made it for that one..) to '11.
<elderK>
ogamita: How do you mean more slots to qualify the condition? Like, do you mean the situation where we want to provide more information than the stock-conditions allow for?
<margaritamike>
shka__: has there been any ongoing work on a new standard?
<elderK>
margaritamike: Not really, at least as far as I am aware.
<ogamita>
elderK: perhaps you could get a feel by doing : git clone http://github.com/informatimago/lisp com.informatimago && grep -nHiR define-condition com.informatimago # and looking at the hits.
<elderK>
And to be frank, I actually like that CL, the language, is mostly set.
<margaritamike>
shka__: how can that that initiative be started?
<elderK>
It's nice to not have to be revising every year :P
<shka__>
margaritamike: there is little to justify new standard of CL
<ogamita>
Definitely.
<shka__>
anyway, i have job to do ;-)
<margaritamike>
does ANSI CL have a threading implementation?
<elderK>
I mean, C++11 and later is a vastly different language than earlier revisions, at least if you want to write what's considered "good" code.
<ogamita>
elderK: and if your condition hierarchy is as or more numerous than your core class hiearchy, don't worry, it's normal.
<shka__>
margaritamike: no, but there is de-facto standard of BT
<margaritamike>
BT?
<shka__>
and you can count on it
<elderK>
margaritamike: Not built in but every CL implementation provides some mechanism. You can use bordeaux-threads to get a "uniform" interface to that functionality.
<shka__>
bordeux threads
<Jachy>
A couple months ago user 'phoe-krk on hacker news expressed interest in coming up with a plan for a new standard, not sure if he frequents this channel, of course there's been suggestions for improvements since the standard was being written..
<shka__>
i can't spell it ;]
<elderK>
shka__: :P Me either
<elderK>
If I got it right, it's a fluke, honest.
<elderK>
:D
<ogamita>
elderK: you may notice that some conditions are not errors. For example, (define-condition game-won () ()) is a subclass of condition (the default for conditions), not of error.
<margaritamike>
@Jachy wish i could help in some way with that
<elderK>
ogamita: Thanks for the links. I'll definitely check it out.
<ogamita>
elderK: conditions are what is SIGNAL'ed. They can be used to send "signals" between different parts of a program.
<ogamita>
then it all depends on how they are handled.
<elderK>
ogamita: what you just suggested, btw, reminds me of an experiment I did many years ago in C++. :P I used exceptions in C++ as a kind of "signal." It worked but was incredibly slow :P
<ogamita>
elderK: C++ is incredibly deficient.
<elderK>
ogamita: Indeed.
<elderK>
I need to invest a lot of time into understanding and learning to apply conditions. So far, what I've seen has seemed kind of intimidating. So, I've been focusing on other areas more immediately interesting :P
<ogamita>
elderK: conditions and restarts.
<_death>
elderK: you can check Kent Pitman's papers
<elderK>
There are a lot of things I need to learn about. Like, let's say I have some macro and while processing this macro, say via destructuring-bind on some nested forms or whatever, I determine that a form is invalid. destructuring-bind will signal an error. Do I just let that "low-level" error propogate up? Or do I catch it, and translate it into one more... related to the "Hey! X is invalid in this place, etc."
<elderK>
Jachy: Thank you!
<elderK>
:) Gosh, you guys are on a roll today. :) Lots of useful stuff for me to digest over the coming days / weeks / :D
<beach>
margaritamike: Maybe someone already said this, but in order to use trees for sets, there are some restrictions: 1. Your domain must admit a comparison operator and 2. The objects must be fairly large. Not all domains are like that, so trees are not the good solution for everything.
<ogamita>
margaritamike: have a look at http://cliki.net and search for distributed computing or regex, etc.
<beach>
margaritamike: Also, you are comparing a single implementation (SBCL) to languages (C++, Java). In Common Lisp, we are used to having several conforming implementations, so libraries tend to be separate from the implementations.
<ogamita>
margaritamike: it was pre-AI-winter. Now we're post-AI-winter, but we switched from symbolic AI (GPS) to statistical AI (GPU).
<elderK>
beach: That's an excellent point, btw, about trees.
<beach>
Thanks.
<elderK>
It's easy to forget the requirement for some kind of ordering predicate. I've definitely encountered situtaions where creating such a predicate was not ... intuitive. Say, for storing something in a set in C++.
<ogamita>
A lot of algorithms working with big sets, assume mutable (and bounded) sets . For this, bit-vectors are very nice.
<elderK>
ogamita: Bit vectors are awesome if they fit the requirements.
robdog has quit [Read error: Connection timed out]
<beach>
margaritamike: It is a very strange restriction to only allow libraries that a language provides. That means that only what is in the language definition is allowed, and most languages do not define any libraries. In fact, Common Lisp has been accused of providing too much library-related functionality in the language definition.
<beach>
I haven't followed the evolution, but is STL part of the C++ language definition now?
<elderK>
beach: Pretty sure it is, yes.
<beach>
What about C? Does the language definition have tree sets in it now?
<elderK>
C++ and STL aren't really separate at all anymore.
<beach>
OK, good to know.
<shka__>
anyway
<shka__>
want regex, use cl-pprce
<shka__>
want threads use bt
<elderK>
It actually makes me laugh a little when I think about it. Like, you see it written almost everywhere how "GIANT" CL is compared to "most languages." But if you compare CL to any recent language - say Java, recent C++ revisions, C#, etc. CL is *tiny* compared to them now.
<shka__>
(btw, lparallel is awesome)
<shka__>
there are solid libs for CL, you don't need those in the standard though
<elderK>
Hell, CL is "small" even compared with C11 or C14. At least, when consider all the new things like atomics and threading that are standardized in c.
<elderK>
shka__: lparallel? Is that like TBB for CL? :D
<elderK>
Don't forget cl-async and stuff too :D
<shka__>
and what is TBB?
<elderK>
Intel Threaded Building Blocks
<shka__>
ah, ok
<shka__>
no, lparallel is not like TBB
<beach>
Oh, so distributed computing is now in the standard of other languages?
<beach>
I sure must be out of touch.
<shka__>
beach: distributed usually not, but threads yes
<elderK>
Well, threading is in C and C++. As well as atomic data types and stuff.
<elderK>
Memory barriers, too.
<Jachy>
CL still seems competitive with out of the box compared to Java IMO. loop and format pack a lot of punch. For CLI programs I was charmed by CL's built-in yes-or-no-p function.
<shka__>
elderK: lparallel is a little bit like C# parallel lib
<elderK>
Jachy: "Large" as CL is, I've found it much more... uh, grokkable, than modern C++.
<shka__>
if you don't know lparallel i can't recommend it enough
<elderK>
And I've been using C++ for a long, long time. But god, there are infinitely many convoluted corners of that language.
<elderK>
And more weird things added all the damn time.
<beach>
shka__: It was more a question for margaritamike who seems to have suggested that Common Lisp is the only language that doesn't have distributed computing in the standard.
<elderK>
Like, esoteric stuff that if you saw it, you'd think was a syntax error. But then no, it turns out it was an odd feature added in the last revision.
<shka__>
beach: oh, ok
<Jachy>
elderK: Well there's "large" in providing out of the box utility like CL or Python or Java, and there's "large" in sheer complexity of syntax and semantics...
<elderK>
Good point.
bike has joined #lisp
robdog has joined #lisp
<elderK>
Hey Bike!
<bike>
hello
<shka__>
btw, CL has this awesome lib called lfarm
<shka__>
for distributed computing ;-)
rippa has joined #lisp
<elderK>
I wonder why the MOP was not included in ANSI CL.
<elderK>
Was it just too late?
<elderK>
Like, not finalized or... all the quirks worked out?
<elderK>
Or was it simply because the implementors of the day balked at it?
<beach>
It was not considered to have been tested enough.
<elderK>
Fair enough
<beach>
The MOP specification has definite issues with quality, compared to the Common Lisp HyperSpec.
<elderK>
If there was a new standard, I'd hope that the MOP and environment object stuff would be standardized. Same with package-local nicknames.
<beach>
elderK: Quit hoping.
<elderK>
:) Aye.
<beach>
elderK: It is quite common for newbies to wish for new things in the standard.
<beach>
1. Most of them don't know squat about language design.
<beach>
2. They often wish for things that might be fads of the day.
<elderK>
As it is, I'm pretty happy with CL. I don't see the fact that there are no new standards as a bad thing - quite the opposite: CL is a mature and stable platform - I like that it isn't chasing all the new fads and stuff.
<beach>
3. They often have no clue about compiler technology.
<beach>
4. It won't happen anyway.
<elderK>
It means we can focus on building systems and improving them rather than relearning the langugage every year.
<beach>
5. It is not needed, because we have libraries for it.
<elderK>
Aye
<beach>
6. Most other languages don't have what they wish for either. They just think so because they confuse "language" and "programming system".
<elderK>
Even as a newcomer, CL21 left a bad taste in my mouth :P
<beach>
Totally.
<elderK>
The annotations like @export and stuff. They aren't even /needed/.
<beach>
Now, that's a misplaced modifier in English.
<beach>
CL21 is not the newcomer, you are.
<elderK>
Agreed. That's what I was trying to say. :D
<elderK>
*Even being a newcomer, I found CL21 horrible.
<beach>
Even as a newcomer, I was left with a bad taste in my mouth when I discoverd CL21.
<beach>
Right.
<elderK>
:)
<shka__>
they added @export?
<beach>
Precision, precision.
<elderK>
shka__: CL21 did and a bunch of other stuff too.
kajo has quit [Ping timeout: 268 seconds]
<shka__>
well, @export is not needed (or welcome imho)
<elderK>
shka__: @doc and stuff, too.
<shka__>
silly reader macros
<elderK>
Which reminds me: I recently discovered Shinmera's documentation-utils. Seems like a nice library.
<shka__>
it is pretty much ok
mindCrime_ has joined #lisp
<shka__>
i made extension for it even
kajo has joined #lisp
<elderK>
Out of curiosity, what /is/ an appropriate use of reader macros? I always thought that really, the only sane use was for supporting like, new literals for new data types.
<elderK>
Like say, being able to process JSON :P
<elderK>
*As* JSON.
<elderK>
Literals for hash tables seem to be a favorite, too.
<shka__>
that would be it
<Jachy>
Infix notation is another. Generally I'd say it's just another tool to be able to grow the language towards expressing your problem in its most convenient representation.
LiamH has joined #lisp
<bike>
i kind of want a more standard mop though.
<ogamita>
for example, python has hundred (or perhaps thousands) of PEPs! (Python Evolution Proposals).
<ogamita>
(But not all python implementations implement them all).
<shka__>
ogamita: none?
<shka__>
or just one :D
<ogamita>
Yes.
Inline has joined #lisp
<_death>
elderK: I guess one appropriate use is when you do something that's related to the reader, e.g. controlling interning of symbols.. see Kaz Kylheku's PKG reader macro for example.. but usually I'd say it's confined to specific applications that do lots of work with objects that already certain textual notations "forced" upon them by the rest of the world
robdog has quit [Ping timeout: 252 seconds]
Demosthenex has quit [Ping timeout: 245 seconds]
<lieven>
one of the problems is that reader macros are global and so will clash
<lieven>
zetalisp had a mechanism where you could namespace them in the header of the source file IIRC
<_death>
named-readtables was mentioned here the other day
Demosthenex has joined #lisp
<lieven>
a solution to the same problem I guess
eschulte has joined #lisp
hiroaki has quit [Ping timeout: 272 seconds]
jsc has joined #lisp
jsc is now known as status402
Arcaelyx has joined #lisp
<elderK>
Bike: What would you like to be standardized about the MOP? :)
<elderK>
Or to be corrected?
orivej has joined #lisp
robdog has joined #lisp
<bike>
it's kind of vague and self contradictory in the few of the less used parts- stuff closer-mop tries to paper over, in large part
<bike>
the book amop describes it as a work in progress, but then we kind of took it as a pseudo-standard
Demosthenex has quit [Ping timeout: 250 seconds]
nicksmaddog has joined #lisp
<elderK>
shka__: After doing some introductory reading about MOP, you may have been right all along: It may not necessarily be the simpler option - to do binary serialization and deserialization - using the MOP but it may wind up being the more general option.
<elderK>
And I can see that doing that well could be very useful indeed.
<elderK>
Depending on like, what kind of restrictions and alterations you can make.
<elderK>
Very interesting stuff :)
<shka__>
yes
<elderK>
Confusing as hell. But interesting
<elderK>
:P
<shka__>
not all that confusing
<shka__>
it has layered structure
<elderK>
It will be less confusing when I see more practical stuff involving it. For now, it's mostly concepts and my brain is like, metaclasses of metaclasses of metaobjects! Objects all the way down! OH MY! :P
<elderK>
Then you know, brain stack fault
<elderK>
:P
<shka__>
well, critical point is that your object oriented program is defined in terms of classes, but MOP defines classes with metaclasses
<shka__>
by defines i mean: how to initialize those, what functions should be generated, how to access slots, what is slot, even
<bike>
the base case that's there to stop the recursion is the clos you already know
<elderK>
As it is, it seems like, reasonably understandable so far: There are some metaclasses that we cannot change, they are static and like. Then there are some that we can extend. There are a set of protocols that codify roughyl the processes that CLOS goes through when doing things - and these are implemented by methods on generic functions - which allows us to provide our own specializations. Type information is
<bike>
so don't sweat it too much
<elderK>
available for us to introspect, to help us do stuff based on the structure of class instances ands o on.
<p_l>
it gets easier when you start from objects and then define classes as objects that help you define objects
<shka__>
p_l: +1
Demosthenex has joined #lisp
<elderK>
Lame as it seems, this kind of helps: An object is an instance of some class, which si effectively a blueprint. But even those blueprints have blueprints: We have to have a design for like, the blue paper that designs are written on and stuff.
<elderK>
So in a nutshell: Everything has some kind of blueprint, up the chain it goes forever :P
<bike>
that seems like a fine way to think about it
kajo has quit [Ping timeout: 272 seconds]
<bike>
eventually you run into things that are their own blueprints, though
<beach>
Not forever. It ends with STANDARD-CLASS.
<p_l>
elderK: a bit of Smalltalkish/Ruby approach - a class is an object that provides a method called "new" which will build you a new object
<elderK>
Yeah, that circularity is what confuses me.
pierpal has joined #lisp
<_death>
elderK: heh, that's exactly how I described it in my mind.. classes are blueprints for objects, and metaclasses are blueprints for classes
<elderK>
:D
<elderK>
Glad to see I'm not alone in my thinking :)
<elderK>
I'll leave the circularity for later :)
<elderK>
I imagine it makes a lot more sense when you are like, comfortable with the "normal" metastuff.
robdog_ has joined #lisp
<_death>
(a class is a metaobject; metaclasses are classes, and so may also have metaclasses)
mindCrime_ has quit [Ping timeout: 250 seconds]
<TMA>
elderK: blueprints are not on a blue paper though. the process just stains the paper blue everywhere _except_ where the design is; so a (meta)class is not exactly a blueprint in this sense
<bike>
i think "metaclass" is kind of confusing honestly. there's just objects with classes, and those classes are also objects with their own classes
<elderK>
Perhaps :P It is still a useful vehicle for understanding atm.
<bike>
amop says as much iirc
<shka__>
AMOP does not use 'metaclass' word
<elderK>
:P Like different metaclasses: Blue blueprints are for like, normal houses. Red blueprints are for FANCY houses that have all these things :P Both describe how stuff is to built :P But differently :P
<shka__>
Bike: yup
<elderK>
And sure, the differences here are not great for analogies. And are flawed.
<elderK>
:P But it still gives me something to help my brain grok
<elderK>
:D
<_death>
shka: are you sure about that?
<shka__>
_death: yes, it explicictly states that they won't use metaclass term from now
<elderK>
Objects are instances of classes. And classes are instances of metaobjects, which are instances of metaclasses. No?
<shka__>
elderK: it ends on standard-class
<_death>
shka: so it does define it.. but I see what you mean
<elderK>
shka__: Right. So, a class is an instance of standard-class?
<elderK>
And standard-class is a standard-object that is an instance of standard-class?
<shka__>
elderK: MOP is to consider it as a layer upon layer
<_death>
I don't like that type hierarchy diagram
<jackdaniel>
I find it super-helpful
<shka__>
where each layer is defined in terms of the lower level
Demosthenex has joined #lisp
<shka__>
but it has bottom line, obviously
<beach>
_death: Why not?
<jackdaniel>
elderK: while conditions are *practically always* implemented as a class standard doesn't mandate that (they are only referenced as types), though there is a cleanup issue
<_death>
for example there's no path from BIT to FIXNUM
emdeesee has joined #lisp
<elderK>
jackdaniel: I'm not sure where I read it, maybe CLtL2 but yeah, I was aware of that.
<jackdaniel>
elderK: to be more exact, class precedence is T -> condition; it usually is T -> built-in-class->condition
varjag has quit [Remote host closed the connection]
HighMemoryDaemon has joined #lisp
varjag has joined #lisp
trittweiler has quit [Ping timeout: 250 seconds]
xkapastel has quit [Quit: Connection closed for inactivity]
orivej has joined #lisp
HighMemoryDaemon has quit [Quit: ERC (IRC client for Emacs 27.0.50)]
nowhere_man has quit [Ping timeout: 246 seconds]
jmercouris has joined #lisp
robdog_ has quit [Remote host closed the connection]
robdog_ has joined #lisp
robdog_ has quit [Remote host closed the connection]
milanj has quit [Quit: This computer has gone to sleep]
jkordani_ has joined #lisp
shifty has quit [Ping timeout: 250 seconds]
jkordani has quit [Ping timeout: 250 seconds]
<gendl>
Hi, if I have an existing file with LHTML, is there a way to use cl-who to render it to HTML?
<gendl>
i.e. I don't have the LHTML wrapped in a cl-who:with-html-output macro
<gendl>
it's just existing on its own
<_death>
is it the same syntax that cl-who uses?
<gendl>
yes, the alternate "LHTML" syntax which is supported starting with 0.4 of cl-who -- where attribute key/value pairs are in their own list.
<_death>
well, you could EVAL or COMPILE/FUNCALL or #. depending on the circumstance..
<gendl>
ok. let's say I have a file sample.lhtml
<gendl>
then how would I use eval or compile/funcall to apply cl-who:with-html-output-to-string to it?
jmercouris has quit [Remote host closed the connection]
<_death>
(eval `(cl-who:with-h-o-t-s ... ,root))
<gendl>
(eval `(cl-who:with-output-to-string ,(with-open-file (in "path/to/sample.lhtml") (read in))))
<gendl>
like that?
meepdeew has joined #lisp
Demosthenex has quit [Ping timeout: 246 seconds]
Demosthenex has joined #lisp
Jesin has quit [Quit: Leaving]
Kundry_Wag has joined #lisp
keutoi has quit [Ping timeout: 240 seconds]
xkapastel has joined #lisp
orivej has quit [Ping timeout: 246 seconds]
Jesin has joined #lisp
heisig has quit [Quit: Leaving]
kuwze has quit [Quit: Page closed]
knicklux has joined #lisp
Demosthenex has quit [Ping timeout: 268 seconds]
cmatei has joined #lisp
FreeBirdLjj has quit [Remote host closed the connection]
Demosthenex has joined #lisp
SaganMan has quit [Quit: WeeChat 1.6]
nicksmaddog has quit [Ping timeout: 268 seconds]
Jesin has quit [Quit: Leaving]
nicksmaddog has joined #lisp
Demosthenex has quit [Ping timeout: 250 seconds]
Demosthenex has joined #lisp
Jesin has joined #lisp
random-nick has quit [Ping timeout: 246 seconds]
zch has quit [Remote host closed the connection]
zch has joined #lisp
Lycurgus has joined #lisp
elderK has quit [Ping timeout: 250 seconds]
Lycurgus has quit [Client Quit]
ggole has quit [Quit: ggole]
robdog_ has joined #lisp
Kundry_Wag has quit [Remote host closed the connection]
nicksmaddog has quit [Ping timeout: 260 seconds]
confusedwanderer has quit [Quit: confusedwanderer]
pierpal has quit [Read error: Connection reset by peer]
pierpal has joined #lisp
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
robdog_ has quit [Ping timeout: 260 seconds]
<fiddlerwoaroof>
Bike: death always wins in the end :)
graphene has quit [Remote host closed the connection]
graphene has joined #lisp
<Younder>
The lisp member of the grim reaper death?
random-nick has joined #lisp
<Younder>
or
<pfdietz>
(sb-ext:save-lisp-and-die)
Kundry_Wag has joined #lisp
<pfdietz>
A function name that is frankly heroic.
<Younder>
Yeah, oldy but goodie.
Kundry_Wag has quit [Remote host closed the connection]
aja042 has joined #lisp
frgo has joined #lisp
terpri has joined #lisp
Demosthenex has quit [Ping timeout: 250 seconds]
Demosthenex has joined #lisp
robdog_ has joined #lisp
commanderkeen has joined #lisp
orivej has joined #lisp
robdog has quit [Ping timeout: 268 seconds]
robdog_ has quit [Ping timeout: 268 seconds]
fraxamo has joined #lisp
Zaab1t has quit [Quit: bye bye friends]
robdog has joined #lisp
robdog has quit [Ping timeout: 252 seconds]
malice_ has joined #lisp
<pjb>
pfdietz: ext:saveinitmem in clisp doesn't need to commit suicide to work nicely.
<pjb>
So sbcl has good PR, but what else?
<no-defun-allowed>
CLISP is also shit slow and interprets bytecode.
vlatkoB has quit [Remote host closed the connection]
<p_l>
pjb: having looked once at CLISPs memory management runtime... it's *really* bad
<p_l>
I hope that someone ripped that out since then
<p_l>
but the maintainer at the time didn't want to even accept that he was claiming the docs said something different
* pfdietz
stops trying to rewrite "Epitaph on an Army of Mercenaries" to be about sbcl.
<_death>
what became of the Lightning JIT thing
<pfdietz>
But "They saved their image and are dead" just works.
<p_l>
I don't think it went far?
<jackdaniel>
Lightning JIT was added *after* last CLISP release
<jackdaniel>
(afair)
<pfdietz>
The SBCL I'm using was released Feb. 2018.
<pfdietz>
Er, clisp
<pfdietz>
Welcome to GNU CLISP 2.49.93+ (2018-02-18) <http://clisp.org/>
<pjb>
yes, same here.
robdog has joined #lisp
<jackdaniel>
then I'm pretty sure it is after adding JIT. as of whenever it builds with it by default I do not know, maybe it requires a specific flags and libjit.so on the system?
dddddd has quit [Ping timeout: 268 seconds]
<pfdietz>
clisp is being supported even now, which itself is a triumph for a free software project. And it's useful for some things, including building sbcl from scratch.
<malice_>
Who is supporting it?
knicklux has quit [Ping timeout: 250 seconds]
<pfdietz>
Bruno Haible fixed a bug I reported just recently.
<pfdietz>
One advantage of clisp is the small memory footprint. A bare clisp uses 1/3 the memory of a bare sbcl. Granted, a bare ecl is even smaller.
angavrilov has quit [Remote host closed the connection]
shka_ has quit [Ping timeout: 240 seconds]
<p_l>
pfdietz: it would probably use even still if, iirc, bruno accepted patches or comments to the memory code
<malice_>
That's nice. Did they transition recently? I remember looking at clisp two years ago and it looked kind of abandoned at the time.
knicklux has joined #lisp
<pfdietz>
I don't know the history.
<pjb>
malice_: check the graphs/master ;-)
knicklux has quit [Ping timeout: 252 seconds]
<aeth>
CLISP has one thing going for it over other implementations (portability is not one, ECL exists): arbitrary precision long float
<aeth>
At least, that I know of
robdog has quit [Read error: Connection reset by peer]
robdog has joined #lisp
<pfdietz>
Just need to be able to extend the built in numerical functions to handle new types. Things like + already dispatch on argument type.
<pfdietz>
There's nothing in the standard that says + can't be generic.
<_death>
well, sbcl has that sb-gmp contrib
<_death>
and sb-mpfr
graphene has quit [Remote host closed the connection]
knicklux has joined #lisp
<aeth>
(require :sb-gmp) ; wow
graphene has joined #lisp
permagreen has quit [Remote host closed the connection]
<aeth>
I guess I should just say that it's not implemented as the implementation's long-float, then.
robdog has quit [Remote host closed the connection]
scymtym has quit [Ping timeout: 268 seconds]
jxy has quit [Quit: leaving]
kyby64 has quit [Quit: Leaving]
gxt has quit [Ping timeout: 240 seconds]
fraxamo has quit [Quit: Leaving]
kajo has joined #lisp
gilez has quit [Quit: Lost terminal]
robdog has joined #lisp
mindCrime_ has quit [Ping timeout: 250 seconds]
<aeth>
This leads to an interesting result. You can't (coerce 3.0 'integer) and you can't even sb-mpfr:coerce straight to an integer, but you can (sb-mpfr:coerce (sb-mpfr:coerce 3.0 'sb-mpfr:mpfr-float) 'integer)
warweasle has quit [Quit: rcirc on GNU Emacs 24.4.1]
<aeth>
(Yes, you should pick a rounding function like #'floor in reality. The above is not intended to be good code.)
robdog has quit [Ping timeout: 268 seconds]
gxt has joined #lisp
jxy has joined #lisp
<Younder>
floor is not rounding is it. It is truc if > 0 and trunc -1 is z 0
<Younder>
As far as I am corcerened there are two types of round scientists round and bankers round. Scientists round .5 up. bankers .5 either up or down depending on weather the next digit is odd or even.
<aeth>
Of course, you can write your own rounding function with truncate or floor and use the 2nd value as you want to.
<aeth>
(or ceiling, obviously)
jkordani_ has quit [Read error: Connection reset by peer]
<dim>
beach: before I forget, whenever you get around to it, I've been told earlier this week about the http://www.graalvm.org project and it might be interesting enough for you to target that with SICL/Cleavir! it's like an alternative to clasp maybe, too
<zch>
Are there any good examples of web applications entirely using Common Lisp. From the backend to front-end (with parenscript)?
mejja has joined #lisp
<dim>
zch: I have done a couple that are simple enough and not using parenscript, check out pgcharts for starts maybe? https://github.com/dimitri/pgcharts
<zch>
Thank you
emar has quit [Ping timeout: 268 seconds]
scymtym has joined #lisp
<malice_>
dim: that's an interesting thing, thanks!
jxy has quit [Quit: leaving]
LiamH has quit [Quit: Leaving.]
jxy has joined #lisp
permagreen has joined #lisp
zch has quit [Quit: Leaving]
zch has joined #lisp
zch has quit [Client Quit]
zch has joined #lisp
zch has quit [Client Quit]
zch has joined #lisp
knicklux has quit [Remote host closed the connection]
orivej has quit [Ping timeout: 268 seconds]
random-nick has quit [Ping timeout: 250 seconds]
emdeesee has quit [Quit: ERC Version 5.3 (IRC client for Emacs)]
minion has quit [Remote host closed the connection]
minion has joined #lisp
fiddlerwoaroof has quit [Quit: Gone.]
fiddlerwoaroof has joined #lisp
oystewh has quit [Ping timeout: 245 seconds]
<jasom>
zch: I wrote a *bad* example of a web application using common lisp; it works, but I wouldn't necessarily suggest it as a shining beacon of design.
robdog has joined #lisp
<zch>
jasom: Well, I was trying to show a fellow that CL is probably fine for writing web applications, so perhaps a *bad* example would scare him off haha
<jasom>
also it uses mongrel2 as the webserver, which is both unusual and not in quicklisp
<jasom>
also the backend uses a key-value store because I didn't understand sql at the time
zch has quit [Quit: Leaving]
robdog has joined #lisp
<jasom>
Actually, now that I think about it, it should work with other clack backends, but the mongrel2 clack backend supports per-worker-thread bindings, which I take advantage of for having 1 persistent DB connection per worker. If anyone knows how to get that to work with e.g. hunchentoot, let me know.
robdog has quit [Remote host closed the connection]
robdog has joined #lisp
<jasom>
It also uses an NIH half-assed object system that is portable between parenscript and CL.