libera/#commonlisp - IRC Chatlog
Search
8:23:47
Mrtn[m]
<kaskal> "dbotton do not answer to..." <- How did you arrive at the conclusion that horroar is a troll?
8:34:03
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).
8:42:41
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.
9:05:11
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
9:08:33
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.
9:49:12
lisp123
What would be a minimal (i.e. easier to implement) subset of Common Lisp that one can embed in other languages?
9:49:40
lisp123
I assume take CLOS out, keep macros in - but keen to get thoughts on what would be a good subset.
9:50:52
lisp123
semz: most use scheme for this, but I couldn't stand a lisp-1 and rather have more normal lisp syntax like defun
9:52:07
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
9:52:47
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
9:54:17
jackdaniel
then you will proudly claim that it is a common lisp implementation (although, pre-ansi one)
9:54:45
rotateq
parts of (ported) things from GOAL still run afaik in newer NaughtyDog games like Last of Us
9:54:57
lisp123
Oh that would be cool ;) And I could publish it as a new language (I'm joking here! ;)
9:57:53
semz
used it before; still pretty alpha stage. they didn't even have proper bignums last time i checked
10:02:03
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? :/
10:05:12
jackdaniel
not really, some things are done because authors find them fun to work on, not because they want to fix broker JS semantics
10:06:39
semz
do they decide on design choices by coinflip or what. i want to know what was behind the choice
10:08:50
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
10:10:34
lisp123mobile
i’m doing it in python but will use these JS versions as inspiration…plus i hate python (javascript is actually quite nice)
10:41:37
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
10:46:03
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.
10:51:29
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/
10:57:25
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/
11:17:04
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 :)
11:52:26
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 ?
11:53:51
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.
11:55:19
beach
dirtcastle: A language with complicated surface syntax basically can't do macros the right way.
11:56:25
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.
11:56:32
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.
11:56:57
jackdaniel
technically speaking cpython as a reference implementation is an interpreter, there were (and are) a few implementations that are compilers
11:57:32
jackdaniel
pypy does jit compilation, cython transpiles to C/C++, Numba uses LLVM to produce machine code
11:58:22
beach
dirtcastle: Python is not part of my expertise, so listen to others like jackdaniel for details about it.
12:00:00
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".
12:01:33
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.
12:02:35
jackdaniel
another optimizing python compiler: https://clpython.common-lisp.dev/manual.html (written in common lisp :)
12:04:00
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
12:10:11
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
12:10:48
edgar-rft
umm, as far as I know Emacs *is* written in C, many thing cannot be changed from the Emacs Lisp level
12:13:52
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.
12:14:53
beach
dirtcastle: Neither Python nor Java are homoiconic, so macros (if they exist) would be very hard to deal with.
12:15:32
Sankalp
If you want both of pythonic and lisp worlds combined in one language, check out hy: https://github.com/hylang/hy
12:15:44
beach
dirtcastle: So a language that has everything that Lisp has, except for macros, would still miss out on a lot of stuff.
12:17:52
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.
12:19:01
beach
dirtcastle: It means that programs and data use the same, specified and documented, representation.
12:19:39
beach
dirtcastle: So programs can manipulate program code, which is precisely what Lisp macros do.
12:21:40
beach
dirtcastle: I recommend that you avoid trying to convince your friends that Lisp is superior, until you know why you think it is.
12:22:31
beach
dirtcastle: Otherwise, knowledgeable friends will dismiss your argument, and you come out looking ignorant.
12:23:54
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.
12:37:01
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."
12:37:54
beach
dirtcastle: I recommend an article by Hudak and Jones entitled something like "Haskell vs Ada vs ...".
12:38:36
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.
12:39:26
dirtcastle
beach: noted. my friend always said some program is just better for some applications. I'll keep that in mind.
12:39:42
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.
12:40:15
beach
dirtcastle: But there is absolutely no evidence for three or more orders of magnitude.
12:41:48
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.
12:42:48
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.
12:44:28
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.
12:45:06
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
12:47:03
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.
12:47:10
dirtcastle
oh ok! I am using a mobile client! and I'm new to irc. don't know about the tradition (?) or culture (?) here.
12:47:50
rotateq
No worries, you're welcome dirtcastle. :) I think beach gives you a friendly hint with that.
12:49:11
dirtcastle
rotateq: currently I'm using practical common Lisp book. would love to hear more recommendations
12:50:21
rotateq
Stick to one resource for the start and get a good basis, not too much at a time in the beginning. :)
12:52:32
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.
13:10:25
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).
13:35:06
rotateq
Guest74: There are parts (or better most of them) that would be good for me to rework in 'On Lisp'.
13:35:51
dirtcastle
beach: ppl at ycombinator forum is telling that article is too old. "c++ has come a long way etc etc"
13:35:51
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.
13:36:55
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.
13:37:25
beach
dirtcastle: This article discusses a unique experiment that is not likely to be repeated, so that's what we have.
13:39:07
dirtcastle
I didn't. when I searched for the article this post came up. I like to read reddit and ycombinator threads
13:43:52
Guest74
anytime I know something about a subject I can tell that most people discussing on those sites don't.
13:50:39
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.
17:56:14
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)
18:30:28
White_Flame
probably what you want to do is capture errors in your thread launcher, and report them somewhere central
18:51:50
bollu
Also, what's the common lisp equivalent of (a, b) = (10, 20) where a and b are *slots* of some structure?
18:52:04
bollu
(that is, I have a function that returns multiple values. I want to store the return values into a struct's slots)
18:52:41
Bike
as for the restart, to "discard" an error you pretty much need to abort the thread entirely
18:54:03
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
19:05:16
bollu
it seems to work... most of the time? Sometimes it gets confusing to predict what the keys do
19:06:58
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]
19:09:09
contrapunctus
* Boon, Lispy, and Smartparens, in that order. Actually, I'm rarely using Smartparens of late...
19:11:30
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!