<Bike>
"We would either have to get the implementors to implement it or explainwhy we put this thing in the language that everyone refuses to implement."
orivej_ has joined #lisp
orivej has quit [Ping timeout: 245 seconds]
<drmeister>
I've got some code where I invoke MAKE-INSTANCE and it's returning NIL. I'm not sure how that could be.
<gabbiel>
generic-flet and generic-labels are self describing, what did they mean that nobody understood them
<Bike>
well, what they're for. also whether it was dynamic or lexical.
<drmeister>
It's a little harder to initialize :%view properly from the command line.
<White_Flame>
gabbiel: my 2nd message was about compile-time optimization, as many languages like C++ do. Even though the declarations and usages would be in a single lexical scope, it would still leave resolution to runtime
<gabbiel>
Bike: flet is lexical, yes, so generic-flet should be lexical as well
<Bike>
and the methods?
<Bike>
i mean fundamentally what's the point of defining a generic function all at once? might as well just have a typecase body
awolven has joined #lisp
jiny has joined #lisp
<gabbiel>
White_Flame: but what exactly did you mean, regarding generic-flet/labels, that it would inhibit compile time optimization?
verisimilitude has left #lisp ["ERC (IRC client for Emacs 24.5.1)"]
<White_Flame>
I don't know for what purpose you want this, so I brought up an assumptive scenario
<gabbiel>
Bike: I'd wager generic-flet/labels was for defining methods, since methods already imply generic functions
<Bike>
what?
<Bike>
you said that generic-flet is self describing but i really have doubts about that
<White_Flame>
if you build generic-flet on top of gensym-named standard defmethods, it woudl perform the same and not take advantage of any lexical stuff
<White_Flame>
whereas labels & flet, being contained with their usage, can do certain deeper optimizations
<pjb>
The problem is that method dispatching is not done lexically, but dynamically.
<pjb>
There would be no point of defining a method lexically, thus masking another method defined on the same classes, since calling the generic function could occur outside of the lexical scope, and would still have to dispatch to the outside method!
<White_Flame>
pjb: the intent would be not to leak the GF at all
<pjb>
At most, what you can do, is to bind methods dynamically, ie. temporarily. You can do that with find-method, add-method and remove-method.
<pjb>
White_Flame: still.
<Lycurgus>
leak the GF
<pjb>
White_Flame: the point is that there's no point. Just write a normal function.
<White_Flame>
I believe the point would be to use the class-based dispatch mechanism in local functions
<Lycurgus>
well the great thing is you get to make whatever point u want!
<gabbiel>
White_Flame: I see, your point is that impleneting generic-flet through gensyms would not allow for the optimizations that flet/labels have.
<Lycurgus>
which might be the reason the object system isn't more widely used
<White_Flame>
gabbiel: however, if you're planning on using EQL discriminators in your functions, instead of class-based, you could also try using a matcher library
<White_Flame>
for erlang-style matching branch clauses
<gabbiel>
Bike: maybe call it mflet or mlabels
<Bike>
i still don't understand what the point of this is.
<Bike>
i can kind of understand dynamically adding and removing methods, which is i think what with-added-methods was, but then there's not much point doing it as a special operator
<Bike>
and you're not actually binding any function names
lemoinem has quit [Killed (moon.freenode.net (Nickname regained by services))]
lemoinem has joined #lisp
djeis[m] has joined #lisp
sciamano has joined #lisp
iarebatman has joined #lisp
eriix[m] has joined #lisp
LdBeth has joined #lisp
dtw has joined #lisp
Jachy has joined #lisp
liambrown has joined #lisp
nonlinear[m] has joined #lisp
katco has joined #lisp
munksgaard[m] has joined #lisp
no-defun-allowed has joined #lisp
keep-learning[m] has joined #lisp
malaclyps[m] has joined #lisp
Godel[m] has joined #lisp
hiq[m] has joined #lisp
<gabbiel>
bike: the point is to think about what it would mean to have lexically bound methods
<Bike>
that wouldn't mesh at all with the entire rest of clos
<pjb>
exactly.
<Bike>
a generic function is an object with a state, such as what methods it has. to "lexically bind" one, you'd be making a new generic function and copying that state and also adding methods
<White_Flame>
for this to meaningfully work, it would probably want its methods to be statically defined to only teh source code clauses that are present in that scope?
<White_Flame>
like I said, imagine a set of LABELS functions that can use multimethod dispatch in their parameters
<White_Flame>
s/in/using/ :-P
<gabbiel>
so im really just restricted to typecasing and using flet?
<Bike>
yes. i don't understand what more you want.
<Bike>
you could give it a more method-like syntax but still make a normal function
<pjb>
White_Flame: for this to work, you would have to justify having a different dispatch between calls to the generic function inside the lexial scope vs. outside of it.
<pjb>
White_Flame: this is very hard to justify when you understand what an object is.
<White_Flame>
right, this would remove the "objectness" of the GF
<White_Flame>
but in exchange, expose parameter-based dispatch to local functions
<pjb>
Ah! So this is what you want, parameter based dispatch!
<pjb>
Or just pattern matching cases.
semz has quit [Ping timeout: 264 seconds]
<White_Flame>
I don't know if that's what gabbiel wants, because they never actually stated any intention, but that was my assumption, which I did specifically list multilpe times as a supposed rationale
<Bike>
yes, having an idea of what's actually wanted would help
<pjb>
White_Flame: it's probably better to have a macro implementing it independently from function calls.
<White_Flame>
pjb: which is what I said about constructing a gensym-named GF that's only locally known
<pjb>
Something like (dispatch-case (a b c) (((a integer) (b integer) (c string)) …) (((a integer) (b string) (c string)) …) …)
hiroaki has quit [Ping timeout: 245 seconds]
<gabbiel>
that macro seems nice, but are those flet like or labels like bindings?
semz has joined #lisp
Lycurgus has quit [Quit: Exeunt]
kajo has quit [Ping timeout: 252 seconds]
kajo has joined #lisp
Kaisyu7 has quit [Quit: ERC (IRC client for Emacs 26.2)]
learning has joined #lisp
orivej_ has quit [Ping timeout: 252 seconds]
aeth has joined #lisp
scottj has joined #lisp
igemnace has joined #lisp
Oladon has quit [Quit: Leaving.]
Kaisyu7 has joined #lisp
jiny has quit [Ping timeout: 250 seconds]
xkapastel has joined #lisp
igemnace has quit [Quit: WeeChat 2.5]
igemnace has joined #lisp
kajo has quit [Ping timeout: 264 seconds]
kajo has joined #lisp
alexande` has joined #lisp
alexanderbarbosa has quit [Remote host closed the connection]
seok has quit [Ping timeout: 260 seconds]
seok36 has quit [Ping timeout: 260 seconds]
ahungry has joined #lisp
<pjb>
gabbiel: it doesn't matter, because the dispatching clause should be exclusive.
learning has quit [Remote host closed the connection]
Bike has quit [Quit: Lost terminal]
torbo has quit [Remote host closed the connection]
EvW has joined #lisp
gabbiel has quit [Read error: No route to host]
ahungry has quit [Remote host closed the connection]
ahungry has joined #lisp
ahungry has quit [Ping timeout: 245 seconds]
ahungry`` has joined #lisp
Oladon has joined #lisp
kajo has quit [Ping timeout: 264 seconds]
kajo has joined #lisp
dddddd has quit [Remote host closed the connection]
EvW has quit [Ping timeout: 250 seconds]
ahungry`` has quit [Ping timeout: 246 seconds]
jonatack has quit [Ping timeout: 252 seconds]
<beach>
Good morning everyone!
7GHABM53V has joined #lisp
karlosz has joined #lisp
poet has quit [Ping timeout: 264 seconds]
nanoz has joined #lisp
7GHABM53V has quit [Ping timeout: 245 seconds]
gravicappa has joined #lisp
jeosol has quit [Remote host closed the connection]
jeosol has joined #lisp
gabbiel has joined #lisp
gabbiel has quit [Ping timeout: 264 seconds]
alexande` has quit [Ping timeout: 245 seconds]
Oladon has quit [Ping timeout: 245 seconds]
Folkol has joined #lisp
<beach>
As a person reading some code written by a different person, how do you react when you see (DEFVAR <var>) and when you see (DEFPARAMETER <var> NIL)?
<no-defun-allowed>
Are you referring to those exact forms, or (def{var,parameter} <var>) against (def{var,parameter} <var> nil)?
<White_Flame>
(defparameter <var> nil) is correct, as it should be defining a parameter value
gabbiel has joined #lisp
<White_Flame>
defvar is optional, filled in either from config defaults, or established in thread-local bindings
<White_Flame>
*defvar's value is optional...
<no-defun-allowed>
Oh, as in both in the same codebase. I agree pretty much what White_Flame said.
<White_Flame>
in fact, a defvar initial value is often problematic, as it makes it harder to restart the code without cycling the image
<White_Flame>
if it's a stateful thing, which it often is
<no-defun-allowed>
(defvar <var>) would be used if the variable changes some behaviour which has a default that isn't well expressed as a variable, such as if it was the same as another variable by default.
gabbiel has quit [Ping timeout: 245 seconds]
<beach>
no-defun-allowed: Those exact forms.
gabbiel has joined #lisp
<beach>
White_Flame: So, like me, you think that the initial value of the DEFPARAMETER form is going to be used.
<beach>
?
<White_Flame>
that's what defparameter literally is for
<White_Flame>
to provide a paramater value from the source code into the running program
<White_Flame>
that can be changed at the source code level
<beach>
Thank you.
<White_Flame>
and reloaded to invoke
<beach>
So for a variable that is always going to have a thread local binding for the code to work properly, DEFVAR with no initial value is the right thing.
<White_Flame>
I would consider setf'ing a defparameter to be something wrong
<beach>
sort of...
<beach>
SETF-ing it before it is used would be wrong.
<White_Flame>
beach: DEFVAR also should have no initial value if init code is going to set it up, and things shouldn't run until that init finishes
<beach>
It all sounds very reasonable, and I agree.
<beach>
For what it's worth, (LET (<var>) ... ) sends the same signal to me as (DEFVAR <var>) does, i.e. that the variable is going to be assigned to/bound before being used.
<beach>
The semantics are different, of course.
<White_Flame>
yeah, though I presume that's a rare case in idiomatic lisp
<beach>
Sure. But I have seen it in macro expansions.
<White_Flame>
ah, yeah that would make sense
<beach>
More importantly, I don't want to see (LET (<var>) .. (push ... <var>))
<beach>
<White_Flame>
right, assumption of teh implicit NIL, as opposed to (LET ((var NIL) ..) ..)
<beach>
Two pieces of information clash here. (LET (<var>) says "will be assigned before it is used, and (PUSH ... <var>) uses it before it is assigned to.
<beach>
Exactly.
* beach
replaces some (DEFPARAMETER <var> NIL) by (DEFVAR <var>) in some Cleavir code.
<beach>
Using `git blame', I can confirm my suspicion that I myself was the author of that DEFPARAMETER form half a decade or so ago.
<White_Flame>
heh
Kevslinger has quit [Quit: Connection closed for inactivity]
gabbiel has quit [Ping timeout: 258 seconds]
<beach>
Maybe it is time for me to write a separate style guide, as opposed to having a chapter in each document I write.
<beach>
Such a style guide would contain, for each recommendation, a discussion of the reason for it, references to other documents like the Common Lisp HyperSpec, the LUV slides, etc., and also references to code bodies respecting or violating the recommendation.
<beach>
... and alternatives, as in the slot-naming convention.
anewuser has joined #lisp
<beach>
Another reason for writing such a style guide is that I often repeat the same remarks whenever an inexperienced person comes here and exposes inexperienced-person code for #lisp participants to remark on. I could even teach one of our bots to show links to different sections as a result of some keyword, like <bot>: please tell <inexperienced-person> about slot-naming.
dale has quit [Quit: My computer has gone to sleep]
gabbiel has joined #lisp
vlatkoB has joined #lisp
flamebeard has joined #lisp
karayan has joined #lisp
AndrewYoung has joined #lisp
varjag has joined #lisp
karayan has quit [Ping timeout: 258 seconds]
<beach>
Actually, I like the idea of a separate style guide. I haven't done it in the past, because some of my recommendations are not universally required, so they seemed to have no place in a separate style guide. But if each recommendation has alternatives, and a discussion related to the reason for its existence, references to people and code, etc., then such recommendations could very well fit into a separate style guide.
cosimone has quit [Remote host closed the connection]
cosimone has joined #lisp
FreeBirdLjj has joined #lisp
<d4ryus>
hi, when I try to run a dumped image (dumped via asdf:make) on another machine it does not work because it tries to load asdf. I also get a strange warning: https://pastebin.com/7pCBuUSg
<Xach>
my first loop conformance bug with sicl loop!
EvW has joined #lisp
<d4ryus>
The asdf version installed in ~/common-lisp/asdf/ is 3.3.3.3, sbcl version is 1.5.6.29-12fd1b3bc . Anyone a idea or any leads what i did wrong?
<thijso>
https://www.cliki.net/cffi-udp contains a link to a 'homepage', but that gives a server not found error. Google doesn't really provide anything either. Has cffi-udp just vanished? I've found a link to a git repo, but that's on the same server as the homepage, so no-go...
<PuercoPop>
Is there a way to 'right align' the output of a format directive? Or something along the lines of insert as many spaces to move to column 70. The ~T directive seems to be almost what I want?
<pjb>
or qualify it in ~/my-formatters:right-align/
<antepod>
Is it possible- be it through macros, functions or otherwise- to have an expression you could put into a &key argument list so that it evaluates to , say, :color 'red for one condition, and a blank space for another?
<pjb>
antepod: nope.
<pjb>
antepod: lisp sources are not text. You cannot put "blank spaces" there.
<antepod>
pjb: 'blank spaces' was a bit informal, I admit.
<antepod>
pjb: So the only way is to wrap the whole expression, function and all? Pity; it would be interesting if there was a way for a language to 'reach back' up the chain, but I'm not sure what it would look like.
<antepod>
Thanks for the help, anyway.
<pjb>
antepod: It depend on when the one-condition is known.
<pjb>
antepod: this solution is when it's known at run-time.
<pjb>
antepod: if you know it at compilation-time, then you can use a macro, or even a reader-macro.
<antepod>
But of course, `,@(:color 'red) isn't valid, because you can't 'return' two atoms.
<antepod>
Unless you're using 'values', but that defeats the whole point of nicety.
mindCrime_ has joined #lisp
smazga has joined #lisp
<pjb>
antepod: this is what prevents sexp-injections in lisp!
<pjb>
antepod: of course, it's very sad, because since lisp has been correctly designed from the start, (macros since 1964!) you cannot write PhD dissertations anymore on how to avoid code injection in lisp. But don't worry, you can still get a PhD disserting about sql-injections…
<antepod>
pjb: Huh. I guess I am asking to inject-attack my own code as a feature. Strange.
sjl_ has joined #lisp
cmatei has joined #lisp
ikki has joined #lisp
<antepod>
pjb: though code injection's still perfectly possible in lisp... Just read and evaluate user input, expecting the user to supply a "string". I'm sure some newbie, somewhere, has done it. Hell, I think there's a chapter in practical common lisp whose code would allow for that sort of attack.
sauvin has quit [Ping timeout: 245 seconds]
<pjb>
antepod: yes, but it's controlled. You need to do it explicitely.
<edgar-rft>
what I find more frightenining is that according to pjb macros can expand into old cruft from 1964
<pjb>
antepod: since there are no parentheses in lisp code, you cannot close a parenthesis, and re-open one to make a new expression like in sql…
eagleflo has quit [Remote host closed the connection]
<pjb>
edgar-rft: you can run programs from 1960 on CL !
Achylles has quit [Remote host closed the connection]
<antepod>
pjb: Yes, I suppose having two layers of logic (text I/O, AST internals) helps. But isn't the problem with SQL injection that the system's essentially eval'ing whatever you give it?
<pjb>
antepod: no, it comes from the textual concatenation to build expressions.
eagleflo has joined #lisp
jprajzne has quit [Quit: Leaving.]
schweers has joined #lisp
seok has joined #lisp
<seok>
Hello, anybody recognise this data format? ((36 52192 0 1 8 0 0 0 "system.namespaces") NIL)
<seok>
I was expecting it to be a BSON but I cannot decode it
<schweers>
I have a piece of software which /should/ use only a pretty small amount of memory, yet uses quite a lot. The process gets a huge heap, but shouldn’t use much of it at this stage. Is there a good way to find out where this memory is being used? I’m using sbcl, but it my code should also work on ccl.
vaporatorius has joined #lisp
vaporatorius has quit [Read error: Connection reset by peer]
<mfiano>
Xach: (hopefully) pushed a fix just guessing at the error message.
<pjb>
seok: it looks like an oid followed by a string. This could come from decoding some ASN.1
<pjb>
schweers: you can start with (room t). On some implementation it reports the memory used by type of object, which is a good hint.
<schweers>
Yeah, I know about that, and I’m going to try it, but I don’t assume that it’s going to help much. Now that I’ve asked the question, I’m wondering if the profiler might help.
rippa has joined #lisp
schjetne has joined #lisp
edgar-rft has quit [Quit: Leaving]
<semz>
Has there been work on using conditions/restarts to do proper OOM handling?
chipolux has joined #lisp
<pjb>
semz: there was a blog, but it disappeared: https://groups.google.com/forum/#!search/group$3Acomp.lang.lisp$20out$20of$20memory$20condition/comp.lang.lisp/NL393lKKpBY/2eBe2LPNHq8J
<pjb>
Perhaps it's time to realize that blogs are dumb, and published scientific paper are more perennial?
eagleflo has quit [Remote host closed the connection]
<pjb>
Of course, 11 years later, implementations have changed… You'd have to try them all again.
EvW has joined #lisp
varjag has quit [Quit: ERC (IRC client for Emacs 25.2.2)]
<semz>
I unfortunately doubt that the situation on Linux has changed, Unix folks seem to like the (batshit insane) overcommitting situation.
<semz>
But thanks pjb, even if it turns out to be a purely academic exercise this pointer is helpful.
Kevslinger has joined #lisp
q9929t has joined #lisp
nostoi has joined #lisp
eagleflo has joined #lisp
orivej has quit [Ping timeout: 244 seconds]
LiamH has joined #lisp
q9929t has quit [Quit: q9929t]
akovalenko has joined #lisp
learning has quit [Remote host closed the connection]
orivej has joined #lisp
nostoi has quit [Quit: Verlassend]
protokaryote has joined #lisp
shifty has quit [Ping timeout: 245 seconds]
flip214 has quit [Read error: Connection reset by peer]
flip214 has joined #lisp
varjag has joined #lisp
<dim>
well if you want to push the SBCL garbage collection you can play with pgloader; bonus point if you can fix the situation...
<dim>
I continue receiving bug reports from users who are experiencing the heap exhausted, game over message and don't know what to do about it ; where CCL usually is just fine, just slower... well much slower
<Xach>
mfiano: thanks
hhdave has quit [Quit: hhdave]
schjetne has quit [Ping timeout: 245 seconds]
vyorkin has quit [Ping timeout: 258 seconds]
sauvin has joined #lisp
gravicappa has quit [Ping timeout: 264 seconds]
drot has joined #lisp
protokaryote has quit [Quit: protokaryote]
awolven has joined #lisp
EvW has quit [Ping timeout: 250 seconds]
learning has joined #lisp
xkapastel has joined #lisp
_whitelogger has joined #lisp
vaporatorius has joined #lisp
vaporatorius has quit [Changing host]
vaporatorius has joined #lisp
Insanity_ has quit [Quit: Connection closed for inactivity]
Oladon_work has joined #lisp
ravenous_ has joined #lisp
cosimone has quit [Quit: Leaving]
ggole has quit [Quit: Leaving]
makomo has quit [Quit: WeeChat 2.4]
ravenous_ has quit [Ping timeout: 252 seconds]
antepod has quit [Quit: WeeChat 2.3]
whartung has quit [Remote host closed the connection]
whartung has joined #lisp
<aeth>
The most surprising thing about that article is how small those (2008) numbers are in just 11 years. "out of a total of 500 MB of RAM" for instance. That's Rasperry Pi 1 (2012) levels, while I'd assume today most people are using 8-64 GB. Even back then, I think 1-4 GB would've been more normal? Iirc, I had 8 GB in 2010.
kamog has quit [Read error: Connection reset by peer]
schjetne has joined #lisp
spoeplau has quit [Ping timeout: 246 seconds]
schjetne has quit [Ping timeout: 246 seconds]
cosimone has joined #lisp
EvW has joined #lisp
awolven has quit [Ping timeout: 245 seconds]
<aeth>
It's weird that SBCL's limit is only 1 GB by default. Is whatever it's set at preserved when doing s-l-a-d? Because if it was a desktop application (like a web browser), then sb-ext:dynamic-space-size should depend on the user's machine, not the build machine.
Kevslinger has quit [Quit: Connection closed for inactivity]
edgar-rft has joined #lisp
ravenous_ has joined #lisp
EvW has quit [Ping timeout: 250 seconds]
vyorkin` has joined #lisp
<pjb>
aeth: 32-bit vs. 64-bit.
sauvin has quit [Read error: Connection reset by peer]
warweasle has quit [Quit: rcirc on GNU Emacs 24.4.1]
vlatkoB has quit [Remote host closed the connection]
cosimone has quit [Quit: Leaving]
EvW has joined #lisp
gravicappa has joined #lisp
kajo has quit [Ping timeout: 276 seconds]
gravicappa has quit [Ping timeout: 264 seconds]
awolven has joined #lisp
mindCrime__ has joined #lisp
kajo has joined #lisp
cosimone has joined #lisp
mindCrime_ has quit [Ping timeout: 245 seconds]
cartwright has joined #lisp
cantstanya has quit [Ping timeout: 260 seconds]
nanoz has quit [Ping timeout: 264 seconds]
Ven`` has joined #lisp
cosimone has quit [Remote host closed the connection]
cosimone has joined #lisp
Ven`` has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
davr0s_ has joined #lisp
davr0s has joined #lisp
xkapastel has quit [Quit: Connection closed for inactivity]
ikki_ has joined #lisp
ikki has quit [Ping timeout: 245 seconds]
learning has quit [Ping timeout: 246 seconds]
learning has joined #lisp
ikkitousen has joined #lisp
bradfonseca has quit [Quit: Konversation terminated!]
ikki_ has quit [Ping timeout: 245 seconds]
cosimone has quit [Quit: Leaving]
amerlyq has quit [Quit: amerlyq]
iovec has joined #lisp
elderK has quit [Read error: Connection reset by peer]
ravenous_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]