freenode/#lisp - IRC Chatlog
Search
11:36:35
flip214
how would a CFFI callback function refer to variables in some outer lisp function? I've got a void* available that gets passed around, but I see no mention in CFFI about getting a closure or so.
11:53:39
Shinmera
flip214: you'll want to keep a table of your own that lets you get an object from that pointer/whatever.
12:06:25
lxbarbosa
Python 3.8 is out and now it almost is becoming a subset of Lisp :D (positional only parameters and assignment expressions)
12:13:00
flip214
Shinmera: hmmm... no. CFFI could allow to use a void* to "get back" to the lisp closures (as long as the implementation supports that too, of course)
12:41:59
p_l
theoretically it could provide callback to a closure in general, but yeah, implementation support needed
15:32:30
ebrasca
p_l: Here what I have done for now https://github.com/ebrasca/Mezzano/blob/ppc64le/compiler/lap-ppc64le.lisp
15:35:39
p_l
usually, for stack, you just declare some location (usually register) to hold "top" of the stack
15:36:31
p_l
when you want to push something on the stack, you increment/decrement (depends on ABI) that register, and write data into new location
15:38:49
p_l
(add *stack-register* *stack-register* 4) (STORE *stack-register* #|Here used for its value as address!|# #XDEADBEEF)
15:47:19
p_l
https://www.pvk.ca/Blog/2014/03/15/sbcl-the-ultimate-assembly-code-breadboard/ <--- this shows simple FORTH implemented into native code, including actually loading instructions into memory etc.
15:47:36
p_l
it still uses SBCL's VOP framework, so it might be not exact, but it might shine some light
15:48:45
ebrasca
I have read this https://github.com/ebrasca/Mezzano/blob/ppc64le/compiler/backend/x86-64/codegen.lisp codegen.
16:08:45
TexadimirLeanin
If I already know about c++ and c and have messed with emacs for a couple years now, how long does it take to learnt he language basics of elisp?
16:09:08
TexadimirLeanin
can you learn the language syntax and concepts of elisp in a couple days or is this a longer journey?
16:09:57
Josh_2
TexadimirLeanin Sorry, this is the IRC channel for Common Lisp, not elisp... but lisps syntax is pretty different, it won't take long to use it but I'd say it will take longer to 'get it'
16:11:24
p_l
I recommend sticking for few weeks writing some programs, then figuring if it's still a problem. and by weeks I mean weeks measured by "every weekday I wrote a small program"
16:25:45
p_l
TexadimirLeanin: the point is to spend some time immersing in the language, to verify that first impression (which is invariably based on existing programming experience) doesn't cloud perception
16:32:41
TexadimirLeanin
p_L Josh_2 i see, this is what i suspected from what i could gleam off of my emacs config file...
17:15:03
thijso
How can I substitute a different function only if that different function (in a different package) is defined? I tried something like: (when (find-package 'dht-test) (setf (symbol-function '%debuglog) #'dht-test:%debuglog)) but then it complains about there not being a package called dht-test during compilation. This is in ECL, btw
17:15:51
Bike
instead of #'dht-test:%debuglog, (fdefinition (find-symbol "%DEBUGLOG" "DHT-TEST")), i guess
17:16:56
thijso
I was looking how I could do (symbol-function .. in a certain package, but that doesn't exist. Thanks, Bike
17:24:46
Bike
yes, fdefinition is like symbol-function except that it can also deal with setf functions.
17:35:38
quantico
hi, i understand this may be the wrong place entirely to ask, but does anyone have an idea on how i may run this lisp program?
17:36:06
quantico
it's apparently a new dialect of lisp called Bel "written in itself" but i have no idea how to make it run. o_o
21:21:41
LdBeth
> Programmer B feels honor-bound to retain the existing abstraction, but since isn't exactly the same for every case, they alter the code to take a parameter, and then add logic to conditionally do the right thing based on the value of that parameter.
21:24:50
aeth
CL isn't a particuarly noun-based language, and deep inheritance hierarchies don't seem to be too common. The last time I used inheritance at all, it was for gray streams
21:27:00
aeth
Shinmera: Compare an average CLOS system to an average Java or C++ system. In the latter, you're far more likely to have to rely on flow charts of interactions between heavy inheritance-using classes, while in the former you're probably going to be working mainly with generics that are almost indistinguishable from regular functions. And quite often you're supposed to use :before/:after/:around on those to customize, instead of inheritance.
21:28:01
aeth
Shinmera: The main place where I've personally used inheritance heavily is in the way trivial-gray-streams works (which might be one reason why they're not universally liked), and I suspect CLIM is similar but I haven't used it yet.
21:28:56
aeth
What I mean about noun-based is that in Java/C++/etc., your APIs are often noun-oriented, while even in CLOS-heavy CL, your APIs are probably still verb-oriented (in this case generic functions rather than regular functions)
21:29:16
Shinmera
I'm more confused about your assumption that CLIM is the only real user of inheritance hierarchies.
21:30:07
aeth
Shinmera: I didn't say "the only real user", I said "the major use" as in "the most elaborate". I haven't read any documentation as elaborate as CLIM for anything else quite like that, but feel free to show me something else.
21:30:26
aeth
It has been a while, though. Is CLIM composition over inheritance? I would be shocked.
21:31:46
jackdaniel
protocol classes indeed are meant to be inherited from, but that is more a signal, that this class implements said protocol
21:31:55
aeth
If CLIM doesn't count then it's literally just gray streams as far as elaborate inheritance goes, at least what I've encountered personally.
21:32:05
jackdaniel
unless you inherit from standard-foo (instead of the protocol class foo), you need to implement foo's protocols all by yourself