freenode/#lisp - IRC Chatlog
Search
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?
14:01:17
gendl
oh is that what spacemacs is. Sorry, should’ve looked it up. Are used to be a vi user years ago, and I can still use VI in a terminal when I need to, but my fingers have pretty much been trained with native Emacs editing commands now
14:01:28
spacebat2
spacemacs, doom-emacs, there are several "config distributions" that are good to get started
14:02:12
spacebat2
also consider trying out sly, which is a fork of slime that has diverged significantly
14:02:48
gendl
well, I have a custom extension to slime called glime, I’m not sure if that would work with sly
14:03:07
phoe
spacemacs is just a collection of melpa packages that are preconfigured to work together, plus some custom configuration mechanisms
14:03:46
phoe
slime-company should work fine wherever you have slime loaded, it's not like it has a spacemacs dependency
14:04:51
gendl
I am a complete noob with emacs lisp, glime was developed by a few consultants we hired over many years. At some point I’m gonna have to learn How it works, to be able to maintain it — or find a consultant who is willing to do same
14:08:10
gendl
glime shows you The possible completions for gendl, which typically are object messages, it’s kind of a Smalltalk kind of thing
14:14:25
gendl
glime just piggybacks on slime’s completion mechanism so we’ll see — if it’s set up properly, I’m supposing it should “just work” with slime-company. But I certainly won’t be surprised if some tweaking will be necessary. In which case I might be back here begging For help or asking if any slime experts would be interested in a small paid gig
14:16:35
gendl
Because I’m pretty sure we will make gendl look more attractive to the kids these days If it is mimicking their shiny “modern” IDEs such as vscode — and slime–company looks like a step in that direction.
14:21:51
gendl
I just noticed there is a separate #slime channel in here. I suppose any more talk on this thread could move over there
14:28:21
pjb
you use the lisp syntax. Have you have a look at Objective-CL, my reader macro to use a Objective-C-like syntax: [objet messageWith:[ref getArgument] andWith:(+ 2 3)]
14:29:33
pjb
Using a reader macro let's you define syntactic scopes where you may use identifiers without shadowing similar named symbols.
14:30:23
pjb
[super sameMessage] and [self otherMessage] are such examples (super and self are just identifiers, not interned as symbols).
14:32:00
gendl
We would have to work out some kind of licensing deal with you before I can truly take a look at your stuff or consider it, because I believe it is all AGPL licensed. And we do dual-license Gendl as Genworks GDL which is used for closed-source proprietary distributions.
14:34:49
gendl
Gendl itself is also AGPL licensed, which I suppose makes it totally compatible with your stuff license-wise, if people are going to use it according to AGPL terms. So a third-party Who is not concerned about being exposed to these code bases could happily take a look at what you’re talking about and see if there is potential there.
14:53:16
gendl
OK, perhaps we can discuss potential terms in due course if it appears mutually advantageous to do so.
14:54:39
pjb
The lower layer would have to be implemented for gendl. Do you need only the Objective-C smalltalk syntax?
14:54:47
pjb
There is also an alternative library: https://common-lisp.net/project/cl-objc/cl-objc.pdf
14:58:26
gendl
pjb: my guess is that gendl could benefit from many of your packages. Objective-CL may or may not be one of them. But, our message passing syntax, especially for messages which take arguments, Is