From deeteeoh1138 at gmail.com Mon Dec 2 11:00:19 2019 From: deeteeoh1138 at gmail.com (David O'Toole) Date: Mon, 2 Dec 2019 14:00:19 -0500 Subject: [CM] unbound variable error in snd-motif in snd 19.9 Message-ID: I'm getting the following errors in some jobs. I can't quite seem to tie it down. kmg: unbound variable "snd-motif.scm"[1266]: (let ((str (XmStringCreateLocalized (kmg (disk-kspace (file-name (car data))))))) (XtSetValues (cadr data) (list XmNlabelString str)) (XmStringFree str) (XtAppAddTimeOut (caddr data) 10000 show-label data)) -------------- next part -------------- An HTML attachment was scrubbed... URL: From bil at ccrma.Stanford.EDU Mon Dec 2 13:37:15 2019 From: bil at ccrma.Stanford.EDU (bil at ccrma.Stanford.EDU) Date: Mon, 02 Dec 2019 13:37:15 -0800 Subject: [CM] unbound variable error in snd-motif in snd 19.9 In-Reply-To: References: Message-ID: The let at the start of show-disk-space should be a let*. Thanks for the bug report! From iainduncanlists at gmail.com Fri Dec 20 14:34:02 2019 From: iainduncanlists at gmail.com (Iain Duncan) Date: Fri, 20 Dec 2019 14:34:02 -0800 Subject: [CM] Anyone using S7 with Max? Message-ID: Hello computer musicians, I'm experimenting with using S7 in a C external in Max/MSP and just thought I'd check whether anyone else has done such a thing or is interested. Thanks iain -------------- next part -------------- An HTML attachment was scrubbed... URL: From iainduncanlists at gmail.com Tue Dec 24 09:28:53 2019 From: iainduncanlists at gmail.com (Iain Duncan) Date: Tue, 24 Dec 2019 09:28:53 -0800 Subject: [CM] Resources/suggestions for learning scheme a la S7 Message-ID: High folks, wondering if anyone can chime in on which scheme resources make the most sense if the goal is to learn scheme as implemented on S7. I have a reasonable understanding of Clojure, and am working my way through the Seasoned Schemer, SICP, How to Design Programs, and the Touretsky Common Lisp book. The docs say "like Guile 1.8". How does that translate to RXRS? Any particular books you'd recommend? I guess one question I have is whether the 4th edition of the Dybvig R6RS book is worth reading or whether that is quite different. Also, am I correct that the macro system supported is more like CL macros? It looks to me, coming from ClojureScript, to be quite similar to Clojure macros, which I think are closer to CL than scheme. But I'm a lisp newbie, maybe I'm off base here. thanks everyone. iain -------------- next part -------------- An HTML attachment was scrubbed... URL: From bil at ccrma.Stanford.EDU Tue Dec 24 10:48:32 2019 From: bil at ccrma.Stanford.EDU (bil at ccrma.Stanford.EDU) Date: Tue, 24 Dec 2019 10:48:32 -0800 Subject: [CM] Resources/suggestions for learning scheme a la S7 In-Reply-To: References: Message-ID: Dybvig's book is good, but s7 does not implement R6RS Scheme. The second edition of "The Scheme Programming Language" is better (R4RS I think). Guile 1.8 was R5RS, if I remember right. s7 has CL-style macros. Since it has first class environments, it does not need syntax-rules or any of its friends (that is, you can write hygienic macros with define-macro). I learned lisp through maclisp (at SAIL), and haven't read those other books. From iainduncanlists at gmail.com Tue Dec 24 10:57:35 2019 From: iainduncanlists at gmail.com (Iain Duncan) Date: Tue, 24 Dec 2019 10:57:35 -0800 Subject: [CM] S7, reentrancy, and threads Message-ID: Hi Bill, I'm hoping I could get a sanity check on the use case I have in mind for S7 before I go too far, as I discovered it wasn't going to be pretty with Chicken. I *think* it will be fine with S7, but I'd like to make sure I'm not misunderstanding. I want to embed S7 in a max external, which for those unfamiliar with the max-sdk, means that it will be embedded in some C code, with hooks to run at class instantiation time (ie shared across all instances of the object in max), object instantiation time, and receiving message event callbacks. Ideally, I'd like to make it max-like, similar to how the JS object works, such that by default each s7 object in Max will have it's own isolated scheme interpreter. So I think that means re-entrancy? I'm not sure yet about threading. I *think* that the way max works, I don't have to worry about two interpreters being called at once, but I might be wrong there. It looks like from the docs like I don't have to worry about that anyway, if I'm understanding the threadsafe example, am I correct there? Finally, it would be dead cool if separate max objects could ask to share the same scheme space. It looks to me like this might be possible with environments. Is that reasonable? I.e. if I have calls to scheme interpreters from different instantiations, but they both share an s7 pointer (declared in class space, as if in a static class member), and they ask for the same environment in their call to evaluate, is it possible to have these separate calls to scheme share data and affect each others runtimes, including function definitions? Apologies if any of these should be easily answered by the docs - I'm working through them, but as a scheme newbie, I'm frequently unsure if I understand them right. :-) thanks iain -------------- next part -------------- An HTML attachment was scrubbed... URL: From bil at ccrma.Stanford.EDU Tue Dec 24 11:58:15 2019 From: bil at ccrma.Stanford.EDU (bil at ccrma.Stanford.EDU) Date: Tue, 24 Dec 2019 11:58:15 -0800 Subject: [CM] S7, reentrancy, and threads In-Reply-To: References: Message-ID: <2f8dac5a931207a7adf7cf71bf8c9bed@ccrma.stanford.edu> > is it possible to have these separate calls to scheme share data > and affect each others runtimes, including function definitions? I don't think this will work -- you can share constant data, but not anything in the heaps. I don't see why you'd need a separate interpreter for every object. Are Max objects separate threads in C? I have done very little work in JavaScript, but I think jS objects are similar to s7 lets (i.e. a collection of names+values, and if the value is a function, it's considered a "method"). So you just need to map between those (or some facsimile thereof), all within one s7 interpreter. s7's object-oriented stuff is very close to JavaScript (I think -- I'm no expert). From iainduncanlists at gmail.com Tue Dec 24 12:02:01 2019 From: iainduncanlists at gmail.com (Iain Duncan) Date: Tue, 24 Dec 2019 12:02:01 -0800 Subject: [CM] S7, reentrancy, and threads In-Reply-To: <2f8dac5a931207a7adf7cf71bf8c9bed@ccrma.stanford.edu> References: <2f8dac5a931207a7adf7cf71bf8c9bed@ccrma.stanford.edu> Message-ID: Thanks Bill. Right, I guess I had just assumed they were running separate interpreters, but I suppose there's no reason they would need to be. I don't think Max objects get separate threads, but I do know that different parts of your c external run in at least separate dsp and event threads. thanks! On Tue, Dec 24, 2019 at 11:58 AM wrote: > > is it possible to have these separate calls to scheme share data > > and affect each others runtimes, including function definitions? > > I don't think this will work -- you can share constant data, but > not anything in the heaps. I don't see why you'd need a separate > interpreter for every object. Are Max objects separate threads > in C? I have done very little work in JavaScript, but I think > jS objects are similar to s7 lets (i.e. a collection of names+values, > and if the value is a function, it's considered a "method"). > So you just need to map between those (or some facsimile thereof), all > within one s7 interpreter. s7's object-oriented stuff is very close > to JavaScript (I think -- I'm no expert). > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From wdouglass at carnegierobotics.com Mon Dec 30 09:39:51 2019 From: wdouglass at carnegierobotics.com (Woody Douglass) Date: Mon, 30 Dec 2019 17:39:51 +0000 Subject: [CM] s7 finalization Message-ID: All, How should i destroy the s7_scheme object that is returned from s7_init? Is there a way to free resources used by the interpreter? Also, is there an easy way to search the mailing list archives? this seems like a question that would have been asked before. Thanks, Woody Douglass -------------- next part -------------- An HTML attachment was scrubbed... URL: From bil at ccrma.Stanford.EDU Mon Dec 30 10:23:09 2019 From: bil at ccrma.Stanford.EDU (bil at ccrma.Stanford.EDU) Date: Mon, 30 Dec 2019 10:23:09 -0800 Subject: [CM] s7 finalization In-Reply-To: References: Message-ID: <6aa70cedebc3d8a1c6ad1ed2aa1b504d@ccrma.stanford.edu> The question has come up before, but I'm not sure it was in cmdist. I don't know how to search the archives. There's currently no way to destroy the interpreter and free its resources. I think it would be easy to release most of them (the heap etc), but a complete cleanup would take some effort. Why do you need this? From wdouglass at carnegierobotics.com Mon Dec 30 13:11:15 2019 From: wdouglass at carnegierobotics.com (Woody Douglass) Date: Mon, 30 Dec 2019 21:11:15 +0000 Subject: [CM] s7 finalization In-Reply-To: <6aa70cedebc3d8a1c6ad1ed2aa1b504d@ccrma.stanford.edu> References: , <6aa70cedebc3d8a1c6ad1ed2aa1b504d@ccrma.stanford.edu> Message-ID: <7fa378a1cc004b31bb5aedc6ce7140c7@carnegierobotics.com> I'm currently debugging a memory leak, and I suspect that it's in my native code, not s7; however, i'd like to rule s7 out as well as figure out if there's some reference chain that's keeping the GC from doing its job. Also, it would probably make valgrind happy to clean up s7's state. On 2019-12-30 13:21:33-05:00 bil at ccrma.Stanford.EDU wrote: The question has come up before, but I'm not sure it was in cmdist. I don't know how to search the archives. There's currently no way to destroy the interpreter and free its resources. I think it would be easy to release most of them (the heap etc), but a complete cleanup would take some effort. Why do you need this? -------------- next part -------------- An HTML attachment was scrubbed... URL: From bil at ccrma.Stanford.EDU Tue Dec 31 02:45:55 2019 From: bil at ccrma.Stanford.EDU (bil at ccrma.Stanford.EDU) Date: Tue, 31 Dec 2019 02:45:55 -0800 Subject: [CM] s7 finalization In-Reply-To: <7fa378a1cc004b31bb5aedc6ce7140c7@carnegierobotics.com> References: , <6aa70cedebc3d8a1c6ad1ed2aa1b504d@ccrma.stanford.edu> <7fa378a1cc004b31bb5aedc6ce7140c7@carnegierobotics.com> Message-ID: Since you mention valgrind, I assume you're seeing it report memory leaks in s7 functions such as mallocate, alloc_symbol, petrify, add_opt_func, etc -- these are not "leaks" in the sense that memory is lost inadvertently. s7 allocates blocks of memory, then manages local allocations itself (malloc and free are slow). I think that valgrind sees that the pointer returned by malloc is no longer accessible, and reports it as a leak. The most likely s7-related memory leak involves s7_gc_protect. If you call this, then for some reason don't call the corresponding s7_gc_unprotect_at, the internal table of protected objects grows. You can see if this is happening by calling (*s7* 'memory-usage). The 'gc-protected-objects field reports the number of such objects as (cons number-of-currently-protected-objects size-of-table). ((*s7* 'memory-usage) 'gc-protected-objects) will omit all the other info. From bil at ccrma.Stanford.EDU Tue Dec 31 15:41:04 2019 From: bil at ccrma.Stanford.EDU (bil at ccrma.Stanford.EDU) Date: Tue, 31 Dec 2019 15:41:04 -0800 Subject: [CM] Snd 20.0 Message-ID: Snd 20.0: Snd: Mike improved several Forth scripts. s7: added baffle? and goto? checked: sbcl 1.5.9, 2.0.0, Ubuntu 19.10 Thanks!: Kjetil Matheussen, Tito Latini, Matti Koskinen, David O'Toole, Michael Edwards, Mike Scholz.