freenode/#lisp - IRC Chatlog
Search
0:26:20
mister_m
using slime, is there a way to recompile a function in a manner like C-c C-c, but with `(declare (optimize debug))`? I can add that to the function and recompile as normal, but I am wondering if slime can do this for me.
0:27:26
no-defun-allowed
See the documentation (i.e. when in a Lisp buffer, type C-h k C-c C-c): "With (positive) prefix argument the form is compiled with maximal debug settings (‘C-u’). With negative prefix argument it is compiled for speed (‘M--’)."
1:38:12
nij
minion: memo for theothornhill: I've read the log again.. and I melted. Thanks so much :-D Let me know if I can help any.. (beware i'm just a noob)!
1:38:36
nij
minion: memo for beach: Good news from theothornhill! Seems like UltraSpec is going to come back alive :-D
3:04:19
minion
beach, memo from nij: Good news from theothornhill! Seems like UltraSpec is going to come back alive :-D
4:07:31
nij
How is an ffi designed? In particular, if I want to call a foreign abstract object (and play with it) in lisp, what should I do? Must I write a wrapper that models the foreign object in terms of a lisp object? Are there some known cases that won't work in lisp?
4:11:11
jcowan
THere are two ways to do it: write the C (or Blub) function using a specific signature that Lisp uses, or write a Lisp function that provides a C signature. In other words, either weird C glue or weird Lisp glue.
4:14:26
moon-child
most languages that are willing to speak to other languages do so using the c abi
4:15:22
White_Flame
FFIs are pretty complicated, in terms of GC walking the stack and knowing what's lisp vs C (or other), as well as needing native pointers & allocations represented in with lisp tagged values
4:15:30
moon-child
c++ abi has been implemented by non-c++ compilers twice as far as I know (d and raku). Both implementations are incomplete. C++ abi is huge and horrible. That's not a road you want to go down
4:17:13
White_Flame
you asked how it's _designed_. feel free to use them. don't try to design them as some introductory project
4:17:20
nij
Very interesting.. I wonder why languages are so hard to translate.. even in the realm of computer science.
4:18:09
White_Flame
every language has its own notion of memory allocation, how strings are structured, etc
4:18:51
moon-child
even languages with very similar type systems, like lua and js, you would probably run into trouble with
4:21:26
moon-child
remby96: _compiling_ one language to another isn't difficult. What's difficult is retaining the language-level semantics and type system as you do so in a way that makes interoperation practical
4:24:09
White_Flame
and what's difficult is sharing a single process address space with a different language's running binary stuff
4:24:26
loli
The type theory bit shouldn't be too bad, you are taking one formal mathematical system and compiling it to a stronger or weaker one. Idris, and Agda both compile down to Haskell this way
4:24:47
loli
Haskell and other languages compile down to eventually remove their type theory, or compile it down to an IR with weaker type theory
4:25:44
White_Flame
in fact, on the symbolics lisp machines, they had a C compiler that generated lisp processor machine code and played nicely with the system (if slow)
4:25:58
nij
> moon-child: "What's difficult is retaining the language-level semantics and type system as you do so in a way that makes interoperation practical" ;; <= this!
4:27:57
loli
there is interesting research with graded model types, where you can get a system F system out of it, so you could program in such a system and use languages with type systems in System F, or export to them in this way
4:28:15
saturn2
C programs on the lisp machine created a lisp byte-vector to function as the C program's "memory"
4:30:17
loli
moon-child: I'd have to drudge that up, but it comes out of better way to do QTT (think linear types on steroids)
4:30:56
pyc
Is it possible to do string interpolation within format using variable names, e.g. something along the lines of (format t "hello, {{name}}") ?
4:33:09
loli
does CL-INTERPOL change the " reader macro, or does it define a custom define function?
4:35:33
no-defun-allowed
I heard that they could run TeX on a Lisp machine using the C implementation, so it probably worked well enough.
4:36:50
no-defun-allowed
...though TeX is written in literate Pascal, and a conversion program generates the C code.
4:37:17
loli
why the conversion, do more systems just run C, or is it due to performance or maintainability concerns?
4:37:47
no-defun-allowed
Yeah, there are more systems with C compilers than Pascal - Lisp machines had both though.
4:38:15
loli
Is there a lot of literature on the Lisp machine, it seems a lot of that knowledge was lost with time
5:10:30
White_Flame
as far as symbolics goes, there's a lot of scans of both manuals & internal documents that are online now
5:11:09
White_Flame
there's no complete description of everything from the ground up, though, especially in terms of making a bootable image from scratch
5:12:46
loli
I guess i haven't been looking too hard then. I've found image literature lacking in general. Factor and MIT Scheme have some bits, but not much besides that
5:13:03
remby96
there was some website that had a lot ... I had to use it to get some info on the ibm 7094
6:50:44
susam
remby96: European Lisp Symposium - https://european-lisp-symposium.org/2021/index.html / https://www.twitch.tv/elsconf
8:48:01
minion
theothornhill, memo from nij: I've read the log again.. and I melted. Thanks so much :-D Let me know if I can help any.. (beware i'm just a noob)!
9:12:18
pyc
Is (let ((solutions nil) (metadata nil)) ...) a common coding style? Or do you prefer to write (let (solutions metadata) ...)
9:12:56
no-defun-allowed
Yes, the latter makes it look like SOLUTIONS and METADATA are not set to interesting values.
9:13:57
beach
pyc: More explicitly, the first means that you initialize those to some default values, or possibly to Boolean false.
9:15:23
splittist
pyc: to indicate that SOLUTIONS is an initially empty list, you'd say ...((solutions '())...
10:21:23
no-defun-allowed
Following a test in private messages, I think the -CL suffix → Common Lisp rule isn't random.
10:27:42
beach
lotuseater: ELS is currently the only international Lisp forum. There used to be an International Lisp Conference, it it might happen again, organized by the ALU (Association of Lisp Users). But I think the ALU is having problems recruiting (unpaid) staff.
10:29:33
beach
lotuseater: It doesn't matter much if there is one or two, nor what they are called. The only potentially problematic thing about the current situation is that ELS is always held in Europe, when it is a physical gathering. So people from other parts of the world are always the ones who have to travel far.
10:30:23
beach
lotuseater: But ELS (when it is in a physical place) has regular participants from Japan, USA, etc.
10:32:59
nij
Ah ELS is happening.. these two days are the two most busiest in this semester.. :-( it will be uploaded later?
10:33:38
lotuseater
and yes, i downloaded some pdfs from the last years and last year saw your some older talk about LOOP beach
10:33:57
beach
I guess a conference held in North America would have most participants take a flight, whereas in Europe, there are these things known as "trains", so it is probably better for the environment to hold conferences in Europe.
10:37:43
phoe
live and interactive programming using Lisp, interacting with music generators or video presentations or robots
10:52:43
no-defun-allowed
I wonder if (setf (arbitrary-arrows-library:-> nij pants pocket wallet note content) "Do this do that") works.
10:53:14
phoe
no-defun-allowed: binding-arrows should work, I've paid attention to define setf expanders that should work
10:55:37
nij
no-defun-allowed: hmm your method works? To get the content of note, we need (getf note 'content)?
10:55:49
no-defun-allowed
Some parts elided: (setf (arrows:-> *hayley* pocket note) "Test this code") *hayley* ⇒ #S(PERSON :POCKET #S(PAPER :NOTE "Test this code"))
10:56:01
jackdaniel
lotuseater: adding a nickname for the package and not importing anything is even better
10:56:16
_death
nij: there are libraries for that, like "access".. or you could just write your own.. but I think this pointer chasing is not a good sign.. check out Law of Demeter
10:56:19
no-defun-allowed
The elided part was precisely (defstruct (person (:conc-name "")) pocket) (defstruct (paper (:conc-name "")) note) (defvar *hayley* (make-person :pocket (make-paper :note "")))
10:56:45
no-defun-allowed
You're set if the accessors are actual functions, as in the arrow example.
10:57:27
nij
=>(setf (accesses place '(:a :type :alist) '(2 :type array) '(:b :type 'hash-table)) 3)
10:58:02
jmercouris
now that I am thinking about it your last name looks like "Kochman", which is German
10:59:48
lotuseater
i find that feature in the DrRacket IDE useful, it points to where a symbol comes from
11:00:03
nij
I wonder how access is implemented in principle. It doesn't use much macro.. but it doesn't seem to hack setf-expander either
11:04:28
nij
lotuseater: https://gist.github.com/phoe/2b63f33a2a4727a437403eceb7a6b4a3 this could b helpful
11:07:16
no-defun-allowed
Crikey, even the README for ACCESS shows off bad programming style, butchering the values of unexported symbols and slots.
11:09:43
no-defun-allowed
"It should however allow you to prototype more rapidly and change the backing data stores without having to change their access (ie I can switch from a plist to an alist and everything will continue to work)"
11:16:25
_death
there are libraries in other languages that do similar things, like lens (haskell) or specter (clojure).. but again, I think it's suspect
11:17:25
pyc
Is there no standard library function to do what (getf *map* (intern (string-upcase key) :keyword))) does, i.e. given a key as a string, look that up in plist and return its value?
11:17:48
pyc
that makes me think if I am misusing plist. perhaps plist is not meant for lookups where my lookup key is a string?
11:20:39
_death
pyc: interning should usually not be done willy-nilly.. sometimes a hash table mapping strings to whatever will do
11:22:02
pyc
My *map* is a quoted plist that has configuration data. It plays the role of what JSON or YAML might play in another language. Is it possible to create a hash as a literal in CL? With plist I have the advantage that I can create it as a single literal (quoted plist, e.g., '((:name "harry" :age 20) (:name "sally" :age 21) ...)
11:23:23
_death
pyc: for a single plist, there's alexandria:plist-hash-table.. you can always write a small function to translate from a form with nice syntax to whatever representation
11:24:26
nij
so.. is access (cl) bad style? it's hard for newb to tell us cl stuff are usually under documented
11:25:35
pyc
_death: thanks. let me revisit Practical Common Lisp. I think it has an example of what I am trying to do in its 2nd chapter (a simple database). The author did it without using any external lib, so it may have something helpful for my situation.
11:26:25
_death
pyc: sure, you can easily write plist-hash-table.. I just gave a reference so you can look it up
11:27:06
no-defun-allowed
Very much so - if you want to get at or set some value in an object, then you should define an accessor function. That makes it actually possible to replace the representation, and to read e.g. (pocket nij) instead of (getf nij 'pocket).
11:27:42
no-defun-allowed
And then POCKET can signal an error if the input is malformed, whereas (getf '() 'pocket) would return NIL and the error would be blamed on another function.
11:35:16
pyc
_death: Do you have an opinion on this way of solving the problem: (defvar *map* '(:a "apple" :b "ball")) (getf *map* (find-symbol (string-upcase "a") "KEYWORD")) ?
11:38:09
_death
pyc: when I need to translate from "external" strings to a fixed set of keywords, I don't use something as general as find-symbol