libera/commonlisp - IRC Chatlog
Search
16:34:14
beach
JeromeLon: I suspect you are under the impression that the *...* inside your quoted expression refers to the binding in the LET.
16:39:02
JeromeLon
_death: no, I can't find the boundp returning false case again. I wish I had a better history of all my tests.
16:43:35
JeromeLon
anyway, when the code is consistent (using declare special both in the let and the eval), the behavior is consistent and clearly explained. And the initial weird case (eval having access to the special variable, even though nothing hints at it in its environment, but with a warning) has a reasonable explanation (lenient approach from the implementation)
16:46:47
_death
yeah.. SBCL warns you because generating that look-up code is not portable and perhaps not what you intended
17:27:32
lisp123
From the earlier discussion on Eval --> If I have (eval `(something ,other-thing)) , other-thing can still access the lexical environment in which the eval statement is placed into?
17:35:35
_death
your question is unclear.. other-thing presumably is a variable, and its value is used when creating the list that is passed to eval
17:45:57
lisp123
Similarly, (eval `(something ,(other-thing 'mysterious-symbol))) would evaluate other-thing within the lexical environment and pass the resultant list to eval?
17:48:11
lisp123
Yes. I was just curious on the earlier comment saying SBCL was being lenient, but perhaps its related to something else.
17:48:35
_death
the only thing is that the form it evaluates has no access to the lexical environment active when EVAL is called
18:22:19
pjb
JeromeLon: if you don't want to declare it special globaly, you will just have to wrap a local declaration around each use: (locally (declare (special ext::*witness*)) (incf ext::*witness*))
18:27:16
JeromeLon
pjb: yes, this was suggested by _death, and it's perfect for me, it's what I am using now in that code.
21:47:11
skeemer
what do you use macro for? and do you think macro is the only feature which keeps Lisp apart from other programming languages like python/ruby/golang and so on ?
21:49:42
kagevf
skeemer: macros are for building DSL and doing syntax abstraction. In addition to macros, image based dev, conditional system, CLOS (because it's method centric instead of class centric) are some other Lisp only* features ...
21:50:32
kagevf
* smalltalk as image based dev, and macros can be found to some degree in other languages. I think the conditional system and clos are unique to CL, though .... other Lisps have CLOS similars, though
21:51:24
kagevf
skeemer: IOW, "the image" is the program running in memory ... you can interact with a program while it's running and modify small parts of it without having to re-build the whole thing
21:51:48
kagevf
skeemer: cond is a special form that's analogous to "switch" in algol derived languages
21:52:16
kagevf
skeemer: the conditional system includes things like exception handling, re-starts and more ... phoe even wrote an apress book about it
21:53:38
kagevf
but if you're just starting out, I recommend reading "lisp a gentle introduction" which is free online
21:54:29
kagevf
phoe's book can be found here ... the CL conditional system: https://www.apress.com/us/book/9781484261330
21:55:35
Catie
Seconded on Common Lisp: A Gentle Introduction to Symbolic Computation. Super helpful book when I was starting out
21:55:40
kagevf
go to the common lisp sub-reddit - it has a side bar with lots of great resource links
21:57:00
kagevf
skeemer: one cool thing about image development is that you can build and change your program without having to through a complete build cycle on each step
21:57:47
kagevf
you can even interact with apps you've deployed if you have to ... not a best practice necessarily but come in handy if you ever need it :)
22:08:04
kagevf
skeemer: great .... do you use emacs? emacs+slime is the recommended (but not only!) environment for coding CL
22:23:11
pjb
skeemer: have a look at Casting Spels in Lisp Conrad Barski, M.D. http://www.lisperati.com/casting.html
23:22:52
mzan
Lisp syntax is "uniformly ugly" so you can add to it various macro and DSL without thinking too much.
23:23:26
mzan
On the contrary it is more difficult to extend a language with an infix syntax like C, C++ in good way.
23:24:19
mzan
On other words: every DSL in Lisp seems native, while on other languages maybe not, because you had to extend the syntax in a nice way.
23:40:29
stacksmith
mzan: many people find Lisp syntax "uniformly beautiful". It's nice for macros the same way gloves are nice for human hands - Lisp syntax is what it is primarily to allow macros to manipulate forms, don't you think?
1:36:23
copec
For probably the best case comparison https://docs.julialang.org/en/v1/manual/metaprogramming/
3:01:56
beach
asarch: Assuming by "native language", you mean the literal meaning, i.e., the one I was born into, then it is Swedish. But my "primary" language is English.
3:06:10
beach
Person P lives in country C doesn't automatically imply that P speaks the official language of C.
3:10:42
beach
Either way, it's off topic. Now, my primary (but not "native") programming language is Common Lisp.
3:11:59
beach
asarch: Also, you should turn on your spell checker. It would have caught your typos in two of the languages you listed.
3:13:04
beach
asarch: I have been exposed to quite a few, but whether I still "know" them, is a different story. Not important either way.
3:14:43
beach
I have been using Common Lisp almost exclusively for more than 2 decades, and the languages I used before that have evolved.
3:33:48
Spawns_Carpeting
are there are "must have" cl libraries for basic things like strings, lists, file handling, etc? I am thinking something like dash and s for elisp for example
3:34:27
Spawns_Carpeting
elisp actually doesn't make a terrible general purpose language using those libs and cl-lib
3:35:46
beach
Spawns_Carpeting: If, instead of referring to Emacs Lisp, you describe what it is you want, you might get better answers. That said, Alexandria is a general-purpose library for many things that are useful additions to basic Common Lisp.
3:36:29
beach
Spawns_Carpeting: I am not going to read up on dash and s to answer your question, is what I am trying to say.
3:40:23
beach
Spawns_Carpeting: Emacs Lisp is not a "programming language" in my vocabulary, but a "programming system". For something to be considered a "programming language" I require it to have a specification established by an "organization" that is separate from any of the suppliers of implementations of that language.
3:41:36
beach
Spawns_Carpeting: This features is essential for industrial use, because there must be some kind of guarantee that the interface does not change arbitrarily over time, thereby requiring clients to catch up with changes to the programming system.
3:42:23
Spawns_Carpeting
right beach I understand. dash is a library that adds many highly useful utility functions for lists. Examples are map, filter, remove, take, slice, reduce, min, max, some, any, split
3:42:25
beach
Spawns_Carpeting: That's why, in my talks to industry, I emphasize the importance of choosing languages with an independent standard, published by some credible standards organization, like ISO, ANSI, IEEE, etc.
3:43:03
beach
Spawns_Carpeting: All those are in standard Common Lisp, or can be had with a small amount of code.
3:44:39
Spawns_Carpeting
there are probably 100s of functions that dash provides but those are just the ones I could think of. s is basically the same idea but for strings. common lisps string handling felt a little weak when I used it
3:46:06
White_Flame
Spawns_Carpeting: everything in the sequences dictionary in the spec also applies to strings
3:46:45
Spawns_Carpeting
how can you check if a string only contains uppercase letters in cl? or what about checking if it starts or ends with a given substring?
3:48:23
hayley
(notany #'lower-case-p string) ; assuming you're okay with non-alphabetic characters too
3:50:25
Spawns_Carpeting
yeah alexandria sounds like what I am talking about. also uiop gives many helpful functions
3:50:28
beach
Spawns_Carpeting: This looks like an exercise it trying to find a function that Common Lisp doesn't have but that exists i s.
3:51:23
Spawns_Carpeting
my only point was that cl's built in string handling is a tad weaker than what you would get with say... python
3:52:15
White_Flame
and yes, people tend to make their own library of one-liners for stuff like this, tuned to whatever they happen to need for their project
3:53:15
White_Flame
you'll also find CL to have more of a mindfulness to using fewer resources, so for instance splitting & rejoining many temporary substrings isn't something normally done in the standard stuff
3:56:32
Spawns_Carpeting
fwiw I like lisp and moreso common lisp a lot. I don't want to be banished to elisp forever! lol
4:00:00
Spawns_Carpeting
i doubt that lisp libraries are an extremely common source of malware but you never know
4:01:26
White_Flame
I believe the only testing that is done is that all tests it includes must pass, and combinations of loads must work
4:02:45
White_Flame
however, CL in general is distributed in source form, and I haven't seen any obfuscated stuff in the wild. So it relies by default on openness in this security regard
4:07:00
jcowan
beach: It's not clear to me that C# is significantly less risky than Java, even though C# has a standard (ISO 23270) and Java does not.
4:08:52
beach
jcowan: In case it wasn't clear, I meant that a standard is a necessary (but not sufficient) condition.
4:10:22
White_Flame
well, a standard can't really do anything about library ecosystem malware anyway
4:10:38
hayley
I'd have to check the overlap between Java specifiers and Java implementors, but I suspect there is no overlap in people (but there would be an overlap in Sun/Oracle funding both).
4:12:21
beach
hayley: But by having the specification owned by a company means that they can attempt to sue people who use it in ways they don't like, as Google has experienced.
4:12:41
hayley
The Java 17 specification has James Gosling, Bill Joy, Guy Steele, Gilad Bracha, Alex Buckley, Daniel Smith and Gavin Bierman. I know the first four wouldn't have touched JVM source - yes, true.
4:13:17
Spawns_Carpeting
I am actually not a huge fan of official standards wrt programming languages. I do think it's useful for truly industrial software though
4:13:38
beach
hayley: Of course if you are Google, you have enough means to fight it, but if you are a small company or an individual, there is no hope.
4:15:49
hayley
I think there is a catch-22 though; how do you get users, if the language should not be used until it is standardised? I assume that you won't bother standardising untill you have users.
4:17:45
waleee
by the amount of cash ISO et al wants for a copy of a standard I assume you also dont bother because of financial reasons
4:18:47
Spawns_Carpeting
that's one of the reasons I am not a fan of standardizing languages waleee. it also makes it much more difficult for common people to actually contribute to the standard
4:20:00
beach
Spawns_Carpeting: Oh, but you don't want "common people" to contribute to a language definition. They just don't have the knowledge of language design or compiler technology to understand the consequences of their "contributions".
4:20:46
beach
Spawns_Carpeting: We see attempts here pretty much every week of "common people" wanting to revise the Common Lisp standard, and often in ways that would then make it impossible for the compiler to generate efficient code.
4:20:50
hayley
Having some kinds of contributions, no matter the experience of the author, is still in conflict with having a standard which doesn't change.
4:21:22
jcowan
ISLisp, ST, and some other languages solved that problem by producing a pre-standard in the public domain
4:21:23
beach
Spawns_Carpeting: Maybe your projects are just a hobby, but Common Lisp is designed to be industrially viable.
4:22:24
Spawns_Carpeting
yeah I do see your point beach, but I am not advocating for introducing every random idea that a person comes up with either! I am a fan of how python handles this with "PEPs"
4:22:31
beach
waleee: I mean, what is the purpose of this tendency? Just to have an independent organization in charge of the language specification?
4:23:08
White_Flame
as long as there is a cut & published standard, as opposed to an arbirarily changing webpage, a spec is a spec
4:23:20
beach
Spawns_Carpeting: You just gave a fantastic example of a language that basically can't have a compiler that generates efficient code. I would definitely not want that for Common Lisp.
4:23:22
Spawns_Carpeting
there must be some minimum level of quality no matter what the case is, otherwise it's going to become a joke really fast
4:23:54
Spawns_Carpeting
yeah but I don't think that's because of it not having an official standard beach
4:25:15
Spawns_Carpeting
I hate to be the rust dude, but rust has a similar system where people can create rfcs on github, and the team decides whether they are worth considering or not
4:25:17
beach
Spawns_Carpeting: Sure it is. The official standard would preferably be established by a bunch of people who have knowledge and experience in language design and compiler technology. When you have "common people" establishing a specification, that's when you get aberrations like Python.
4:25:32
waleee
in the case of the rust foundation it seems unclear, they (by comments of different core developer groups) apparently isn't directly involved in the work
4:27:01
Spawns_Carpeting
the language devs and maintainers are still the "gatekeepers" in regards to quality, they just aren't "official" like legal standards committees are
4:27:10
White_Flame
Spawns_Carpeting: one unique thing about CL is that libraries can fundamentally change the language, without needing extra support from standard implementations for those features
4:27:13
beach
Spawns_Carpeting: The problem here is selecting the people who are capable of screening proposals. Apparently, for Python this is not done in a way that would be acceptable to Common Lisp, since they accept design that is impossible to implement efficiently.
4:28:15
Spawns_Carpeting
yup I agree 100% beach, screening is good, but I am not sure ISO standard committees are the best method of screening for talent
4:28:16
hayley
waleee: I recall Steve Klabnik found an article claiming that Rust followed principles used at Amazon, said that was definitely not the case, then some time later, he decided to ditch his book-writing efforts.
4:29:16
hayley
So I'm...not comfortable with the idea of having a group of large companies fund a language any more than I'd be with just one company. Though the funding isn't supposed to affect language decisions on paper.
4:29:20
beach
Spawns_Carpeting: I think you have an incorrect idea of how ISO (or ANSI) standard committees are created.
4:29:53
Spawns_Carpeting
I know it costs a non-trivial amount of money which is a non-starter for a large amount of the world
4:30:06
jcowan
It's only a historical accident that CL has a stable standard: most standards have a definite lifecycle
4:30:07
waleee
hayley: yeah, I saw that debacle, but there was some other rust teams that claimed that this wasn't the case, with varying degrees of plausability
4:30:50
Spawns_Carpeting
though participation I guess doesn't cost (or does it?), but I imagine it still requires traveling which is also not possible for everyone. I could be wrong about these things though and am welcome to being corrected :)
4:30:51
beach
jcowan: I am extremely grateful for that historical accident, and it is a large part of the reason it is my preferred language.