freenode/#lisp - IRC Chatlog
Search
4:48:01
stylewarning
sjl I guess I’ve programmed into my brain that the code is wrong if IF doesn’t have two branches
4:48:35
sjl
I feel like they should have either gone all the way and let it have 0 branches, or force it to have 2.
4:57:50
fiddlerwoaroof_
And, Xach, I have a fix that makes LINEDIT compile again, does Nikodemus Sivola still maintain his libraries?
5:08:37
beach
fiddlerwoaroof_: Emacs indents the `then' part by 4 positions, and the `else' part (which can have more than one form in it) by 2 positions.
5:11:13
fiddlerwoaroof_
It does that in emacs-lisp mode, but not (for me) when slime is loaded and it's in common-lisp mode
5:12:24
beach
If you are using slime-indentation, then both the `then' and the `else' parts are indented 4 positions.
5:15:18
fiddlerwoaroof_
beach: yeah, I have 4-space indents for both branches when editing .lisp files
5:15:47
shaftoe
fiddlerwoaroof_: looking at linedit pull requests, seems like some have been around for a while
5:17:59
fiddlerwoaroof_
Maybe I can takeover that project? Fare has a fix that I'm planning to merge with my fix
5:43:32
jmercouris
I would like to make a defcommand macro, the only ideas I have to go off of are ones suggested to me from stumpwm, and the other which I can see in lispkit: https://github.com/AeroNotix/lispkit/blob/master/commands.lisp#L29
5:44:21
jmercouris
I was further thinking of prefixing all commands with some sort of namespace like next-command, so that I can provide some sort of m-x completion by being able to query the symbols in a package
5:59:05
beach
More inspiration: https://github.com/robert-strandh/Second-Climacs/blob/master/Command/command.lisp
6:00:19
beach
With this technique, the types of the arguments are kept with the function, so that arguments can be acquired according to the types when the command is invoked interactively.
6:07:36
jmercouris
so as you can see, bookmark-url can be called with arguments as it doesn't need to accept args
6:08:09
jmercouris
that's where you can specify all sorts of things like, completion function to call, any setup etc
6:09:47
beach
Hard to say. I am inspired by the presentation-type system of CLIM II, which I think is excellent in terms of the modularity that it provides.
6:11:03
jmercouris
something I may do now, I may regret a year from now for completely unforseen circumstances
6:11:11
beach
Oh, and it is a bad idea to use #'bookmark-url in define-key. It is much better to use 'bookmark-url in case you want to redefine the function later.
6:11:17
jmercouris
I guess there is no way to prevent large scale refactoring, no matter how clever I might try to be
6:12:29
beach
jmercouris: I recommended you use CLIM, because a lot of the things you are doing already exist in better versions of CLIM. But you rejected that solution.
6:12:44
chenbin
https://pastebin.com/raw/3gAPvJQr ,please help sbcl on windows . I make sure the SBCL_HOME environment variable isn't set.
6:12:58
jmercouris
believe me, I would rather not be writing code for several platforms and reinventing GUI paradigms
6:13:14
beach
jmercouris: If, instead of re-inventing the wheel, you would work on a backend for McCLIM that would work for you, then everyone would benefit, and it would be less work for you in the end.
6:14:00
jmercouris
Even so, I don't see how it would be possible to take an existing webkit port and use it in a different context
6:14:40
jmercouris
Fair enough, I just want to make it clear, it is not because I don't want to, nor do I not see the advantages
6:17:51
jmercouris
fiddlerwoaroof_: I have a feeling that project may be more complicated than you imagine
6:18:08
beach
jmercouris: I think you are wrong about that. You are not alone. There are plenty of people here and in #clim to help you. And if everyone has your attitude, then nothing will ever be shared.
6:18:48
fiddlerwoaroof_
I have a demo app that loads a nib using only lisp code + a tiny bit of objc
6:18:51
jmercouris
beach: I wasn't talking about the port of mcclim, that wouldn't be too bad, I mean the objc-cffi project he is working on
6:20:09
jmercouris
why do you need to implement any cffi at all? are there not c bindings for the carbon framework?
6:20:28
beach
jmercouris: I see this very often here. People work on their own little thing, because they want it done as fast as possible. By doing that, they re-invent things that exist, and the invent things that could have been shared if done right, thereby cutting down the global development effort.
6:21:59
jmercouris
beach: Well, I think my project is a little unique :D I have also contributed a little bit to other projects, particularly to eql
6:23:35
jmercouris
maybe he'd be willing to give you some advice that could save you hundreds of hours
6:24:29
jackdaniel
I feel the urge to chip in in this discussion, but I have nothing interesting to say ;-)
6:26:16
jmercouris
fiddlerwoaroof_: here's a different question, why don't you just want to use CCL?
6:26:34
fiddlerwoaroof_
Because why do something in an implementation-dependent way if it can be done portably?
6:27:42
fiddlerwoaroof_
I'm interested, at least, in seeing how far I can get before abandoning this path.
6:30:01
jackdaniel
you forgot to add, that this another way doesn't met original requirement (of portability)
6:31:00
jackdaniel
it simply is (as far as I understand fiddlerwoaroof_), fact that you don't care about portability is fine by me, but doesn't make a compelling argument to discourage others
6:31:29
beach
jmercouris: Because this is freenode, and it is about free software that is preferable to share as much as possible.
6:31:31
jmercouris
let's not muddy the waters, you haven't actually provided an argument for portability other than "You don't care about portability, but others do"
6:32:14
jackdaniel
jmercouris: actually I didn't want to judge requirements which others put in front of themself. I've just pointed out, that your "easy" solution doesn't meet them
6:32:47
jackdaniel
and missing goals you put before yourself because something *may not* be easy is not very sound approach to solve problems
6:34:12
jackdaniel
good for you, still that misses the point. some people do hard stuff because they find it interesting (to them), not because they underestimate the effort involved
6:34:39
jmercouris
I don't remember saying "people do things that are hard because they underestimate the effort involved"
6:38:36
jmercouris
at any rate, whether x or y, doesn't matter, we have different opinions on the value of portability and the "WHY" but, as long as we are doing our own thing, is okay
6:39:51
beach
People are free to do what they want of course, but I find it sad to see that so many people do their "own thing" instead of trying to collaborate to decrease the global effort.
6:40:15
aeth
jmercouris: At the moment, it's best to try to get something to run on at least SBCL, CCL, and ECL. Why? Well, one reason is that all of the people who wrote code that only works on CLISP 10 years ago are in a bad position in 2018 even if CLISP was a reasonable choice in 2008. You never know which implementation(s) you want to use in 10 years.
6:40:22
jmercouris
this is a tragedy of the open source world, things like quicklisp help, but still
6:40:53
beach
jmercouris: And you think Quicklisp came about because Xach was doing his "own thing"?
6:45:00
jmercouris
but for 99% of users, they are ql:quickload some project and hitting the quicklisp servers
6:45:24
jackdaniel
fact that people trust quicklisp servers is a matter of authority not dictatorship
6:45:24
aeth
Quicklisp avoids about 90% of the problems that the JS world faces because it goes through Xach
6:46:02
jmercouris
if it was a community effort, you'd still have oversight, but something closer to an oligarchy perhaps
6:46:14
jackdaniel
of course it makes him a non-dictator :-) if beach suggests, that some code doesn't follow well-estabilished practice I'll think twice before I stick to this code passage
6:46:57
fouric
(quick minor question, not to distract from ongoing conversation: any suggestions as to where i can find information on hotpatching running CL programs? specifically, I know how to do it in Emacs+SLIME (because that's trivial), i'm more interested in learning how to do things like have the patched program "know" that a function was updated and then run code that updates the associated data structures, too...)
6:47:06
beach
jmercouris: I wasn't talking about access to servers at all. You completely missed the point. I'll drop it now. It's a futile discussion.
6:47:27
fouric
(where would i go about learning about that? i found *two* stack overflow posts, neither of which either have the information i'm looking for nor have links that point to the same)
6:47:47
aeth
jmercouris: Quicklisp would be a dictatorship if it came bundled with all implementations and was the only way to do things in that implementation imo. If Quicklisp was bad, people would use some other thing.
6:48:26
jackdaniel
hm, apparently word "authoritiy" is a false friend in English. In polish "autorytet" means "respect and credibility" (among other things)
6:48:27
jmercouris
aeth: I am not saying quicklisp is bad, nor that xach is a bad dictator, but it is a dictator project
6:49:56
jmercouris
at any rate, we can solve the worlds problems tomorrow, perhaps we can settle tabs vs spaces as well :D
6:50:18
jackdaniel
actually it's not a sign of pessimism but a sign of the fact that people value their time and don't want to spend it on something futile
6:55:02
jackdaniel
after reading into it word "authority" has three estabilished meanings where two of them match polish word
6:57:46
aeth
jackdaniel: jmercouris might have been referencing Python's BFDL. https://en.wikipedia.org/wiki/Benevolent_dictator_for_life
6:58:40
jackdaniel
I know, but it doesn't match well with Quicklisp architecture and the context of discussion
7:11:33
aeth
As far as what's best for the Lisp community, I think what drives people to languages are popular applications, engines, frameworks, libraries, etc. But you cannot control what becomes popular. So I don't think divided efforts are necessarily wasted efforts. Just make lots of very different things that are programmable in Lisp imo.
9:03:57
sigjuice
fiddlerwoaroof_ looks like madeira-port can be made unnecessary for linedit quite easily. https://github.com/LispLima/linedit/commit/c07816b8f29f6a54a13616d6bc71b46715618c42
9:11:56
beach
Question about error reporting in the compiler: A Cleavir-based compiler is meant to be used in several situations, to implement COMPILE, EVAL, and COMPILE-FILE, of course, but also for things like processing top-level forms in an editor so as to give more information to the user.
9:12:05
beach
Now, it seems to me that each such use of the compiler requires a different way of reporting errors. The file compiler might just give a warning, whereas EVAL might signal an error for the same situation. An editor much handle the signal and turn it into some kind of highlight of the buffer.
9:12:11
beach
So, it seems that the core of the compiler should not attempt to determine what the application is. As a result, I am thinking that the core of the compiler should always signal an error and propose one or more restarts. Each individual application can selectively convert the error to a warning and/or invoke a restart.
9:19:39
Shinmera
I'm wondering whether it would be useful to automatically create subclasses for each variant of error, and then allow the context to change-class the condition to the appropriate subclass. (Yes I know this forces conditions to be classes)
9:19:42
beach
Cleavir is also meant to be implementation customizable, so the core can't even make a decision between error, warning, style warning, etc. in all cases, because different implementations might want something different.
9:21:14
beach
I do need different types for each situation so that client code can selectively handle.
9:22:18
Shinmera
If you could just change-class to the appropriate variant, that would preserve identity and circumvent having to transfer the data
9:23:31
beach
It would. But it would only be moderately useful. Conditions are signaled in exceptional situations, so there is no performance problem with the transfer. Perhaps you see the use for preserving the identity, but I don't immediately see it.
9:23:52
Shinmera
The data transfer bit makes me iffy because it means a change in cleavir's condition definition means you need to update everywhere you transfer this data.
9:52:33
TMA
if the conditions are part of the interface (API) then a change to the conditions is a change to the API that the client has to deal with as it is the case with other API changes
9:55:24
Shinmera
If you implement it the way I illustrated, the amount of changes that need to be made is far less than if you forced transfering.
9:56:11
TMA
which can be easily done with one more level of indirection -- the changeable part would be in some other object that would be held in a nonspecific DATA slot -- with the transfer you can transfer the whole data object unchanged
11:10:11
phoe
Is there some variant of SUBSEQ that does not copy the data but creates displaced arrays instead?
11:56:35
schweers
Is there an easy, portable way to find out the values of C “constants” like O_TMPFILE?
12:00:02
shka
i should set it in the session, like this? (setf (session:field 'landing-page) (uri-to-url "dzienniczek/entry" :representation :external))
12:00:17
Shinmera
schweers: In general unless you're writing a C compiler entirely there is no way other than just running the C compiler on a sample program.
12:00:54
Shinmera
So the "portable" way is to emit a C program that prints the constant, call a C compiler, and run the resulting executable.
12:43:09
schweers
I’m trying my hands at it, but I just realized that my problem is not cffi-grovel, but is on the C side
12:43:45
schweers
I want to expose O_TMPFILE to lisp in order to open(2) temporary files. Yet I can’t get a C program to see the file, so my problem is not with cffi ;)
12:47:25
_death
"The O_DIRECT, O_NOATIME, O_PATH, and O_TMPFILE flags are Linux-specific. One must define _GNU_SOURCE to obtain their definitions."
12:51:15
pjb
schweers: I have already implemented a C pre-processor in CL, so you could use it to parse C headers and find the values of such C macros.
12:52:07
pjb
schweers: https://gitlab.com/com-informatimago/com-informatimago/tree/master/languages/cpp
12:53:52
pjb
The C program solution is as risky as your own parsing of the header: you need to pass the right options and have the right definitions established in the C program just as in your CPP process (this _GNU_SOURCE macro, and others).
12:54:19
pjb
It's also the same problem when you use different C compilers on the same system. They may not all interpret the headers the same way…
12:54:44
pjb
(you can have a compiler generating 32-bit code, and another generating 64-bit code, or a cross-compiler, etc).
12:56:13
pjb
Also, there's one thing that is not handled: #pragma; notably structures in headers using #pragma pack won't be generated correctly by swig (and I wonder about cffi-grovel, I never had much success with it).
13:08:30
Shinmera
murii: There are. https://github.com/lispgames/lispgames.github.io/wiki/Common-Lisp
14:11:41
Xach
Hmm, I haven't used sb-sprof in a while, I wonder if it's always shown things like "foreign function __lxstat" in the reports.
15:39:22
sjl
is https://github.com/nixeagle/cl-irc/blob/master/trunk/utility.lisp#L127-L130 a portable way to implement read-byte-no-hang?
15:40:10
pjb
Which is not to say that it will work as you want. But this is how you can implement it conformingly.
15:40:59
pjb
Notably, the description of LISTEN talks of characters, while input-stream is specified as a stream, not a character stream.
15:41:21
pjb
This is an inconsistency, or at least, an underspecification: it says nothing about bytes for binary streams.
15:41:57
pjb
It also talks of interactive streams. So it may be good for binary socket streams, but perhaps it always returns T for file streams.
15:44:16
sjl
Is there an SBCL-specific one? I could live with that, but I can't seem to find one in the manual.
15:48:04
sjl
Hmm, it makes a decent argument there that (listen binary-stream) should always return nil.
16:14:39
marioxcc
Hello. Is there some Common Lisp implementation that is suitable to call *from* C code?
16:15:02
marioxcc
SBCL does not seem to be (it can call C code, but apparently not be called from C code).
16:16:12
jackdaniel
in fact you may define callbacks in SBCL to as far as I remember (so they may be passed to C world)
16:17:29
marioxcc
Xach: I am considering contributing to gtk-gnutella. I think it would benefit from rewriting a part in Common Lisp (or another high level language).
16:18:28
jackdaniel
phoe: CFFI is "just" a portability layer, if implementation can't "do" callbacks neither cffi will be able to
16:19:44
jackdaniel
phoe: that is not correct either - implementation may be supported by cffi in various degree, so if you call defcallback from cffi it will simply error out
16:20:00
jackdaniel
I'm sure SBCL has it implemented in CFFI, but it doesn't make that statement true in principle
16:20:17
shka
I need to perform join or two, i was wondering if i can somehow neatly express that using Radiance data-model module.
16:20:44
Shinmera
The database interface is very minimal, and doesn't do joins because some DBs don't do joins.
16:21:39
Shinmera
If you need more capabilities, you're better off accessing a specific database like postgres directly.
16:22:09
Shinmera
Naturally you can also do joins and stuff in your application if you need to. There's tradeoffs for everything.
16:23:27
marioxcc
I want to rewrite a part of a C program in Common Lisp to make it more easily manipulatable. Is ECL my best option?
16:24:14
jackdaniel
I can't say if its your best, but it is a good option. you may even embed CL in your application to connect to it at runtime
16:24:17
shka
Shinmera: let's say that i only need one-to-one relationships, does this makes things slightly easier?
16:25:11
jackdaniel
what is the best option for you depends on various factors (and its not that all are technical - taste is an example of non-technical factor)
16:25:22
marioxcc
Shinmera: If I know correctly, CFFI serves to call C from a Common Lisp implementation, but not to call a Common Lisp implementation from C.
16:25:30
Colleen
shka: Macro database:query https://shirakumo.github.io/radiance#MACRO%20DATABASE%3AQUERY
16:26:16
Shinmera
marioxcc: It can create callbacks, which you can stuff into C variables and then call from C out.
16:26:21
jackdaniel
marioxcc: I don't know, just asserting its the best option wouldn't be smart on my side
16:27:15
jackdaniel
if you have any questions regarding ecl drop them on #ecl channel (less traffic)
16:27:43
Shinmera
shka: Joins are a pain point, I know. I've been thinking about adding a mechanism to it, but it would increase complexity of an implementation for the interface quite a bit.
16:42:03
Shinmera
https://github.com/Shirakumo/radiance-tutorial/blob/master/Part%208.md#how-do-i-change-the-implementation-of-an-interface
16:43:58
Shinmera
The configuration variables for i-postmodern are here: https://github.com/Shirakumo/radiance-contribs/tree/master/i-postmodern