jackdaniel changed the topic of #commonlisp to: Common Lisp, the #1=(programmable . #1#) programming language | Wiki: <https://www.cliki.net> | IRC Logs: <https://irclog.tymoon.eu/libera/%23commonlisp> | Cookbook: <https://lispcookbook.github.io/cl-cookbook> | Pastebin: <https://plaster.tymoon.eu/> | News: ELS'22 this Monday (2022-03-21), see https://european-lisp-symposium.org
akoana has quit [Quit: leaving]
zacque has joined #commonlisp
kpoeck has quit [Quit: Client closed]
Madsy has joined #commonlisp
ebrasca has quit [Remote host closed the connection]
ec has quit [Remote host closed the connection]
jeosol has joined #commonlisp
even4void has quit [Quit: fBNC - https://bnc4free.com]
slowButPresent has quit [Quit: arg]
yauhsien has joined #commonlisp
yauhsien has quit [Ping timeout: 248 seconds]
Guest74 has joined #commonlisp
agrosant has quit [Quit: Leaving]
Madsy has quit [Ping timeout: 260 seconds]
szkl has joined #commonlisp
even4void has joined #commonlisp
slowButPresent has joined #commonlisp
Bike has quit [Quit: Connection closed]
causal has quit [Quit: WeeChat 3.5]
dtman34 has joined #commonlisp
knusbaum has quit [Ping timeout: 276 seconds]
istewart has joined #commonlisp
istewart has quit [Quit: Konversation terminated!]
knusbaum has joined #commonlisp
shka has quit [Read error: Connection reset by peer]
shka has joined #commonlisp
<beach> Good morning everyone!
yauhsien has joined #commonlisp
yauhsien has quit [Ping timeout: 240 seconds]
aartaka has joined #commonlisp
hhhh92 has joined #commonlisp
Bike has joined #commonlisp
hhhh92 has quit [Remote host closed the connection]
<semz> good morning
yagamisato has quit [Ping timeout: 256 seconds]
yagamisato has joined #commonlisp
yagamisato has quit [Changing host]
yagamisato has joined #commonlisp
Madsy has joined #commonlisp
yauhsien has joined #commonlisp
semz_ has joined #commonlisp
semz has quit [Ping timeout: 260 seconds]
yauhsien has quit [Remote host closed the connection]
yauhsien has joined #commonlisp
yauhsien has quit [Ping timeout: 260 seconds]
Madsy has quit [Ping timeout: 260 seconds]
Bike has quit [Quit: Connection closed]
Guest27 has joined #commonlisp
yauhsien has joined #commonlisp
yauhsien has quit [Ping timeout: 240 seconds]
jmes has quit [Remote host closed the connection]
Inline has quit [Quit: Leaving]
tyson2 has quit [Read error: Connection reset by peer]
slowButPresent has quit [Quit: sleep]
yauhsien has joined #commonlisp
yauhsien has quit [Ping timeout: 248 seconds]
semz_ is now known as semz
Guest27 has quit [Ping timeout: 252 seconds]
rotateq has quit [Ping timeout: 260 seconds]
Inline has joined #commonlisp
yauhsien has joined #commonlisp
aartaka has quit [Ping timeout: 240 seconds]
borodust has quit [Ping timeout: 276 seconds]
aartaka has joined #commonlisp
asarch has joined #commonlisp
<asarch> One stupid question: how would be better? Using flet (let (a b c) (flet ((foo (bar) …) (baz (spam) …)) …)) or with defun (let (a b c) (defun foo (bar) …) (defun baz (spam) …) …) and why?
<asarch> I think it would better with defun because you could use foo immediately in baz, right?
<beach> It is always best to limit the scope of your definitions as much as possible, so if the functions are used only locally, then FLET is better.
<beach> You can use LABELS if you want the functions to refer to each other.
<beach> Or nested FLETS if one is referring to the other, but not the other way around.
<beach> You want to limit the scope, so that the person reading your code does not have too keep too much information in mind when reading your code. With limited scope, that person can quit thinking about FOO and BAZ whenever the scope of the FLET or LABELS ends.
<jackdaniel> this is a good illustration that labels to flet is not what let* to let is
<jackdaniel> s/labels/LABELS/ s/flet/FLET/ s/let/LET/
<beach> asarch: This is a general rule of programming, so if you know how to program in any other language, I am sure you have heard about it.
<Inline> let* is the parallel variant
<jackdaniel> Inline: ?
<Inline> labels is the recursive variant
<beach> Inline: That makes no sense whatsoever.
<Inline> parallel and recursive as synonyms ? how can one confuse those ?
<asarch> Is there a way to declare variables and also functions? I remember PROG could that (but I can't find my annotation)
<jackdaniel> no, LET* is "nested LET", while LABELS is "shared scope for function names" for lack of a better description at hand
<beach> asarch: What do you mean by "declare variables and also functions"? And why do you need to declare them?
<asarch> (prog (a b c (foo (bar) …) (baz (spam) …))
<asarch> More or less
Guest27 has joined #commonlisp
<Inline> with let* you can make one variable depend on another previously defined one...
<beach> asarch: I don't know what you mean by that form, and you didn't answer my question.
<jackdaniel> Inline: and what's
<jackdaniel> parallel with that?
<Inline> no idea, i've read parallel in combination with let* somewhere in my resources
<asarch> I mean, to define functions and declare variables
<beach> asarch: You are still not answering my question. So I guess I give up.
<jackdaniel> Inline: perhaps stating things that you are not sure about yourself is not that of a good idea, it may confuse others
<Inline> maybe they meant wrt to syntax and not the implementation
<edgar-rft> CLHS says that "defun is not required to perform any compile-time side effects" what means it can happen that the outer defun is not established when the inner code (calling the outer function) is compiled and you'll get a "funtion not found" error when compiling the code.
<asarch> 1: (let (a b c) …) and 2: (flet ((foo (bar) …) (baz (spam) …)) …). Right?
<asarch> Is there a way to combine both "operations"?: E.g.: (some-exp (a b c ((foo (bar) …) (baz (spam) …))) …)?
<jackdaniel> asarch: it is called binding
<asarch> Can you do that?
<jackdaniel> and no, common lisp standard does not propose any operator that would allow mixing binding variables and functions
<jackdaniel> although writing such macro would be rather trivial
<jackdaniel> not that it would be very useful
<asarch> I see
<asarch> Thank you guys, thank you very much :-)
<beach> asarch: If you had answered my question, we would have understood that your terminology ("declare") was wrong (you apparently meant "bind"), and we would have been more efficient in the future. As it is, you will probably continue using the wrong terminology and waste time (mostly your own, but also ours).
<Nilby> of course the spec says "let performs the bindings in parallel", so Inline was saying something reasonable, but mixing up let - parallel binding vs. let* - sequential binding
yauhsien has quit [Remote host closed the connection]
yauhsien has joined #commonlisp
<asarch> Yeah, sorry for that :-(
<Inline> i'm sorry too
<Inline> was not intending to confuse....
<asarch> Cheers! o/
Madsy has joined #commonlisp
dre has left #commonlisp [Leaving]
yauhsien has quit [Ping timeout: 240 seconds]
Cymew has joined #commonlisp
<asarch> Anyway. Have a nice day :-)
asarch has quit [Quit: Leaving]
semz has quit [Quit: Leaving]
semz has joined #commonlisp
rotateq has joined #commonlisp
attila_lendvai has joined #commonlisp
GreaseMonkey has quit [Remote host closed the connection]
yauhsien has joined #commonlisp
kiki_lamb has quit [Ping timeout: 276 seconds]
yauhsien has quit [Ping timeout: 240 seconds]
kiki_lamb has joined #commonlisp
kiki_lamb has quit [Ping timeout: 240 seconds]
kiki_lamb has joined #commonlisp
kiki_lamb has quit [Ping timeout: 240 seconds]
kiki_lamb has joined #commonlisp
schjetne has quit [Ping timeout: 252 seconds]
kiki_lamb has quit [Ping timeout: 260 seconds]
random-nick has joined #commonlisp
schjetne has joined #commonlisp
kiki_lamb has joined #commonlisp
aartaka has quit [Ping timeout: 240 seconds]
kiki_lamb has quit [Ping timeout: 260 seconds]
aartaka has joined #commonlisp
azimut_ has joined #commonlisp
azimut has quit [Ping timeout: 240 seconds]
yauhsien has joined #commonlisp
kiki_lamb has joined #commonlisp
yauhsien has quit [Ping timeout: 248 seconds]
kiki_lamb has quit [Ping timeout: 260 seconds]
waleee has quit [Ping timeout: 252 seconds]
waleee has joined #commonlisp
kiki_lamb has joined #commonlisp
szkl has quit [Quit: Connection closed for inactivity]
kiki_lamb has quit [Ping timeout: 240 seconds]
lonjil has quit [Quit: No Ping reply in 180 seconds.]
<Mrtn[m]> <kaskal> "dbotton do not answer to..." <- How did you arrive at the conclusion that horroar is a troll?
lonjil has joined #commonlisp
<beach> Mrtn[m]: The way a participant was referred to.
varjag has joined #commonlisp
<Mrtn[m]> beach: I think I am missing some of the history, and it seems that @horroar:libera.chat already left (not sure if he got help).
<jackdaniel> I've helped him, no worries
<beach> Mrtn[m]: You can search the history on tymoon.eu.
kiki_lamb has joined #commonlisp
<Mrtn[m]> jackdaniel: That is very kind of you. I am guessing the "tl;dr" is that it turned out he wasn't really interested in CLOG after all, he just wanted to demonstrate how obnoxious he was.
kiki_lamb has quit [Ping timeout: 248 seconds]
<Mrtn[m]> (Cloudfare wont let me access tymoon eu at the moment).
<Mrtn[m]> Cloudflare*
<jackdaniel> yes, that's the gist of it.
kiki_lamb has joined #commonlisp
<jackdaniel> (and no, I wasn't a model figure of a kind person;p)
<Mrtn[m]> :)
Inline has quit [Quit: Leaving]
kiki_lamb has quit [Ping timeout: 248 seconds]
Inline has joined #commonlisp
xaotuk has joined #commonlisp
<kaskal> Mrtn[m] because I am an owner of a brain and a common sense, anyways we should ignore this, this is exactly what trolls want
<Mrtn[m]> kaskal: I probably lack some history. I only saw him asking for the maintainer of CLOG before your remark. However, given some of the later history, which I read after replying, it is obvious that you arrived at the correct conclusion.
yauhsien has joined #commonlisp
kiki_lamb has joined #commonlisp
yauhsien has quit [Remote host closed the connection]
yauhsien has joined #commonlisp
kiki_lamb has quit [Ping timeout: 240 seconds]
yauhsien has quit [Ping timeout: 240 seconds]
attila_lendvai has quit [Ping timeout: 240 seconds]
kiki_lamb has joined #commonlisp
Inline has quit [Quit: Leaving]
kiki_lamb has quit [Ping timeout: 248 seconds]
Inline has joined #commonlisp
yauhsien has joined #commonlisp
imjim has quit [Quit: I quit.]
yauhsien has quit [Remote host closed the connection]
Madsy has quit [Ping timeout: 240 seconds]
kpoeck has joined #commonlisp
lisp123 has joined #commonlisp
<lisp123> What would be a minimal (i.e. easier to implement) subset of Common Lisp that one can embed in other languages?
<lisp123> I assume take CLOS out, keep macros in - but keen to get thoughts on what would be a good subset.
kiki_lamb has joined #commonlisp
<mfiano> CLOS is too integrated into the core to take it out in my opinion.
<semz> Why not Scheme instead? What is the goal here?
<lisp123> semz: most use scheme for this, but I couldn't stand a lisp-1 and rather have more normal lisp syntax like defun
<lisp123> I'm doing something similar to GOAL at Naughty Dog :) I want to write in a subset of CL and then transpile to the host system's language
<rotateq> thought it was with Allegro CL
<lisp123> mfiano: CLOS would be too hard to implement :( I'm starting off from those simple scheme compilers like Norvig's lis.py and making it adaptable for CL
yauhsien has joined #commonlisp
<rotateq> lisp123: Just read AMOP :)
<lisp123> rotateq: TRUE, my memory got crosswired
<jackdaniel> lisp123: see what is defined cltl2 and chop unnecessary parts
<jackdaniel> then you will proudly claim that it is a common lisp implementation (although, pre-ansi one)
<jackdaniel> ,)
cosimone has joined #commonlisp
kiki_lamb has quit [Ping timeout: 252 seconds]
<rotateq> parts of (ported) things from GOAL still run afaik in newer NaughtyDog games like Last of Us
<lisp123> Oh that would be cool ;) And I could publish it as a new language (I'm joking here! ;)
<lisp123> rotateq: Nice
<lisp123> mfiano: thanks that one is much better
<mfiano> jscl is pretty horrible. easy to crash your tab with bad read-time evaluation
<semz> used it before; still pretty alpha stage. they didn't even have proper bignums last time i checked
yauhsien has quit [Ping timeout: 248 seconds]
<lisp123> I see
yauhsien has joined #commonlisp
Sankalp has quit [Ping timeout: 256 seconds]
lisp123 has quit [Remote host closed the connection]
<semz> ...neither does JSLisp apparently. What's the point of compiling to Javascript if you're just going to import the broken JS semantics anyway? :/
<jackdaniel> because it seems like a fun project?
<semz> that's less an answer than it is a refusal to answer, isn't it
<jackdaniel> not really, some things are done because authors find them fun to work on, not because they want to fix broker JS semantics
yauhsien has quit [Remote host closed the connection]
<semz> do they decide on design choices by coinflip or what. i want to know what was behind the choice
<rotateq> throwing the inifinite sided dice
cosimone has quit [Remote host closed the connection]
lisp123mobile has joined #commonlisp
<jackdaniel> behind the choice that they have not yet imlemented bignums? or the choice that they are not pursuing fixing broken js semantics? in either case I don't know, you'd have to ask the author; but suggesting that there is no point in doing something because it is not aligned with someone else desires is interesting
<lisp123mobile> it’s quite fun to look at the differences between languages
kiki_lamb has joined #commonlisp
<lisp123mobile> i’m doing it in python but will use these JS versions as inspiration…plus i hate python (javascript is actually quite nice)
<semz> oh spare me the passive-aggressiveness
lisp123mobile has quit [Remote host closed the connection]
* jackdaniel spares semz some passive-aggressiveness
<jackdaniel> ,)
lisp123mobile has joined #commonlisp
<semz> much appreciated
yauhsien has joined #commonlisp
kiki_lamb has quit [Ping timeout: 240 seconds]
yauhsien has quit [Remote host closed the connection]
lisp123mobile has quit [Ping timeout: 240 seconds]
Inline has quit [Quit: Leaving]
yauhsien has joined #commonlisp
Sankalp has joined #commonlisp
yauhsien has quit [Ping timeout: 260 seconds]
Sankalp has quit [Ping timeout: 252 seconds]
kiki_lamb has joined #commonlisp
* edgar-rft wants a CL implementation in Python that compiles to JavaScript
<jackdaniel> easy satan
Sankalp has joined #commonlisp
kiki_lamb has quit [Ping timeout: 240 seconds]
Inline has joined #commonlisp
kiki_lamb has joined #commonlisp
<edgar-rft> Tom Almy still maintains XLISP PLUS (based on XLISP 2 by David Betz), a Lisp-2 interpreter without CLOS -> https://almy.us/xlisp.html
jmdaemon has joined #commonlisp
<semz> How much modern CL code would a lack of CLOS lock you out of?
yauhsien has joined #commonlisp
yauhsien has quit [Remote host closed the connection]
<edgar-rft> I don't think modern CL code will run on XLISP PLUS witout modifications.
yauhsien has joined #commonlisp
Guest27 has quit [Ping timeout: 252 seconds]
kiki_lamb has quit [Ping timeout: 260 seconds]
<edgar-rft> semz: the anwer is not so easy, because for example numbers in CL are a CLOS class but of course arithmetic can be implemented without CLOS.
<semz> Right, I meant it more along the lines of CLTL2 than rm -rf *clos*
yauhsien has quit [Ping timeout: 260 seconds]
<edgar-rft> GCL (GNU Common Lisp) was one of the last pre-ANSI implementations that didn't have CLOS for a very long time. Not sure if it's really 100% ANSI conform in 2022 -> https://savannah.gnu.org/projects/gcl/
Lord_of_Life has quit [Ping timeout: 252 seconds]
Lord_of_Life has joined #commonlisp
<semz> Hm, apparently GCL can still be built for CLTL1. Time for an experiment.
schjetne has quit [Ping timeout: 248 seconds]
<edgar-rft> GCL originally was written to run the Maxima computer algebra system on Windows, you might find more info in #maxima or here -> https://maxima.sourceforge.io/
zacque has quit [Quit: Goodbye :D]
kiki_lamb has joined #commonlisp
cage has joined #commonlisp
kiki_lamb has quit [Ping timeout: 248 seconds]
azimut_ has quit [Ping timeout: 240 seconds]
xaotuk has quit [Read error: Connection reset by peer]
kiki_lamb has joined #commonlisp
jmdaemon has quit [Ping timeout: 260 seconds]
<mfiano> Shower thought: A few languages use backticks for evaluation, such as Bourne-compatible shells. Maybe the parentheses aren't the sole factor of dissuading newcomers to Lisp syntax :)
xaotuk has joined #commonlisp
kiki_lamb has quit [Ping timeout: 240 seconds]
schjetne has joined #commonlisp
aartaka has quit [Ping timeout: 240 seconds]
Oddity has quit [Ping timeout: 252 seconds]
Sankalp has quit [Ping timeout: 252 seconds]
xaotuk has quit [Ping timeout: 252 seconds]
xaotuk has joined #commonlisp
tyson2 has joined #commonlisp
bitmapper has quit [Quit: Connection closed for inactivity]
Sankalp has joined #commonlisp
xaotuk has quit [Ping timeout: 260 seconds]
kiki_lamb has joined #commonlisp
<dirtcastle> I'm new to lisp. lispers really love lisp. emacs lovers love emacs so much. two projects called lem text editor and nyxt browser is going on. both are written in common lisp. when it comes to hackability and configurability , ppl tell lisp is the goto language for that. python too has an interpreter and repl. what makes lisp better.? would emacs be as successful as it is if it were to be written in some other language ?
<beach> dirtcastle: Python is not a language in that sense. It is a programming system. And it uses an interpreter, which makes it around 50 times slower than a good Common Lisp implementation like SBCL which uses a compiler.
<beach> dirtcastle: Common Lisp is homoiconic, which makes it good for things like macros.
<beach> dirtcastle: A language with complicated surface syntax basically can't do macros the right way.
kiki_lamb has quit [Ping timeout: 260 seconds]
Madsy has joined #commonlisp
igemnace has quit [Remote host closed the connection]
<yitzi> mfiano: I think that the parens are just a red herring. Just for fun, I calculated the percentage of braces and parens in Clasp C source code. Came out to 2.9%. For the lisp source in Clasp the percentage of parens was 5.3%. Yes its more, but is that really the reason? Its not like Lisp is 10-15% parens. The premise seems absurd to me.
<beach> dirtcastle: The Common Lisp surface syntax has a specified translation into a syntax tree, and the Common Lisp programmer knows that translations, so the syntax tree is what the Common Lisp programmer works with; not the surface syntax.
<jackdaniel> technically speaking cpython as a reference implementation is an interpreter, there were (and are) a few implementations that are compilers
<jackdaniel> pypy does jit compilation, cython transpiles to C/C++, Numba uses LLVM to produce machine code
<beach> dirtcastle: Python is not part of my expertise, so listen to others like jackdaniel for details about it.
aartaka has joined #commonlisp
kiki_lamb has joined #commonlisp
<jackdaniel> yitzi: did you count also {} and [] in C?
<beach> dirtcastle: Emacs would have to be written in a "dynamic programming language", by which I mean a language with semantics defined by incremental evaluation of forms, relative to some initial image, also known as an "interactive programming language".
<yitzi> jackdaniel: I counted () and {}. Let me add []
<beach> dirtcastle: The reason is that forms need to be evaluated after the application exists, like in additional modules. You can't do that in a static programming language, because the semantics are not defined that way. There are some ways of getting around that problem, using things like plugins, but they are not nearly as flexible as a Lisp evaluator.
<jackdaniel> another optimizing python compiler: https://clpython.common-lisp.dev/manual.html (written in common lisp :)
<yitzi> jackdaniel: That bumped C up to 3.0%
<beach> dirtcastle: Python (as far as I know; jackdaniel can correct me if I am wrong) is a dynamic programming language, but I hear it is not used that way so much anymore. But if Emacs were written in something like C or Java, it would need a separate "scripting language", and as we know, applications written that way are very hard to debug and maintain. Plus, the scripting language is then often implemented as an interpreter, which agai
<beach> makes it slow.
<beach> dirtcastle: Does that answer your question?
kiki_lamb has quit [Ping timeout: 248 seconds]
<dirtcastle> beach: yeah. some parts went over my head but I'll note everything down and learn abt it. I think because of it's nature every software that common ppl uses should be written in lisp for hackability. I talked abt lisp's hackability with my friends. I thought lisp used to be the best language long ago. the kind of things my friend said gave me this idea that "these days lots of features were added to modern languages like python or Java
<dirtcastle> and are very optimised and can do what lisp can"
kiki_lamb has joined #commonlisp
<edgar-rft> umm, as far as I know Emacs *is* written in C, many thing cannot be changed from the Emacs Lisp level
<dirtcastle> edgar-rft: yes. 30-40% iirc
<empwilli> also, it interprets the elisp code (or jits it as of newer versions)
<empwilli> (modulo bytecode but python has this as well...)
<beach> dirtcastle: Most other language tend to miss some essential features.
<dirtcastle> recently emacs got native compilation right? with 28.1
yauhsien has joined #commonlisp
<jackdaniel> gccemacs was presented at els 2y ago
<beach> dirtcastle: The thing is, it doesn't help if they do 90% of what Lisp does. It is the combination of ALL these features that makes Lisp what it is.
kiki_lamb has quit [Client Quit]
<edgar-rft> Lisp can do native compilation, too - you don't necesarily need C for that
<beach> dirtcastle: Neither Python nor Java are homoiconic, so macros (if they exist) would be very hard to deal with.
<Sankalp> If you want both of pythonic and lisp worlds combined in one language, check out hy: https://github.com/hylang/hy
<beach> dirtcastle: So a language that has everything that Lisp has, except for macros, would still miss out on a lot of stuff.
<beach> dirtcastle: Macros make it possible to change, or augment, Lisp syntax. Not the surface syntax (for that, we have reader macros), but the S-expression syntax. A language that is not homoiconic just can't do that.
<dirtcastle> jackdaniel: gcc emacs has been merged to emacs
Guest27 has joined #commonlisp
<jackdaniel> that's great; still it ws presented at els 2y ago :)
<dirtcastle> beach I'll look into homoiconicity.
<beach> dirtcastle: It means that programs and data use the same, specified and documented, representation.
<beach> dirtcastle: In the case of Lisp, it is S-expressions.
szkl has joined #commonlisp
<beach> dirtcastle: So programs can manipulate program code, which is precisely what Lisp macros do.
<beach> dirtcastle: I recommend that you avoid trying to convince your friends that Lisp is superior, until you know why you think it is.
<beach> dirtcastle: Otherwise, knowledgeable friends will dismiss your argument, and you come out looking ignorant.
<beach> dirtcastle: In my experience, the only way to convince people to consider Lisp, is to show that you yourself can do good work with high productivity.
santiagopim[m] has joined #commonlisp
tyson2 has quit [Remote host closed the connection]
schjetne has quit [Ping timeout: 240 seconds]
<dirtcastle> beach: true..
<dirtcastle> thanks for your time!
<beach> Pleasure. Good luck!
Dynom has joined #commonlisp
<dirtcastle> there is this really old agi project called cyc. the founder of protect claimed developing with lisp is 1000 to 50000 times compared to any modern language. my friend just said "he is exaggerating."
<beach> dirtcastle: I recommend an article by Hudak and Jones entitled something like "Haskell vs Ada vs ...".
<beach> dirtcastle: But don't interpret the result in that article in favor of a particular language. Their result might be valid only for a particular type of problem.
tyson2 has joined #commonlisp
<dirtcastle> beach: noted. my friend always said some program is just better for some applications. I'll keep that in mind.
<beach> dirtcastle: However, the article suggests that there is evidence of a factor (that can be as large as 20) difference between productivity of different languages.
<beach> dirtcastle: But there is absolutely no evidence for three or more orders of magnitude.
<beach> Now, 20 is not as much as 1000 or more, but consider a project with a nominal time of 5 years. It would be significant to say the least if it could be done in 3 months instead.
<beach> dirtcastle: And even if you don't believe in a factor 20, even a 20% difference would compensate for all the training your programming staff will need to be productive in a better language.
<rotateq> dirtcastle: For now you can see all as a nice opportunity to maybe get some new insight to things and that help you also in other environments for the long run.
<dirtcastle> that's true. I am amazed that ppl were able to prove that lisp is 20 times faster objectively. I thought this is smtg that can't be measured or proved. this is big
<beach> dirtcastle: Please turn on your abbrev processor, or type the full words.
slowButPresent has joined #commonlisp
<rotateq> Very much situation-, restriction- and environment-dependent I would say in general. But for really *big* applications that do really non-trivial things it plays well due to different advantages.
<dirtcastle> oh ok! I am using a mobile client! and I'm new to irc. don't know about the tradition (?) or culture (?) here.
<rotateq> No worries, you're welcome dirtcastle. :) I think beach gives you a friendly hint with that.
<rotateq> Do you need some good starting points for CL?
<dirtcastle> rotateq: currently I'm using practical common Lisp book. would love to hear more recommendations
<rotateq> Oh great.
<rotateq> Stick to one resource for the start and get a good basis, not too much at a time in the beginning. :)
<beach> dirtcastle: That's a good book. I can NOT recommend "Land of Lisp".
<beach> dirtcastle: PAIP is a very good book as well.
<dirtcastle> u mean recommend enough?
<rotateq> beach: Or even more *not* "Let over Lambda" as a start.
xaotuk has joined #commonlisp
<beach> Land of Lisp is full of errors: http://metamodular.com/Books/land-of-lisp.html
<beach> And that's just the first few chapters.
<beach> Though I have been told that errors are part of the "fun" that that book intends to communicate. I don't quite understand that, but hey.
<rotateq> The fun lies more in its comic snippets.
<dirtcastle> just now I realised I typed u instead of you. :')
<dirtcastle> that hy github page's xkcd was funny.
WBarends has joined #commonlisp
Bike has joined #commonlisp
yauhsien has quit [Remote host closed the connection]
igemnace has joined #commonlisp
razetime has joined #commonlisp
<tyson2> there are some interesting tidbits in Land of Lisp, but overall I didn't get a warm fuzzy feeling from it. Working with PCL now and will probably pick up PAIP (which I first read years ago).
yauhsien has joined #commonlisp
<rotateq> Another good intro book could be "ANSI Common Lisp" by Paul Graham.
yauhsien has quit [Ping timeout: 248 seconds]
<dirtcastle> yes that was the second recommendation I got rotateq
<Guest74> I don't think i've ever been able to finish one of Paul's books or writings.
<rotateq> And we have also another channel for beginner questions, #clschool.
<rotateq> Guest74: There are parts (or better most of them) that would be good for me to rework in 'On Lisp'.
<dirtcastle> that's amazing
<dirtcastle> beach: ppl at ycombinator forum is telling that article is too old. "c++ has come a long way etc etc"
<Guest74> rotateq: I'm just not a fan of his writing style.  It always gives me the feeling I have something more important to do.
<rotateq> Really? Hmm.
<beach> dirtcastle: Again, the article should not be interpreted as information about particular languages, only as the possibility that there can be a huge difference.
<dirtcastle> noted
<beach> dirtcastle: This article discusses a unique experiment that is not likely to be repeated, so that's what we have.
<beach> dirtcastle: Did you post information about the article to ycombinator?
<dirtcastle> I didn't. when I searched for the article this post came up. I like to read reddit and ycombinator threads
<beach> I see.
<Guest74> anytime I know something about a subject I can tell that most people discussing on those sites don't.
<rotateq> As long as one doesn't run into a Dunning-Kruger situation.
<Guest74> Well, that does come into effect. I've found that when being tested on information I usually assess myself within  2-4%, usually underestimate.  It's probably the rounding going on as I keep track.
rotateq has quit [Remote host closed the connection]
treflip has joined #commonlisp
treflip has quit [Remote host closed the connection]
treflip has joined #commonlisp
<Guest74> too bad programming wasn't one of those subjects...
Madsy has quit [Ping timeout: 252 seconds]
<dirtcastle> that's why I come here and ask you guys to verify
razetime_ has joined #commonlisp
razetime__ has joined #commonlisp
razetime_ has quit [Client Quit]
razetime has quit [Quit: https://quassel-irc.org - Chat comfortably. Anywhere.]
razetime__ has quit [Client Quit]
razetime has joined #commonlisp
varjag has quit [Quit: ERC (IRC client for Emacs 26.3)]
Guest27 has quit [Remote host closed the connection]
szkl has quit [Quit: Connection closed for inactivity]
schjetne has joined #commonlisp
yauhsien has joined #commonlisp
Cymew has quit [Ping timeout: 240 seconds]
yauhsien has quit [Ping timeout: 240 seconds]
xaotuk has quit [Ping timeout: 248 seconds]
yottabyte has joined #commonlisp
rotateq has joined #commonlisp
razetime has quit [Ping timeout: 248 seconds]
razetime has joined #commonlisp
xaotuk has joined #commonlisp
Inline has quit [Quit: Leaving]
tyson2 has quit [Remote host closed the connection]
razetime has quit [Ping timeout: 260 seconds]
pranavats has joined #commonlisp
razetime has joined #commonlisp
analogsalad has joined #commonlisp
Madsy has joined #commonlisp
joast has joined #commonlisp
yauhsien has joined #commonlisp
morganw has joined #commonlisp
rgherdt has quit [Ping timeout: 240 seconds]
ec has joined #commonlisp
tyson2 has joined #commonlisp
analogsalad has quit [Quit: bye]
Guest74 has quit [Quit: Connection closed]
orestarod has joined #commonlisp
lisp123 has joined #commonlisp
lisp123 has quit [Ping timeout: 240 seconds]
Inline has joined #commonlisp
rgherdt has joined #commonlisp
parjanya has joined #commonlisp
razetime has quit [Quit: https://quassel-irc.org - Chat comfortably. Anywhere.]
kpoeck has quit [Quit: kpoeck]
mbrndtgn has quit [Quit: The Lounge - https://thelounge.chat]
mbrndtgn has joined #commonlisp
parjanya has quit [Remote host closed the connection]
dlowe has joined #commonlisp
<bollu> I have a multithreaded program, so when I have an error, I get buffers like *sldb sbcl/33* and so on, upto 64 (number of threads)
<bollu> how do I clear the state correctly?
<bollu> Like, stop the debugging phase
Oddity has joined #commonlisp
Oddity has quit [Ping timeout: 252 seconds]
tane has joined #commonlisp
tane has quit [Changing host]
tane has joined #commonlisp
<White_Flame> well, each of those is legitimately independent
<White_Flame> if you have 64 threads, and each crashes, each one will launch a debugger
<White_Flame> probably what you want to do is capture errors in your thread launcher, and report them somewhere central
<White_Flame> instead of let it go into the debugger at all
<dlowe> could let one of them go into the debugger with a restart that discards the rest
tyson2 has quit [Remote host closed the connection]
Posterdati has quit [Remote host closed the connection]
jmdaemon has joined #commonlisp
analogsalad has joined #commonlisp
Oddity has joined #commonlisp
<bollu> dlowe is there such a restart that discards the rest?
<bollu> Also, what's the common lisp equivalent of (a, b) = (10, 20) where a and b are *slots* of some structure?
<bollu> (that is, I have a function that returns multiple values. I want to store the return values into a struct's slots)
<Bike> (setf (values (a object) (b object)) (values 10 20))
<bollu> I currently do a destructuring-bind followed by two setfs
<bollu> ah, I didn't know about `values`
<Bike> as for the restart, to "discard" an error you pretty much need to abort the thread entirely
<bollu> okay
<Bike> there's usually an `abort` restart for that
<White_Flame> or (multiple-value-bind (a b) (values 10 20) ...) for a scoped equivalent
<mrcom> or multiple-value-setq
<White_Flame> oh wait, misread, n/m
<Bike> the debugger is invoked by the thread that hit the error, so i suppose what you'd need to do is have some shared flag saying whether the debugger has been entered. the first thread that hits an error trips that flag and enters the debugger normally, while the rest abort
<dlowe> multiple-value-setq won't work with CLOS accessors
<mrcom> n/m me too--setq won't work w/ slots
<dlowe> :)
ec has quit [Quit: ec]
<bollu> An emacs question: do folks use paredit/parinfer/lispy/...?
<White_Flame> yes
<dlowe> paredit for me
<bollu> which one?
<White_Flame> (paredit for me, but I've not tried the ohters)
<contrapunctus> Smartparens and Lispy
<Noisytoot> paredit
<dlowe> I'm also a big fan of rainbow-delimiters
<bollu> Yes, I'm using rainbow-delimiters and lispy right now
<bollu> it seems to work... most of the time? Sometimes it gets confusing to predict what the keys do
<bollu> Question: I tried using `defstruct` inside a `defun`, and this did not seem to actually define a `struct`. Is this not allowed? Would `defclass` work? I just want a lightweight way to structure some data inside a block of code [think, gather success/failure/NA statistics]
<contrapunctus> * Boon, Lispy, and Smartparens, in that order. Actually, I'm rarely using Smartparens of late...
<pjb> bollu: there would be little point in definining a structure type at run-time, since you would have no code to take advantage of it, no code calling the run-time newly created constructor, no code calling the run-time newly created accessors, and no code to check the run-time newly created type!
anticomputer has quit [Ping timeout: 240 seconds]
<pjb> bollu: it is still allowed, but it just doesn't do what you think it does. defclass would be the same. As would be defvar, defparameter, or any def<something> or define-<something> operator!
anticomputer has joined #commonlisp
<bollu> pjb I waned to enforce scoping, to make it clear that this struct I was creating represents a concept that's only manipulated in this part of the program
<pjb> bollu: defining operators are better kept as top-level forms, to be compiled and evaluated at compilation-time.
<pjb> bollu: not with defining operator. they're for global definitions.
<pjb> bollu: functions can be defined locally, with flet or labels. You can use a macro to define a local lexical functionnal abstraction.
<bollu> pjb I want to leverage `defstruct`'s ability to create accessors and constructors
<Bike> there is not a lexically scoped equivalent to defstruct or defclass.
<pjb> Bike: there is, as soon as you implement it!
<pjb> bollu: yes, implement this leverage in your own with-structure macro.
<bollu> pjb =) I feel unworthy of creating my own macros just yet
treflip has quit [Quit: Quit]
<Bike> there's not. there is no way to hook into the standard structure mechanism to restrain its scope. you could make something _like_ defstruct, but it wouldn't have any implemention support like packing. and there's no way to make a non-global type definition.
kpoeck has joined #commonlisp
xaotuk has quit [Ping timeout: 248 seconds]
<dlowe> you could probably hack some kind of packing support with cffi
<dlowe> but yeah, in lisp we use our built-ins like plists for those kinds of temporary structures
<dlowe> also consider using returning multiple values for things you would otherwise use structures for
tyson2 has joined #commonlisp
<pjb> If the structure type was local, you would most certainly NOT WANT to return any of it!!! dynamic-extend exclusively!
<pjb> Which is why I think it's dumb, but whatever.
<White_Flame> bollu: it sounds like you want to put it in its own package
<White_Flame> unless it's just literally a single function using said struct
attila_lendvai has joined #commonlisp
akoana has joined #commonlisp
morganw has quit [Remote host closed the connection]
euandreh has quit [Quit: WeeChat 3.5]
cage has quit [Remote host closed the connection]
pfd has quit [Quit: Client closed]
pfd has joined #commonlisp
sabra has quit [Quit: Konversation terminated!]
euandreh has joined #commonlisp
Guest7447 has joined #commonlisp
azimut has joined #commonlisp
jmd_ has joined #commonlisp
jmdaemon has quit [Ping timeout: 240 seconds]
attila_lendvai has quit [Ping timeout: 260 seconds]
<dlowe> well, you could have a local structure type that was passed around local functions I guess
schjetne has quit [Ping timeout: 248 seconds]
<White_Flame> you could also probably gensym everything up instead of giving it standard names
<White_Flame> but for that, I think a separate package would be easier
<White_Flame> or, jimmy up your own object with some let-over-labels closure
Dynom has quit [Quit: WeeChat 3.5]
shka has quit [Quit: Konversation terminated!]
paul0 has joined #commonlisp
aartaka has quit [Ping timeout: 252 seconds]
schjetne has joined #commonlisp
euandreh has quit [Quit: WeeChat 3.5]
analogsalad has quit [Quit: bye]
euandreh has joined #commonlisp
tane has quit [Quit: Leaving]
Bike has quit [Quit: Connection closed]
causal has joined #commonlisp
causal has quit [Quit: WeeChat 3.5]
causal has joined #commonlisp
schjetne has quit [Ping timeout: 252 seconds]
Catie has quit [Quit: headed out]
kpoeck has quit [Quit: Client closed]
lisp123 has joined #commonlisp
random-nick has quit [Ping timeout: 260 seconds]
<seok-> is there any library which can load ttf fonts as well as convert a glyph/character to png or any other image?
<Mrtn[m]> seok-: What about making a procedure that takes a font, a glyph and an image, and plots the glyph on the image?
<_death> zpb-ttf can load ttf fonts, and you can use vecto to render text.. there's also cl-freetype2 and cl-cairo2 for example
<seok-> Ah I see how you can use vecto or some GUI to save text as image
<lisp123> if I have a server e.g. listening on port 12345
<lisp123> I use defvar *server* to avoid trying to recreate it every time I reload my lisp file
<seok-> Could you please elaborate how the object type produced by zpb-ttf can be used as the font to produce text on vecto?
<seok-> Does zpb-ttf produce a font object that vecto understands?
<seok-> Ah it is stated in the docs
<seok-> nevermind, thanks!
<lisp123> But it still evaluates the make server form - how to avoid that? (defvar *acceptor* (make-instance 'hunchentoot:easy-acceptor :port 12345)) (hunchentoot:start *acceptor*)
<_death> lisp123: do you mean that it evaluates start twice? (because it's not in the defvar form)
<seok-> maybe progn the 2 expressions?
<lisp123> _death: No, so one first load everything is fine
<lisp123> on second load (make-instance 'hunchentoot:easy-acceptr ...) returns an error because hunchentoot is already listening on 12345
<lisp123> (if I reload my entire file that is)
<_death> I think you should check again
<seok-> yes you need to either restart lisp image or close the server first
<seok-> if you want to open the server on the same port
<semz> make-instance shouldn't be signalling an error
<semz> you can create acceptors all you want, it should be START that chokes
<seok-> I think he is reloading the whole file
<lisp123> yes
<lisp123> I could catch the error potentially but wonder if there's another way?
<_death> did you check again?
<lisp123> What should I check? I got this: acceptor #<WEBSOCKET-ACCEPTOR (host *, port 12345)> is already listening [Condition of type HUNCHENTOOT::HUNCHENTOOT-SIMPLE-ERROR]
<_death> you should check what form evaluation led to this error
<_death> and then you should check that you understand what I asked you in the first place
<lisp123> (defvar *acceptor* (make-instance 'hunchentoot:easy-acceptor :port 12345)) here is the issue, hunchentoot:start is fine (which I think was your question)
<lisp123> its a separate form - my bad for adding it into the pastebin
<_death> nothing you say makes sense
<_death> you use hunchentoot:easy-acceptor, but the error you show refers to websocket-acceptor
<lisp123> (defvar *server* (make-instance 'hunchensocket:websocket-acceptor :port 12345)) also errors out - that was the first error
<_death> maybe you should come up with a small self-contained example that shows your problem.. it should be a file that, when loaded twice, results in the error you get
<lisp123> ok
<lisp123> ok figured it out
<lisp123> thanks _death & semz & seok
<lisp123> need to put the start server into the defvar form
<_death> cool, g'night
<lisp123> TIL defvar only evaluates the form if the variable is not bound
<lisp123> nights