freenode/#lisp - IRC Chatlog
Search
22:11:37
emaczen
Bike: I like when *sldb* appears, gives me a backtrace and then offers some restarts
22:12:48
Bike
if you want to send the condition to the restart from the debugger it'll be more annoying/difficult.
22:15:52
emaczen
Bike: when a file is not formatted correctly, the user is given the option to insert a value at user-chosen location so that it will parse correctly on the restart.
22:19:08
fourier
_death: yes i can write it but i was curious why it was not implemented. I thought maybe some design principles applied to _not_ to write such a macro since we don't have it in alexandria.
22:19:33
Bike
emaczen: i don't understand how this implies that the restart needs access to the condition.
22:20:28
emaczen
Bike: The user is just supplying an index to insert at. The condition contains the value.
22:21:47
Bike
Oh. So you have something like (restart-case (error 'bad-parse :value value) (use-index (index) ...))?
22:22:09
emaczen
Bike: I think the mix between #'invoke-restart and #'invoke-restart-interactively is missing -- the first
22:22:27
emaczen
the first's lambda list takes a &rest in its lambda-list and the last takes no arguments
22:23:32
Bike
it doesn't take any arguments because it just calls the :interactive function. so you could have like (restart-case (error 'bad-parse :value value) (use-index (value index) :interactive (lambda () (list value (prompt-for-index))) ...))
22:23:43
Bike
or in that particular code you wouldn't need it since you have value in context anyway
22:24:15
emaczen
Bike: I have (restart-case (some-outer-form which calls methods where (error 'bad-parse :value value) can be called) (use-index ...))
22:25:55
Bike
like (let (value) (restart-case (handler-bind ((bad-parse (lambda (c) (setf value (bad-parse-value c))))) (outer-form)) (use-index (index) ... value ...)))
22:27:38
Bike
Basically, when the inner function signals there's a bad parse, at the restart-case you have a handler set up so that you grab the value and then let the condition continue up to the debugger.
22:29:11
Bike
it's how condition signaling works. when you call error or whatever it looks for the most recent handler, and if that doesn't handle it continues up, etc. if it runs out it calls the debugger.
22:29:59
emaczen
Bike: I'll be back at my computer later, I am enjoying the condition system though!
22:38:37
_death
fourier: alexandria is not a kitchen-sink utility library.. it is meant to be a conservative least-common-denominator library.. personally I never felt the need for an if-let* operator, and I don't think I've ever seen it in the wild..
22:41:55
_death
fourier: such concerns should not prevent you from writing it yourself though.. before alexandria, many people had their own utility libraries.. after alexandria, the only desired effect is that they shrink a little
1:49:51
aeth
My only concern with utility libraries, that keeps me to just alexandria and uiop, is that they tend to (1) do too much and (2) be incompatible with alexandria (even uiop is)
2:08:54
aeth
irisl: If you already know how to program, Lisp only having expressions (instead of expressions and statements) can be tricky
2:19:15
beach
irisl: You need to find a good intro book. For Common Lisp, the one that is typically recommended is:
2:19:24
minion
irisl: look at gentle: "Common Lisp: A Gentle Introduction to Symbolic Computation" is a smoother introduction to lisp programming. http://www.cs.cmu.edu/~dst/LispBook/
2:25:10
beach
irisl: Seriously, there are some very smart and some very knowledgeable people hanging out here. I very much enjoy discussing all kinds of problems of programming and software design with them, because the advice I am given is very often pertinent.
2:28:44
beach
irisl: This channel is not (as some people think) a "Lisp support channel". It is a channel for mutual discussion by people who program in Common Lisp. Newbie questions are tolerated, though. But things can get hostile here as well, especially when newbies are given advice that they then reject. But if you follow advice and behave normally, you should be fine.
2:33:23
loke`
irisl: Good luck, and do try to push through to get over that first hump into “aha!” land. I'm currently trying to get my daughter to learn, and I can see it can be frustrating initially.
3:54:26
Bike
little did they realize that i can only be killed by a sword forged from the four lost fragments of Izathitch
5:03:37
loke`
jack_rabbit: Cool. What are the specific features that made you implement it? (every implementation has something that makes it...hmm.. unique?)
5:04:46
jack_rabbit
loke`, I just had an idea suddenly. I finally knew how to build something like this, so I did.
5:05:57
jack_rabbit
The code really needs to be cleaned up. I just did a major code-writing session and committed all kinds of commented code. I'll clean it up tomorrow.
5:06:52
loke`
The bytecode seems to be instances of struct binstr, which is instructions of a stack-based bachine?
5:08:49
jack_rabbit
The instr field is the address of code in a section of the vm proper. When instructions are finished, they jump to the next instr in the VM.
5:10:31
loke`
Although your implementation doesn't seem to define an actual bytecode format. Rather, it's a list of malloced C structs. That means that the obvious FASL format (just dumping the structs to a file) would not be portable.
5:17:53
jack_rabbit
But I'd rather use my own assembler, as imperfect as it is: https://github.com/knusbaum/assembler
5:20:33
Bike
does it really just use malloc and free? i don't think malloc is really designed for lots of tiny objects, or something...
5:23:58
jack_rabbit
Mark everything white, then check the roots, mark them grey and put them in a queue.
5:25:55
jack_rabbit
Basically, all the operations like macro expansion, compilation, etc. work within the VM itself.
5:26:19
jack_rabbit
So as long as I make sure all live objects are on the stack, I'm safe from the GC.
5:30:28
jack_rabbit
It's pretty fast, too. Without gc, it does (fib 40) about twice as fast as python. With gc, it's about a third slower.
5:41:21
jack_rabbit
hard to say. There's definitely synchronization of some kind necessary in any GC.
5:42:14
beach
Hmm. Either you run the GC to completion once you started it, or else you only run it a little bit and resume the mutator(s).
5:43:09
jack_rabbit
Yeah, mine runs concurrently, but stops the main program at key points. I guess that's incremental.
6:34:31
impaktor
Hmm, but it's usually my fault. When stuff breaks. And I think I have the same sbcl version on another computer that works fine.
6:41:40
axion
The guy who packages SBCL for Arch Linux doesn't know what he's doing. I emailed him several times and just compile from source myself these days.
6:42:44
pookleblinky
sbcl has always been rather finicky for me. Oddly, I never had a problem with it on arch, only on debianish distros
6:49:22
impaktor
Ah! Yesterday I told my zsh to not load the global /etc/zsh as that overrides my prompt with a retarded smiley face(!). In doing so, I wonder if this caused my $SBCL_HOME to becoming NIL (as it is now).
6:54:52
impaktor
Now I would be far more happy if I understood why that happens, and how it is interconnected with my disabling reading the global zsh configuration file in /etc/.
7:57:34
beach
Significant progress: The lambda-list parser that I am working on, and that is based on the Earley parsing technique, seems to work for simple cases. Ultimately, it will work on concrete syntax trees (CSTs), but at the moment, I am using ordinary Common Lisp lists. I still have to design a technique for invoking it recursively when the lambda list allows nesting, such as the macro lambda list.
8:00:30
beach
A library that is meant to make it easier for a compiler or a text editor to keep track of source locations of Common Lisp code read from a file or an editor buffer.
8:04:11
beach
Mostly, the library is trivial, but parsing lambda lists is a bit harder, especially since I want client Common Lisp systems to be able to adapt the parser to their needs. The standard specifically allows Common Lisp systems to add their own lambda-list keywords, and I have to take that into account.
8:05:44
beach
The other part that is not trivial is the "intelligent macroexpander". It attempts to "guess" the origin of expressions that occur in a macroexpansion. But that one is already written, so I am working on the lambda-list parser now.
8:07:59
beach
Since I am on the subject, Second Climacs is already able to parse the contents of the buffer, using a modified version of the Common Lisp reader. The next step is to "compile" top-level forms at typing speed, at least enough for the editor to be able to determine the role of each symbol.
8:08:31
beach
It can then do things like compute correct indentation (which Emacs/SLIME can not do), and highlight the same symbol differently according to its role.
8:09:55
beach
For example, in the form (LET ((PROG1 ...)) ...) the symbol PROG1 does not refer to the Common Lisp operator. It is just a lexical variable.
8:10:47
beach
emaczen: For example, if you type (let ((bla <newline>, Emacs will position the cursor under the `b' in bla, which is correct.
8:12:24
beach
loke`: I am hoping to be able to do a lot more to help the programmer than what is possible with what you call the "pragmatic approach".
8:13:10
loke`
beach: I have no doubt. I'm just saying that a purely compiled solution will not be enough.
8:14:04
loke`
Your approach is obviously superior. It's jsut that some amount of guesswork still has to happen.
8:14:11
beach
emaczen: There should be no difference in indentation when you rename a lexical variable.
8:15:23
White_Flame
then there's cases like embedded DSLs where we reuse symbols like CASE, but have different semantics where the 1st parameter isn't supposed to be specially indented. But because it's CL:CASE, you really can't know that it's used for other purposes, except that it's quoted
8:16:17
beach
loke`: Nothing is ever "enough" with your requirements. I am happy if I can do something significantly better than what we are currently able to do.
8:16:21
emaczen
beach: I wrote a quick note-taking program which indents based on left and right paren counts -- basically indent for each new level in the tree
8:17:57
emaczen
but that is not how SLIME does it, and I don't think I've ever seen CL code that looks like that
8:19:12
splittist
being able to, for example, cleanly rename each use of the variable - but not symbol - LIST in a form/region would be a boon.
8:19:19
beach
emaczen: That's a good start, but you need to know the role of each symbol to do it better. Even Emacs/SLIME can do some of that, such as indenting the body of a macro call differently from other macro parameters.
8:20:36
beach
splittist: As soon as I convert the top-level form to HIR, I will know which occurrences refer to the same variable.
8:34:03
loke`
beach: I didn't realyl give “requirements” per se. I was merely pointing out that there are cases where heuristics might be necessary. However, in most cases that's not really the case. I actually agree with you in that your approach is better.
8:44:49
phoe
tapioco: https://common-lisp.net/project/cffi/manual/html_node/foreign_002dtype_002dsize.html#foreign_002dtype_002dsize ?
8:44:52
White_Flame
I'm no FFI expert, but that would be a property of the type, not that of an instance
9:04:45
flip214
tapioco: to use the foreign type, you need to have a definition of its contents, right?
9:05:12
flip214
if you can only deal with it like with a (void*), then you're missing that information
9:11:49
flip214
http://ftp.stu.edu.tw/FreeBSD/distfiles/cffi/0.14.0/cffi-manual.html#Allocating-Foreign-Memory
9:59:08
_death
tapioco: there is a note giving the alignment rules in cffi's types.lisp (search for "structure alignment")
10:08:06
_death
yeah, those pesky yes/no, on/off, here/there, none/some, discretely dichotomizing kind of things
10:11:07
_death
:uint8 for example, means 8 bits, what we call one octet, on your chosen platform, one byte.. sizeof returns the size in those units