freenode/#lisp - IRC Chatlog
Search
2:08:29
Nilby
I find it amusing that there's awk in lisp and lisp in awk, but a df in Lisp uses C awk.
3:56:24
beach
For example, calling COPY-LIST on a circular list might do that. At least, the standard allows for it to happen.
3:57:35
asarch
I am using cl-cffi-gtk to create the window using a Glade template file to CRUD the data from a local PostgreSQL cluster using Datafly
3:58:42
asarch
Since I am learning the Japanese language, I was copying/inserting some grammar information into the cluster using this interface
4:01:04
White_Flame
and same as beach, I have no idea about the effects of FFI on the lisp heap. Assuming that any malloc stuff is outside lisp-managed memory space, I wouldn't actually suspect it
4:01:34
asarch
Well, every time the data was inserted the CPU % use increased to the infinity and beyond
4:04:14
asarch
top -d 1 shows the % used of the processors every time I "saved" the new data using this GTK+ application
4:05:47
no-defun-allowed
asarch: Do you have an idea of how much data you are loading into Postgres?
4:06:20
beach
White_Flame: I am sure there is. I am no longer directly involved, but I am sure jackdaniel has the ambition to keep it up to date.
4:07:35
beach
It is very active. I guess we can check with jackdaniel when he comes around. He probably spends the weekends with his family.
4:08:20
asarch
no-defun-allowed, actually the data is small posts from a Facebook account like: https://pastebin.com/SHtrRUpM
4:23:39
beach
asarch: Because of the differences in semantics between Common Lisp and the foreign language, it is always going to be difficult to manage a combination of the two.
4:23:52
no-defun-allowed
There aren't really good and evil in programming, but debugging C is much more annoying than debugging Lisp.
4:23:56
beach
asarch: Typically, the foreign language does not have automatic memory management, for instance.
4:25:17
beach
asarch: And think about debugging? If you use something like GDB, adapted to the foreign code, you won't understand what is going on when your code is executing in Common Lisp. Conversely, even if you have a fantastic Common Lisp debugger, it won't be able to inform you what is happening when code in the foreign language is executed.
4:26:56
asarch
I also wrote a web application using Caveman2 for the same cluster and some times when I refresh the list of the notes I get those messages
4:28:30
asarch
Those annotations are like this: 彼女はいつも新聞を読みます。 kanojo wa itsumo shinbun o yomimasu She always reads the newspaper.
4:29:32
no-defun-allowed
I think this happens when the web browser drops a connection when Hunchentoot didn't expect it. Though Hunchentoot usually logs it and carries on - does Caveman2 change that behaviour?
4:31:59
saturn2
if you call (hunchentoot:send-headers) to send the response directly to the output stream, you have to catch any stream errors yourself otherwise they will invoke the debugger
7:34:49
moon-child
writing a lisp, haven't implemented ,@ yet. I hadn't ever thought of doing this before (no call for it), but you can replace `(a b ,@c) with `(a b . ,c)
7:35:10
moon-child
(though of course, if the thing being spliced is in the middle of the list, there's no recourse)
7:39:17
moon-child
heh, no. Cl is large enough that most of my time would probably be spent reimplementing utility functions and macros rather than doing anything interesting
7:42:56
moon-child
I have been writing a list processing programming language, and in it I haven't...
7:44:38
beach
In Common Lisp, that construct is handled by a reader macro generating some special form.
7:45:26
beach
Er, let's not call it a "special form". Some data structure not intended for evaluation.
7:47:55
beach
Let me just say this: Given the number of libraries we have already created, and the ones that will exist soon, it should be much easier than it used to be to create a Common Lisp implementation, if that's what you want to do.
8:00:09
moon-child
SICL is a really great project. I think I might also have slightly different goals from cl with this project. Not entirely sure yet
8:00:52
Nilby
I must have forgot. Is there some way to turn a list into a function without eval, compile, or macro around defun?
8:01:43
Nilby
Like I want to turn l2 into a function: (let* ((l1 '(+ 2 3)) (l2 `(lambda () ,l1))) l2))
8:03:13
Nilby
no-defun-allowed: Hmmm. I guess compile and eval seem heavy for a tiny anonymous function.
8:04:10
no-defun-allowed
In this specific case, you could make it (let ((closure (lambda () (+ 2 3)))) (lambda () (funcall closure))).
8:05:33
no-defun-allowed
Using a chain of closures works well enough most of the time. (For example, CL-PPCRE uses a chain of closures to basically produce a non-deterministic machine which finds matches.)
8:08:46
Nilby
I guess I'm thinking of some old days where it just stored the lambda list as the function binding.
8:10:36
Nilby
Tangentially related, I was surprised by sbcl telling me this: "Objects of type COMPILED-FUNCTION can't be dumped into fasl files."
8:10:48
saturn2
that's pretty much what sbcl will do if you set sb-ext:*evaluator-mode* to :interpret
8:12:05
Nilby
saturn2: That's what I was thinking I guess, but if I do that then I'm in non-portable land.
8:16:27
no-defun-allowed
Really, if the forms you generate are similar enough, just use a chain of closures. If not, then compiling wouldn't hurt.
9:02:25
lukego
Hey how do you normally do a (list-of FOO) type? is there anything like that in e.g. alexandria or serapeum that's standard and idiomaic?
9:04:24
beach
He defines something called a "regular type expression", or RTE, that can express that kind of stuff. But it uses SATISFIES, obviously.
9:04:40
lukego
I will, but to be clear I mostly want to write (list-of FOO) in the source code for clarity, I don't mind if the impl would be e.g. with SATISFIES or just (deftype list-of (x) 'list)
9:07:05
lukego
that library looks very interesting (https://github.com/jimka2001/regular-type-expression) but looks like it's excluded from quicklisp due to build problems? https://common-lisp.net/project/cl-test-grid/library/regular-type-expression.html
9:07:37
lukego
yeah. I'll probably use SATISFIES although I understand that people generally resist this so wondered if there was another popular formulation
9:29:47
lukego
but for now I've written (deftype list-of (x) (declare (ignore x)) 'list) and this is ample for current purposes i.e. to avoid losing information while transcribing from an EBNF grammar into lisp structs.
9:30:34
lukego
I also added a similar (nyi-of X) that translates into T but captures that I need to define a proper X type later.
9:48:30
lukego
(I'm trying to transcribe an EBNF grammar for LLVM IR into Lisp structures - with serapeum DEFUNION - and trying on the one hand to only do the few bits I'm interested in right now while on the other hand keeping track in a disciplined way of what I'm skipping using information-preserving stubs.)
9:54:09
phoe
the main issue with gensyms is that it's impossible to preserve their identity across FASL-dumping
13:56:20
gendl
hey, I’ve been helping my son with his university C++ class. He recently decided to give Emacs a try, so I helped him follow the professor’s set up instructions to install company-mode and flycheck mode. These two modes pretty much makes emacs emulate the good parts of vscode, for c++ at least.
13:57:00
gendl
Then I noticed that company-slime mode is a thing, and it looks pretty active. I’m eager to give it a try. Any caveats there?
13:57:48
gendl
and how about flycheck-mode for CL? Is that a thing, or is there a potential for something like that?