freenode/#lisp - IRC Chatlog
Search
5:11:07
ealfonso
i'm annoyed by all the "package X also exports/shadows the following symbols..." warnings/errors when refactoring... can slime help me make refactoring easier?
5:14:51
ealfonso
I tried uninterning all the symbols, which worked. just wondering if there's a way for slime to do it for me
5:19:51
PuercoPop
(C-c x exports a symbol, and when called with a negative argument it unexports it)
5:42:49
aeth
I usually just restart SLIME with M-x s-r-i-l when I change package definitions. It's (for me) faster than messing with uninterning, except maybe if it's just one.
7:02:19
panji
hi everyone, please help me with this problem. if i have class x and y, both class have slot a and b, is it better to create abstract class with slots a and b or create class a-mixin and b-mixin ?
7:11:56
theemacsshibe[m]
are there any garbage collectors written in lisp (or anything remotely readable) i can glean from?
7:23:05
theemacsshibe[m]
i'm just looking to make a tri-color GC since mark-and-sweep is kinda boring and isn't particuarly usable on a C64 with a slow 6502 and quite a bit of memory
7:36:22
xificurC
why not just (malloc :as-much-as-the-sytem-allows-right-now) and write gc-free code?
7:39:27
jackdaniel
xificurC: because if function conses anything and you don't clean up the garbage, you'll run off the memory eventually
7:40:18
xificurC
no. if you don't clean up the garbage you and you run off memory you obviously need more memory! It's so cheap now!
7:41:25
xificurC
seeing the java projects here it's fun to watch how little actual work a server is able to perform
7:42:44
theemacsshibe[m]
ooh i know, if we turn that off we can finally compete with --crap-- industry standard/grade languages like C++ and Rust
7:43:49
theemacsshibe[m]
must be something like SB-SUPER-VERY-SECRET::PUT-LANGUAGE-BACK-30-YEARSP /s
7:47:03
flip214
jackdaniel: I believe the originally designed lisp didn't, because it was just a theory --- and that can easily assume an unbounded tape...
7:48:22
theemacsshibe[m]
pedantically i don't think lisp had a "tape" since it wasn't a turing machine model
7:49:10
ZigPaw
Wikipedia quote: "Garbage collection was invented by John McCarthy around 1959 to simplify manual memory management in Lisp". So maybe the first one didn't had, as it was "on paper" but it got it pretty much quickly.
8:08:44
beach
theemacsshibe[m]: It is impossible to write a garbage collector in portable Common Lisp. You need direct access to memory. In fact, I don't think you can write it in valid C either.
8:09:43
White_Flame
certainly the "brains" of a GC could be written in CL, with the actual accesses being a clearly demarcated api
8:10:01
theemacsshibe[m]
well it might not be common but if your language exposed its heap and tagging functions there's a start
8:12:59
theemacsshibe[m]
it's not very good though and probably allocates a byte to hold the tag since i used an enum
8:14:38
on_ion
beach: that is a very strict standard i think, integers and pointers are converted often
8:15:08
on_ion
although days ago emacs just converted to pointers instead of integers for their 'lisp object' types
8:15:09
beach
on_ion: That's why I am saying that you have to rely on undefined behavior in order to make it work.
8:16:57
theemacsshibe[m]
anyways this is a disgusting scheme imitation which is in no way safe or usable and shall never be distributed even though it's GPL3+
8:18:38
on_ion
(ptr1 + ptr2) - ptr3 = ... have you guys used C at all? =) what goes on in our heads and what the compiler accepts are two different things
8:19:18
beach
on_ion: And what the compiler accepts is also different from what the standard allows.
8:20:36
theemacsshibe[m]
anyways "principle of least astonishment" was what i was trying to get at with using unions
8:22:50
jackdaniel
so given newer standard pointers may be handled without relying on undefined behavior (just syaing)
8:23:00
beach
So I find it an interesting observation that, if you use C as a programming language for applications, it is nearly impossible to use because you have no automatic memory management, and you can't re-program assignment the way you can in C++, and if you use C as a programming language for system programming, then your code must be written to have undefined behavior.
8:23:39
White_Flame
if you're doing system programming then all what matters is the environment guarantees
8:24:13
theemacsshibe[m]
my VGA driver has the line: struct vgac* terminal_buffer = (struct vgac*) 0xb8000;
8:24:20
beach
White_Flame: I am just saying that things like operating systems and device drivers are not written in "C", but in a particular implementation.
8:24:52
shrdlu68
I find the dimorphism between "system programming" and the rest of programming itself interesting.
8:32:29
theemacsshibe[m]
i think any attempt at making C into something somewhat high level is a bad idea
8:33:29
theemacsshibe[m]
IMO a lot of C comes from pointer twiddling and low level stuff so trying to implement anything high level or non-C-like while still retaining C characteristics will just feel wrong and carry bad habits
8:35:34
theemacsshibe[m]
ACTION uploaded an image: gc.png (23KB) <https://matrix.org/_matrix/media/v1/download/matrix.org/FzCQoRFdDDnkrjYGESwJWisd>
9:22:05
theemacsshibe[m]
my plan of selling music to rent out servers to run fancy web apps to get out of home quickly isn't working well
9:25:53
beach
Sorry, I thought you hinted that you are in Australia, so I suggested organizing a Lisp Symposium there.
9:28:07
theemacsshibe[m]
also i don't know of many people who use lisp here, let alone australia-specific companies
9:41:41
schweers
making fun of people? not as far as I’m concerned. although I do pitty some other people. I’m also sure they pitty me.
9:59:44
xificurC
I started with a 100 line macro that was a `(lambda (x) (let (many-vars-here) (labels (many-functions-here) ...))). Switched it to a function and pulled out all the internal functions and variables. Now I have many small definitions almost all taking no arguments but modifying 7 toplevel specials
10:00:26
xificurC
it's funny how one can read and read about good design and still produce crap, constantly
10:02:01
xificurC
now I see thought that 1 should be toplevel, 4 should be grouped into 1 object and be an argument where needed along with the other 2. :(
10:02:49
xificurC
do you guys write more top-down or bottom-up? I can only make things nice after writing them out in horrific ways like described here
10:03:49
schweers
I try to write more in a bottom-up fashion, but I’d be lying if I claimed that it always turns out right. That’s okay though (I think).
10:04:32
schweers
bottom-up has the advantage that you can test your lower level stuff and actually run it, as opposed to coding top-down and having to mock everything out in order to test it.
10:05:09
xificurC
this was bottom up, I just can't see what will I need before writing it all out first
10:05:43
xificurC
so, not sure if I'm an idiot with regards to design or if this is the normal evolution
10:05:43
schweers
that’s okay. Make sure to try and make it better when you know more about your problem
10:06:52
schweers
no, I run into similar problems, so I’m very sympathetic to your kind of situation.
10:07:33
xificurC
I like the fact that I don't spend days designing but it just sort of pops out from all the hacking
10:08:36
schweers
As we’re wandering off-topic anyway, I’d like to mention that the book “Test-Driven Development by Example” was a real revelation for me. Also it made me feel like a moron, but that’s another story.
10:09:18
xificurC
one more question, thinking ahead now - when you have a class/struct and it is the only one using a function do you make it defun or defgeneric?
10:10:45
schweers
I may be differing strongly from other peoples practices, but I mostly use structs and defuns. I do this for performance reasons, as performance is quite relevant in my current work. Other people may suggest you use classes and generic functions until you can prove they are causing performance issues.
10:11:42
schweers
partly java, partly python. but try not to hold that against the author. you have to take some of the writing with a grain of salt, for that reason.
10:12:13
schweers
He talks too much about classes, objects, and methods than I care for, but hey, you can overlook that pretty easily.
10:12:14
White_Flame
schweers: I use generic functions with structs fairly often. You don't have to go to defclass to get their benefit
10:17:27
schweers
I really don’t get why the majority of our industry seems to think that multiple inheritance is inherently (hehe) wrong.
10:25:42
schweers
people are starving, kids are being forced to fight in wars, but most languages don’t have a proper notion of MI.
10:28:44
schweers
back to the previous topic: I wonder where one could best confront the majority of programmers with these ideas. Talking in here will not convince anyone, it’s just preaching to the choir. Taking over -- say -- a java IRC channel would probably be viewed as rude.
10:29:37
White_Flame
the majority of programmers undertsand what is possible to be constrained to what is known
10:29:56
jackdaniel
write a nice essay which makes the benefits obvious and post it on a few communication channels
10:30:13
White_Flame
most programmers don't see their coding problems as problems, but rather the normal issues that programming deals with in the course of things
10:30:29
jackdaniel
some people do that already, it is not perceived as rude and sometimes it gets somewhat popular
10:31:03
White_Flame
also, if you're not working on difficult problems, you don't need above-average solutions
10:31:16
jackdaniel
if you ask how to force people to agree with your ideas, well: hypnosis isn't an option, because it doesn't work that way – you may only suggest something
10:31:47
schweers
I don’t work on something which naturally lends itself to lisp, but nevertheless I’m very grateful for being able to use lisp for the project.
10:32:46
schweers
well, no, but then: is it “required” to use something “better” than assembly or C?
10:32:51
shka
schweers: i would argue that python web developers who just maintain some crappy django web page do not care
10:35:55
jackdaniel
given a passionate programmer who knows (say) python and does cool stuff with it, starting with: your language of choice is shit, CL is best programming language which has all it and more, and if you don't agree with me that MI is cool then you are below-average soldier programmer without passion
10:36:04
shka
if you want to CL become more popular and have more opportunity to earn money with lisp, try to address this problem
10:36:12
shrdlu68
"There they stand", he said to his heart "There they laugh: they do not understand me, I am not the mouth for these ears" ~Zarathustra
10:36:42
schweers
jackdaniel: I guess I understand where you are going with this, but I’d like to go on the record to say that I did not mean that. And I agree with you.
10:37:57
jackdaniel
I mean that putting yourself in a superior position (e.g I'm going to convince Java programmers, that CL is *better*), isn't a good way to start a conversation
10:39:27
schweers
I learned (a little bit of assembly), C, C++ and Java in school. The rest I learned on my own time
10:39:30
jackdaniel
and the thing is that this urge to believe unconditionally that *your* choice is the optimal one (i.e CL is a superior language) is tempting, but most probably a fallacy of sticking to known things
10:40:17
jackdaniel
I write in CL because I *like* it, not because I think it is better than (say) Scheme, Forth, C# or Java
10:41:14
schweers
shka: I did for the longest time too, and thus viewed all lisps as being roughly equivalent. I have come to like CL much much more than other lisps.
10:42:01
schweers
shrdlu68: I must admit that I did not read the book, although I have it at home and tried to. But Nietzsche has a really weird way of writing.
10:42:12
jackdaniel
ACTION said what he wanted to say, getting back to cltl2 env access implementation for ECL
10:44:26
shrdlu68
"Too long have I lived in the mountains, and too much have I listened to the streams and trees: now I talk to them as to goat-herds"
10:44:41
jackdaniel
ACTION notes (even if he already closed this window), that his point was the internal feeling of superiority of the speaker what is deterring, not language advocacy itself
10:46:45
shka
jackdaniel: well, your internal feelings may or may give some impression, you may be just misinterpreted as well, especially if you are not perfectly socially calibrated
10:47:58
fm4d_
Hi, could someone give me an advice how to create keyword symbols? For example I would like to convert '((test . 1) (test2 . 2)) into (:test 1 :test2 2). I've explored the symbol-making functions but none of them seems to be able to do this. Thanks :)
10:48:58
_death
fm4d: a keyword symbol is simply a symbol in the package named "KEYWORD".. intern takes a package designator
10:55:52
schweers
if you really want a symbol which has a lowercase name, you can say '|sym| or (lengthy) '\s\y\m
10:59:31
fm4d_
btw is it in accordance with clisp style to generate keyword symbols dynamically like that?
11:04:19
loke
the blang package name is equivalent to KEYWORD, so ::foo is equivalent to keyword::foo
11:04:50
loke
schweers: Also makes sense, since I can't think of any any actual use case for writing a keyword with doube :
12:38:48
xificurC
I'm running slime and compiling definitions with slime-compile-defun. Now I get a condition of "The value NIL is not of type STRING" but the top of the backtrace shows my function which doesn't even take strings. I guess something it passed nil to something else. Why can't I see the call beneath it? :(
12:58:46
beach
xificurC: Oh, it could be that your implementation is doing tail merging, so that the call below it disappears.
13:00:36
schweers
beach: how do you set optimization qualities in general? do you only set them in .sbclrc and never change them?
13:01:45
schweers
I was thinking I’d like to have rather aggressive optimizations for production, but not for debugging and/or testing. And I’m not sure how to properly do that
13:02:26
beach
Correct. At least not at that level. I design good data structures and algorithms instead.
13:04:25
schweers
random9899: do you recall in which chapter? I don’t have the dead tree version on me right now
13:07:14
schweers
hm, I guess in 7.7 Writing and Benchmarking Compilers. Not freely available. I hope I’ll remember to look at that tonight when I get home.
13:27:42
random9899
tho you also have to consider other stuff like some declarations getting only considered for compiled code etc....
13:28:48
random9899
and despite their name with progn, they use a (locally, cause progn does not accept declarations
13:32:28
random9899
ya with them schweers you can enable fast compilation at some point and go back to safe compilation at another point in your code....
13:34:27
random9899
but since it's a macro and macros are not guaranteed to be expanded before compilation, you'll really have to couple normal macro stuff (for runtime) with compiler-macro versions of those (for compile time)
13:34:38
schweers
uhh, I just realized something. If I say (declaim (optimize (debug 3))), does the effect it has stop at the end of the file I’m currently compiling/loading/executing?
13:35:08
schweers
It seems to me, the answer must be no, as there would otherwise be no point in putting such a form into .sbclrc
13:37:10
random9899
schweers afaik some stuff does not get effect at runtime, probably the compiler decides to ignore some settings
13:38:10
schweers
so (declaim (optimize (safety 3))) (locally (optimize (safety 0)) (defun really-well-tested ...)) (defun not-so-well-tested ...) does pretty much what I expect: set safety to 0 for WELL-TESTED, but back to 3 for the rest (i.e. NOT-SO-WELL-TESTED in this contrived example)