libera/#commonlisp - IRC Chatlog
Search
12:14:14
lisp123
shka: https://stackoverflow.com/questions/37638876/how-to-force-quicklisp-to-download-a-library
12:24:41
lisp123
that walks your ASDF directories and deletes anything with a particular system name as part of the file name
16:17:37
kagevf
pdietz: by default a fasl file is generated in the same folder as the original *.lisp, or you can do something like (setq slime-compile-file-options '(:fasl-directory "/tmp/slime-fasls/")) ... from: https://slime-tips.tumblr.com/
16:49:12
dbotton
I created a class in one package and instance of that class in another, I've noticed if I need to access a slot value I need to specify the package for the slot name - (slot-value some-obj 'clog::slot-name)
16:50:30
beach
dbotton: So you need to do whatever it takes to get the right symbol that names the slot.
16:50:56
beach
dbotton: If you import the symbol (not recommended) into that other package, no package prefix is needed.
16:51:27
beach
dbotton: The same goes for any symbol used for any purpose, like the class name, the slot name, a function name, etc.
16:53:01
dbotton
understood, I thought that perhaps slot-value could determine the symbol's package based on the object's class definition
16:55:05
beach
dbotton: It is possible to have two different slots in a class named with two symbols having the same name but different home packages.
16:55:05
shka
but some things are not named, and you can short-circuit to thinking that object must have package "owning" it
16:58:32
shka
other languages have a disturbingly complex behaviors, mixing classes, namespaces, and files
16:59:43
beach
dbotton: Slots are implementation details. You should use functions instead. And the names of those functions should be prefixed with the package name as well, to indicate where the protocol function belongs.
17:04:11
beach
That's not the issue. The issue is that some attribute could be either stored or computed, and client code should not have to care which one, since it may change in future versions of the module.
17:04:17
shka
there is obviously POD, but i would argue that POD type names should not be even exported
17:09:18
shka
regardless, unless you are doing something unusual, you should use slot name just once, when defining class
17:11:01
dbotton
I understood before that likely was the answer, but wanted to be sure as was thinking for oo purposes creates confusion
17:12:01
dbotton
Ada kept the same consistency in Ada95's OO but realized that users expecting the simplicity of Obj.A to work
17:13:36
shka
johnjay: yeah, but doing the wrong thing just to meet some kind of norm is not something i would encourage
17:14:15
dbotton
true, but I think for lisp it makes more sense to be consistent, as it will never "look" like other languages anyways
17:14:26
johnjay
i was thinking along these lines the other day. one of the reasons scheme is embedded in a lot of programs is it's super easy to script with
17:14:55
johnjay
python also strikes that balance well with having easy scripting but also you can shfit to do "serious" stuff as well
17:15:28
johnjay
whereas some languages like java assume you're ready to be serious and write that public static void main or whatever right off
17:17:33
beach
Embedding an implementation of a dynamic language into an application written in a static language is a silly idea from the start. It is much better, both with respect to performance and to maintainability, to write the entire application in one dynamic language.
17:19:55
jackdaniel
unless that static language has richer ecosystem and/or it is the sacred environment on the platform
17:22:15
johnjay
i think paul graham had an essay talking about this. something like people have to be able to script in your language or use it informally
17:23:04
beach
johnjay: Oh, there are so many (usually incorrect) ideas of what needs to be done for your favorite unpopular language to get wider adoption.
17:24:36
jackdaniel
this is quite a stretch but this could be compared to how common lisp implementations run on "stock hardware designed for static languages" - kind of like embedding a dynamic language in a static one
17:26:31
johnjay
i think in lisp people use scheme as the beginner scripting type language anyway so it doesn't really matter. the implication is if you're learning common lisp you're ready for anything
17:30:27
beach
johnjay: Steven Pinker thinks that this is the reason for so much bad scientific writing. But it is a skill that can be trained, i.e., people can learn to put themselves in the situation of others who do not yet have the same knowledge.
17:31:07
johnjay
so it's more about what people happen to randomly think than something objective and knowable
17:31:55
johnjay
i remember reading a flame thread one time about signed overflow in C. somebody was mad that their code to check for overflow was being optimzed away
17:34:46
johnjay
C is probably the best example of this because it has 200 forms of UB which basically means "the compiler can remove your code lol"
17:35:39
jackdaniel
the newer standard says that "in this case the compiler may in example do ..." while in older standards (for C credit) was: "in this case the compiler should do one of ..."
17:36:36
jackdaniel
this wording change is quite unfortunate, because UBs were originally introduced to add extra flexibility to define implementaiton-specific useful behavior that matches the platform
17:36:55
johnjay
apparently C picks int,unsigned int, long, unsigned long, in that order for hex literals. but decimal literals are signed
17:44:56
jackdaniel
more seriously though, it follows one specific programming paradigm with aesthetics set by the creator while common lisp is not opinionated (although the "contemporary style" in the community is known)
17:45:42
jackdaniel
common lisp has a standard, on the other hand clojure is more popular hence there are more hands to improve it and write libraries for it
17:46:15
jackdaniel
if you learn only common lisp you will become a better programmer than if you learn only clojure (in my not very humble opinion)
17:47:06
johnjay
i would think that's the whole point. but the tutorial i saw didn't even mention how to do java interop
17:47:16
jackdaniel
but there is not small gorup of former common lisp programmers who praise clojure as much better (i.e thanks to the ecosystem or more hireable people)
17:47:50
johnjay
yeah i think the previous convo came down to the technical merit is not necessarily same as the eco system
17:49:12
johnjay
i guess i wondering if CL is "outdated" like for threading or whatever the future has
17:50:14
johnjay
like ffi i assume means most of your code is CL and it's calling out to a C library
17:50:19
jackdaniel
the common lisp standard doesn't have many things that are important - i.e threads, sockets etc - but these things are available as the implementaiton extensions.
17:50:58
jackdaniel
you don't need a standard to have a feature - I don't think that C standard subsumes the posix standard, or that it defines threads (well, it does in newer version, but you know what I mean)
17:51:29
johnjay
sometimes you need the compiler to have a feature. i don't really understand the specifics though
17:51:38
jackdaniel
ECL is different from other implementations in that its runtime is shared with C. that means that you may call ECL functions from C program or embed common lisp runtime inside C application
17:53:10
jackdaniel
maxima builds with ecl (but it uses also other implementations), eql5 is ecl embedded in qt5
17:53:44
johnjay
ok. i think i tried using qt5 one time. the fact i had to get an IDE and use qmake confused me so i stopped
17:54:11
jackdaniel
I don't understand your question. ffi allows you to call foreign code using the C ABI (i.e libfoo's functions), implementaiton may have extensions that are not part of the standard - i.e lisp functions to create threads
20:08:35
pdietz
johnjay: for non-academic purposes it's almost never justified to invent a new language.
20:10:04
pdietz
It might be justified if there's some new area that no one had invented a language for before and that for which existing languages are a poor fit.
21:55:16
semz
I'm not even sure where you would draw the line between a very advanced Common Lisp library and a new language, especially when you allow implementation extensions into the picture, e.g. to get more precise control over generated code.
21:58:17
semz
If I remember correctly, there is a library that adds an ML-like type system and lets you mix that freely with normal CL code. Is this still CL or a new lisp?
21:59:30
semz
So I'm not sure how meaningful the question is. But I'd definitely say that much too few "recent" languages offer something over CL.
22:00:44
mzan
semz: the name of the library/language is Coalton https://github.com/coalton-lang/coalton
22:00:52
engblom
I would say that Clojure offers something over CL, but being forced to run on java or javascript is a drawback.
22:02:43
White_Flame
my only real interest in "new" languages is getting over the entire imperative paradigm. For anything else, CL is fine
22:15:09
mzan
semz: to be fair some very advanced libraries of mainstream PL can be seen a domain-specific-languages, or in extreme cases as distinct languages.
22:15:39
mzan
Many interactions with external DBMS are for sure based on different paradigms/languages.