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