freenode/#lisp - IRC Chatlog
Search
16:08:38
jasom
yup. She asked me about programming and I was about to say that my first language was gwbasic, but then I realized we had done logo in school, just nobody told us it was programming.
16:09:14
jasom
JuanDaugherty: she had some developmental delays so I had to wait until she could read without struggling
16:13:06
jasom
Qbasic was the first thing I *really* got into, and then C shortly after. I wrote a bubble sort in C and quickbasic, compiled both. The quickbasic ran 8minutes interpreted, 1 minute compiled. C ran in under a second.
16:14:06
jasom
you can still buy my first C compiler too: http://www.mixsoftware.com/product/powerc.htm It requires DOS 2.0 or later!
16:15:12
jasom
Yeah It was less cheaper with the library source than to get MSC or TC without source
16:17:27
jasom
That and Thomas Plum's "Learning to Program in C" (A great text that is unfortunately dated due to predating ANSI) is what got me started
18:05:17
whoman
genuis lispers! i require a little headful discussion of an idea thats not too crazy, if anyone happens to know about laziness, unification, declarative pattern matching stuff (ala prolog, haskell)
18:12:33
whoman
"First of all there is no portable way (yet) to list all the slots of a given structure. " for CLOS - its true?
18:39:37
phoe_
I have the Slime debugger open. How can I jump to the definition of a method called in a frame?
18:55:51
phoe_
How can I tell CFFI's foreign-array-to-lisp to return not SIMPLE-VECTOR, but SIMPLE-ARRAY (UNSIGNED-BYTE 8)?
19:01:21
phoe_
I have a method that might not be very effectively, namely COERCE'ing the resulting vector into the proper type.
20:25:27
pjb
whoman: have a look at: http://informatimago.com/articles/usenet.html#Improved-DEFSTRUCT-macro--run-time-access-to-the-fields
20:26:56
pjb
whoman: if you don't have access to the source then you can write such macros just to declare the slots, and to generate your own forward-accessors.
22:50:22
mfiano
Yeah CL is strange in that order is context-dependent. Many different functions unituitively have reverse order. It's just something you grow used to. eldoc helps though
22:52:31
aeth
generally it should go (foo item index) unless it's just there for backwards compatibility
22:52:47
aeth
and the reason why the order flipped (obviously nth is much older than most of these) is because of aref being multidimensional
0:08:42
drmeister
Energy efficiency of different languages. Lisp fares very well - Python is a disaster.
0:11:08
jmercouris
pjb: and I have this run file here: https://github.com/nEXT-Browser/nEXT/blob/master/next/run.lisp
0:11:26
jmercouris
when I try to load a system I've defined here: https://github.com/nEXT-Browser/nEXT/blob/master/next/next.asd
0:11:36
jmercouris
it simply complains that whatever package is not installed isn't, doesn't attempt to install
0:13:13
pjb
You may also rather symlink your next source directory to ~/quicklisp/local-projects/next so you don't have to touch *central-registry*, and can directly (ql:quickload :next) instead of (laod "run.lisp")
0:15:16
jmercouris
that file is here: https://github.com/nEXT-Browser/nEXT/blob/master/next/make.lisp
0:16:00
pjb
I usually name it generate.lisp or generate-application.lisp and call it from a Makefile.
0:16:31
jmercouris
the issue I have is if you see on line 4, I was normally loading all of the things manually
0:16:42
jmercouris
like this: https://github.com/nEXT-Browser/nEXT/blob/master/next/dependencies.lisp
0:17:42
pjb
Those dependencies can always be dealt automatically by quicklisp. But you need some other setup, and notably when generating the executable, you want to control what is loaded in your lisp imageā¦
0:18:24
aeth
drmeister: seems to be in line with general benchmark results, where there are very fast languages, "normal" languages, and very slow languages.
0:18:40
pjb
But the loading of your system and other stuff, you have to do in a script to build the application.
0:19:45
pjb
jmercouris: notably, in generate-application, I quickload the libraries needed by the builder.lisp script which is common between generate-application.lisp and loader.lisp
0:20:31
pjb
Not instead. The makefile only serves to record how the lisp implementation should be run on the make.lisp script to build correctly the program.
0:21:55
pjb
Another example: https://framagit.org/nasium-lse/nasium-lse/tree/master/src in this one, the makefile lets you choose between several versions of binaries (server, cli).
0:23:56
pjb
jmercouris: the requirements: 1- you want all the dependencies in asd files. 2- you want to avoid duplication between loading an image for an executable and loading to develop/debug. 3- you want a reproducible build (in different environments) to generate the executable.
0:24:32
pjb
And depending on the complexity of the project, you may have additionnal things, such as downloading, installing and compiling dependencies that are not in quicklisp! :-)
0:26:12
pjb
So for the later, I run the scripts manually, but in Patchwork I use logical pathnames to point to the directories where those dependencies are stored.
0:27:15
pjb
It is conceivable to combine both scripts, to be able to download automatically non-quicklisp dependencies when needed.
0:28:26
pjb
Yes, it depends on the degree of ease you want to provide for co-workers, or other developers getting your sources and compiling them.
0:29:13
jmercouris
I think a little bit too much room to break if I pull in other sources as well, I think i'll just leave it how it is, maybe only automating download of quicklisp dependencies
0:55:21
jasom
Xach: am I misinterpreting systems.txt or does QL think that cl-unicode/build depends on the system cl-unicode? That seems wrong to me.
1:49:13
drmeister
I'm trying to debug what I think is the last bug in my implementation of beach's fast-generic function approach.
1:50:03
drmeister
Every generic function maintains a call-history of all calls that were previously made to it and their effective method functions.
1:50:20
pjb
For example, you could do it lazily, when a generic function is called with an instance of a subclass, that subclass will have be passed to a call to update-instance-for-redefined-class, and then the subclass will have to be updated itself (so I assume by metaobject protocol, be passed to such a call too).
1:50:29
drmeister
The call-history (as I understand and implemented it) is an alist of (selectors . effective-method-function)
1:51:17
drmeister
When a class is redefined - I need a list of all generic functions that could dispatch on that class (and maybe it's subclasses - but I'm not sure that is necessary because they may be handled when they get updated).
1:52:07
drmeister
I'm trying to figure out how to get the minimal list of generic-functions that may need to be invalidated when a class is updated.
1:52:12
pjb
Now since redefining classes is not done often at run-time, you could have a global flag, and let the generic functions check it?
1:53:27
drmeister
What I did was add a call from ensure-class-using-class that invalidates all generic-functions that could be effected/invalidated by that class redefinition.
1:54:27
drmeister
I can compile cclasp using Cleavir (lots of generic functions) using the new dispatch method.
1:54:40
pjb
Also, redefining a class may change the applicable methods, so yes, you should probably update all the generic functions concerned.
1:54:54
drmeister
Except for one error that is triggered by the redefinition of a class when I'm compile-file'ing all of the code.
1:58:12
pjb
"Easy": for all symbols, find the fdefinition of the symbol and of (setf ,the-symbol), check if they're generic functions, then get the methods of the generic function, and for each method, find the method specializer, and search for the class or an instance of the class or a subclass in them.
1:59:24
pjb
The question is whether it is more efficient to maintain a list of methods dispatching on a class, or to scan them when needed?
2:00:10
drmeister
I think this is a scan them as needed situation - like you said - redefining classes is uncommon.
2:12:05
jmercouris
hey everyone, I'm getting a strange error when I run my program: https://pastebin.com/AYRtnk5D
2:13:07
pjb
It may be a problem of incompatible asdf version. Or not having loaded asdf early enough?
2:15:51
edgar-rft
the debugger should spit out a list of the functions that were called before the error happened or at least have an option to produce such a list
2:18:23
edgar-rft
(defvar *default-etld-names* (asdf:system-relative-pathname :quri #P"data/effective_tld_names.dat")) probably calls that fuction internally somewhere
2:19:47
edgar-rft
have you tried if the same error happens if you evaluate (asdf:system-relative-pathname :quri #P"data/effective_tld_names.dat")
2:19:49
pjb
jmercouris: possibly, the problem here is that defvar doesn't evaluate the initial-value at compilation-time, but at (:load-toplevel :execute) time.
2:20:40
jmercouris
I know the function will work normally on my machine, I'm able to load and use the library just fine
2:21:09
jmercouris
but what is happening is that I'm basically making a monolithic lib using asdf, and I am embedding it into an executable, so asdf is not available in that executable, causing this issue
2:21:54
pjb
And it's a tad difficult to include asdf in the binary, because it may be loaded/reloaded by the rc-file at run-time.
2:25:23
pjb
Ok, so it's for a default path to some data. When you run your binary, that data file (in the quri source directory) may not exist anymore.
2:25:42
jmercouris
right yeah, that's exactly the problem, I wish it would have been just embedded in the code
2:26:20
pjb
You would have either to copy that data file as resources for your program, and then initialize *default-etld-names* at run-time to point to that copied resource file, or reset it to some default value such as "/dev/null".
2:26:55
pjb
Unfortunately, not lisp library programmers have ever generated executable images,so they don't all realize the special situation there.