freenode/#lisp - IRC Chatlog
Search
7:20:56
edgar-rft
Build your own Lisp Machine: http://www.justgeek.de/a-fistfull-of-transistors-building-a-cpu-from-scratch-1/
7:21:25
beach
shangul: Most Common Lisp compilers would have an intermediate representation that looks like a symbolic version of machine code. You may or may not call that "assembler".
7:21:43
beach
shangul: Certainly, the compiler needs to contain knowledge about the processor instructions and such.
7:22:14
no-defun-allowed
I should also add most C operating systems are written in invalid C technically: how do we get pointers to wherever (such as 0xb8000 for video memory) and what do we do without malloc, free, etc? There is no conforming C runtime or client code there.
7:22:46
beach
no-defun-allowed: That's what I meant when I said that no operating system can be written in C.
7:23:45
no-defun-allowed
Yes, but it's more of a comment on ridiculous constraints set by the authors.
7:24:17
beach
The standards (C and Common Lisp) do not have anything in them that allows direct access to memory by conforming code.
7:26:25
MichaelRaskin
Bash is better than C. You have a chance to concatenates trings in bash and not leakmemory
7:28:04
jackdaniel
it is like in this meme: 'CL: "I feel sorry for you C!", C: "I don't think about you at all CL"'
7:28:11
oni-on-ion
C is unix language -- dumping core is like stacktrace for a process. don't see how its like ebola
7:28:39
MichaelRaskin
It's fine when it does dump core, the problem is that it should have but does not
7:29:03
jackdaniel
I know that I may have incited bash (sorry about that), but let's focus on the channel topic :)
7:30:02
beach
shangul: So let me put it this way, I don't think Mezzano contain any code in a language that is not Common Lisp.
7:30:40
jackdaniel
no-defun-allowed: conforming C does not either. I'm sure you saw LDB in sbcl at least once, and AVER twice or thrice ,p
7:31:28
jackdaniel
let's focus on advancing Common Lisp world instead of patting ourself that we did chose better than C programmers ^_^
7:32:09
no-defun-allowed
There are more ways for a C program to dump core. Yeah, let's talk about something else.
7:33:06
no-defun-allowed
I read in a Smalltalk editor there was a command to move some selected code into a method and replace it with that method call. Is there such a thing in SLIME?
7:35:00
no-defun-allowed
Say I have (defun f (x) (let ((y ......)) (g x y))), and I select the G call, which is actually more complex cause magic. Then it would ask me for a name, I write something like H, and it places (defun h (x y) (g x y)) before that defun.
7:36:34
no-defun-allowed
There is also some simple closure analysis though, copy-paste can't tell what variables are closed by that form. (Let's not worry about macros for now.)
7:37:14
oni-on-ion
yea, seems like http://www.foldr.org/~michaelw/emacs/redshank/ does some extra things for context
7:37:53
oni-on-ion
but using paredit (et.al) i cannot recommend higher for the business of s-expressing
9:37:36
flip214
well, in vim it would be 'da(' for "delete this parenthesis", "{" to move outside the "paragraph" (ie. the current DEFUN), "p" to paste, and then a bit of typing to surround with the necessary (DEFUN h ()" stuff
13:49:01
beach
shangul: There is no widely agreed-upon definition of "Lisp", so we avoid the issue by only dealing with Common Lisp, which *is* well defined.
14:12:32
shangul
beach, I'll be thankful if you upload it somewhere and give me the link to download :)
14:13:19
beach
Just ask frodef. He comes to #sicl regularly. Or send him email. I don't know how up-to-date my code is.
14:17:59
edgar-rft
shangul: I think https://gitlab.common-lisp.net/movitz is what you're looking for
14:22:49
edgar-rft
Sorry, I don't have a prebuild image, but here's a description how yow you can make one yourself https://trac.common-lisp.net/movitz/wiki/FromNothingToImage
14:25:24
edgar-rft
But *sigh*, again dead source-code links. This seems indeed a thing only frodef can solve.
17:14:33
interruptinuse
hey #lisp, does anyone know of a way to use GNU readline with (read-line) (clisp, mainly)? if I use (read-line) in a REPL, it supports line editing, but doesn't in batch mode
17:16:29
asarch
Is it really bad to do (defclass my-window (glut:window) ...) and then (defmethod glut:display ((w my-window)) ...)?
17:17:35
asarch
I've tried with (defmethod display ((w my-window)) ...) but the main process cannot use it
17:17:59
interruptinuse
Josh_2: i don't need completions or whatnot, but clisp batch-mode (read-line) by itself doesn't support line editing, which would be comfy
17:21:16
interruptinuse
file.lisp is a standalone program which has a small REPL of its own, and will likely be executed in batch mode as `clisp file.lisp`. it evaluates strings which are read by read-line. how can I use line editing with this setup?
17:23:16
interruptinuse
my last resort atm is ffi-ing readline, which is not that bad, but i was wondering there's something built-in i could exploit
17:29:20
Bike
read-line itself doesn't have line editing, it's just waiting for your terminal, i think
17:30:00
interruptinuse
the first one is in batch mode, when you go `clisp file.lisp`, and it doesn't do anything except read stdin
17:30:47
grewal
According to this, https://clisp.sourceforge.io/beta/impnotes/readline-mod.html, clisp has builtin support for calling readline
17:31:27
Bike
interactive read-line isn't different. it's just waiting for an actual line to appear on stdin. i think.
18:01:18
pjb
Then the description insists: "readline will read a line from the terminal and return it"
18:01:36
pjb
"from the terminal" = interactive. There's no batch here. And in batch, there's no terminal!
18:03:23
pjb
later, it says about bash: "The editing mode may be switched during interactive use by using the -o option to the set builtin command. "
18:03:48
pjb
Notice that they don't say that the editing mode may be switched during *batch* use. But explicitely during *interactive* use!
18:08:19
interruptinuse
pjb: my understanding of clisp's "batch mode" phrase is that it means compiling or running files without a REPl
18:12:16
interruptinuse
so the answer to your question is "read from stdin with appropriate termios, hopefully with the help of readline, which makes that easier", which to my understanding isn't forbidden by laws of nature
18:14:58
interruptinuse
(also also, what do you mean by "where do you get keycodes from"? you specify the interpreted file on the cmdline, so stdin is still available)
18:50:48
pjb
Well I cannot test it, it looks like my clisp has been compiled without readline anyways.
18:51:21
pjb
I guess you could just use rlwrap: rlwrap clisp -norc -q -ansi -x '(read-line *terminal-io*)'
18:55:17
interruptinuse
m clisp's behavior differs between -x and passing a file, for what it's worth
18:59:25
interruptinuse
(read-line *terminal-io*) actually works without rlwrap in batch for me, not sure how portable that is
19:04:11
interruptinuse
pjb: i was going to go with using clisp's ffi readline module, but with having to configure it to disable completion (because common lisp completion doesn't make sense for a dsl)
19:04:40
interruptinuse
but on second thought, actually offloading all that to rlwrap and running with -disable-readline might be easier and more portable
19:05:34
pjb
That said, I don't understand why you want to do that in batch mode anyways. This is not how to use clisp interactively.