From bil at ccrma.Stanford.EDU Sat Jan 1 03:08:39 2022 From: bil at ccrma.Stanford.EDU (bil at ccrma.Stanford.EDU) Date: Sat, 01 Jan 2022 03:08:39 -0800 Subject: [CM] Snd 22.0 Message-ID: <12a0b4e6b33a70e306dfd93063d3076e@ccrma.stanford.edu> Snd 22.0: The spectrogram now notices dont-normalize. checked: notcurses 2.4.9|3.0.0 (the latter is needed for nrepl.scm), sbcl 2.1.11 Thanks!: Tito Latini, Chris Chafe, Kjetil Matheussen, Woody Douglass, Christos Vagias From chris.actondev at gmail.com Sat Jan 1 09:11:25 2022 From: chris.actondev at gmail.com (Christos Vagias) Date: Sat, 1 Jan 2022 18:11:25 +0100 Subject: [CM] Bug regarding hooks In-Reply-To: References: Message-ID: Thanks for the fix Bil! (I see that Snd 22.0 contains the call_setter fix) Also, pipe-chars without catch seems cleaner, thanks! And happy new year! On Fri, 31 Dec 2021 at 21:22, wrote: > > Here's a change that might be interesting. Change call_setter (ca line > 46598) to: > > static s7_pointer call_setter(s7_scheme *sc, s7_pointer slot, s7_pointer > new_value) > { > s7_pointer func = slot_setter(slot); > if (!is_any_procedure(func)) > return(new_value); > > if (is_c_function(func)) > return(call_c_function_setter(sc, func, slot_symbol(slot), > new_value)); > > sc->args = (has_let_arg(func)) ? > list_3(sc, slot_symbol(slot), new_value, sc->curlet) : > list_2(sc, slot_symbol(slot), new_value); > return(s7_call(sc, func, sc->args)); > } > > I think the problem is that the error (in the setter function) longjmps > which (in the old call_setter) exited the recursive eval call, but > did not fixup the eval_done on the scheme stack. A simple example: > > (define (fc in) > (catch 'wrong-type-arg > (lambda () > (+ in 2)) > (lambda (type info) > type))) > > (define state > (let () > (define file #f) > (define contents #f) > (set! (setter 'file) > (lambda (s v) > (set! contents (fc #\1)) > v)) > (curlet))) > > (set! (state 'file) 321) > > (format *stderr* "done: ~S ~S~%" (state 'file) (state 'contents)) > From chris.actondev at gmail.com Sat Jan 1 09:16:54 2022 From: chris.actondev at gmail.com (Christos Vagias) Date: Sat, 1 Jan 2022 18:16:54 +0100 Subject: [CM] s7_load_c_string_with_environment & windows Message-ID: Hi all, and happy new year! (if you adhere to the Gregorian calendar that is) Regarding s7, s7_load_c_string_with_environment behaves well in MSVC as far as I tested, so the #if (!MS_WINDOWS) can safely be removed. As it is, s7_load_c_string_with_environment is completely disabled for windows. Thanks, Christos Vagias From bil at ccrma.Stanford.EDU Sat Jan 1 10:12:00 2022 From: bil at ccrma.Stanford.EDU (bil at ccrma.Stanford.EDU) Date: Sat, 01 Jan 2022 10:12:00 -0800 Subject: [CM] =?utf-8?q?s7=5Fload=5Fc=5Fstring=5Fwith=5Fenvironment_=26_wi?= =?utf-8?q?ndows?= In-Reply-To: References: Message-ID: > s7_load_c_string_with_environment behaves well in MSVC Thanks for the info! I'll uncomment that procedure in the MSVC case. Another thing that seems like it ought to work in Windows is the dynamic loader, but I don't know what is required. From chris.actondev at gmail.com Sun Jan 2 07:52:44 2022 From: chris.actondev at gmail.com (Christos Vagias) Date: Sun, 2 Jan 2022 16:52:44 +0100 Subject: [CM] s7_load_c_string_with_environment & windows In-Reply-To: References: Message-ID: I might take a look into it myself, I will let you know! >From what I recall LoadLibraryA is what's used in Windows. On Sat, 1 Jan 2022 at 19:12, wrote: > > > s7_load_c_string_with_environment behaves well in MSVC > > Thanks for the info! I'll uncomment that procedure > in the MSVC case. Another thing that seems like it ought to > work in Windows is the dynamic loader, but I don't > know what is required. > From plewto at gmail.com Tue Jan 11 15:38:03 2022 From: plewto at gmail.com (Steven Jones) Date: Tue, 11 Jan 2022 17:38:03 -0600 Subject: [CM] [OT][ANN] CYCO a Lisp based music composition language. Message-ID: Hi all, I recently published CYCO to Github at. https://github.com/plewto/CYCO3 This is a project I have been working on for years which originally started as extensions to Common Music. I primarily wrote it as a tool for myself and have used it in dozens of music compositions. I am releasing it in the hope that others may find it useful. Some of CYCO's key features: Project centric design Functional time specification A rich set of pattern generators. Currently output is to MIDI files only. Thanks -------------- next part -------------- An HTML attachment was scrubbed... URL: From mike at eggheadgames.com Tue Jan 11 21:19:09 2022 From: mike at eggheadgames.com (mike at eggheadgames.com) Date: Wed, 12 Jan 2022 13:19:09 +0800 Subject: [CM] OT Using s7 in an iOS mobile app + SQLite Message-ID: A quick note of thanks to all involved for a *great* piece of software in s7 - obviously Bil, but also many others via bug reports, documentation or emails in this list. TLDR: I can report successfully shipping s7 (with SQLite) in an iOS mobile app, and plan to do the same with Android before too long. More details in case you?re interested: I?ve put my toe in the water and one of my apps currently includes s7 version 9.18 along with a recent SQLite. Most of the app is still in Swift, and it passes an established SQLite connection pointer into a tiny s7 / SQlite C wrapper. With this, one of the app?s screens loads a few .scm files which run SQL queries and prepare content for a Swift view. The Scheme code then supports subsequent user interactions on that screen. It?s simple stuff, but it?s cut development time hugely compared with Xcode + Swift. So far the app is just as stable as the prior Swift-only version. My fears of bizarre memory leaks or impenetrable crash logs have not been realised. The architecture is evolving, but is currently arranged to implement a ViewModel and Model in Scheme with the View remaining in Swift + Storyboards (so-called MVVM). We tend to develop TDD-style, building comprehensive Scheme integration tests that run mostly at the ViewModel level (along with existing iOS XCTests). There?s a slim Swift wrapper to handle basic type conversion/mapping (int, string, bool, array, set) along with procedure calling and an attempt at correctly using s7_gc_protect / s7_gc_unprotect_at. We also wired up a simple callback mechanism to fire notifications from Scheme that could be observed by NSNotification in Swift, though we will likely step back from using it extensively for now to keep things simple(r). Perhaps erroneously, we made yet another (simple!) REPL. This includes SQLite and we use it to run our tests, as well as for interactive development using various existing Emacs Scheme/Lisp tools. Using s7 is the latest attempt in my never-ending search for the holy grail of cross-platform mobile development :), building on earlier efforts which adopted SQLite. It?s also been our first real experience with Scheme as a language. It?s been great fun! All the joy and convenience of an interactive high level language, but somehow still like coding in assembly :) Next step is try this on Android, where the fun part will be calling C, and hence s7, through the JNI layer! Cheers, Michael From elronnd at elronnd.net Wed Jan 12 01:34:02 2022 From: elronnd at elronnd.net (Elijah Stone) Date: Wed, 12 Jan 2022 01:34:02 -0800 (PST) Subject: [CM] OT Using s7 in an iOS mobile app + SQLite In-Reply-To: References: Message-ID: On Wed, 12 Jan 2022, mike at eggheadgames.com wrote: > Next step is try this on Android, where the fun part will be calling C, > and hence s7, through the JNI layer! Note you do not have to do through java, see e.g. https://github.com/cnlohr/rawdrawandroid. Whether that makes sense is not clear (as you would have to do the UI yourself), but it would eliminate the need for annoying java<->c communication. -E From iainduncanlists at gmail.com Wed Jan 12 10:26:26 2022 From: iainduncanlists at gmail.com (Iain Duncan) Date: Wed, 12 Jan 2022 10:26:26 -0800 Subject: [CM] OT Using s7 in an iOS mobile app + SQLite In-Reply-To: References: Message-ID: Thanks for sharing this Mike, that's super cool! I plan to eventually release some of my music pedagogy tools that I do in Max and s7 as mobile apps, so I would love to hear more as you progress. iain On Wed, Jan 12, 2022 at 1:34 AM Elijah Stone wrote: > On Wed, 12 Jan 2022, mike at eggheadgames.com wrote: > > > Next step is try this on Android, where the fun part will be calling C, > > and hence s7, through the JNI layer! > > Note you do not have to do through java, see e.g. > https://github.com/cnlohr/rawdrawandroid. Whether that makes sense is > not > clear (as you would have to do the UI yourself), but it would eliminate > the need for annoying java<->c communication. > > -E > _______________________________________________ > Cmdist mailing list > Cmdist at ccrma.stanford.edu > https://cm-mail.stanford.edu/mailman/listinfo/cmdist > -------------- next part -------------- An HTML attachment was scrubbed... URL: From mike at eggheadgames.com Wed Jan 12 16:08:27 2022 From: mike at eggheadgames.com (mike at eggheadgames.com) Date: Thu, 13 Jan 2022 08:08:27 +0800 Subject: [CM] OT Using s7 in an iOS mobile app + SQLite In-Reply-To: References: Message-ID: <6579C785-7457-4B64-9850-DF97266D82DA@eggheadgames.com> Thanks, I hadn?t seen that, fun stuff! My puzzle apps are text heavy, so I?m sticking with the OS GUI rather than drawing my own bits. Then I keep all the OS accessibility features (e.g. high-contrast, night-mode, text-to-voice) as well as ?native app? behaviour. JNI shouldn?t be *too* horrible, as I?m intentionally sticking to simple types. The overall idea is for the s7/Scheme layer to provide the business logic + data for iOS & Android and the OS will display it. It means a messy hybrid world of tools, but manageable I estimate. This is helped in large part by s7.c being a single file, like sqlite3.c, which makes it easier to integrate into each platform?s build chain idiosyncrasies. On 12 Jan 2022, at 17:34, Elijah Stone wrote: > On Wed, 12 Jan 2022, mike at eggheadgames.com wrote: > >> Next step is try this on Android, where the fun part will be calling >> C, and hence s7, through the JNI layer! > > Note you do not have to do through java, see e.g. > https://github.com/cnlohr/rawdrawandroid. Whether that makes sense is > not clear (as you would have to do the UI yourself), but it would > eliminate the need for annoying java<->c communication. > > -E > _______________________________________________ > Cmdist mailing list > Cmdist at ccrma.stanford.edu > https://cm-mail.stanford.edu/mailman/listinfo/cmdist From deeteeoh1138 at gmail.com Thu Jan 13 16:56:34 2022 From: deeteeoh1138 at gmail.com (David O'Toole) Date: Thu, 13 Jan 2022 19:56:34 -0500 Subject: [CM] Squeak frontend to SchemeMosaic and Snd Message-ID: Greetings, S7 Schemers :) I hope everyone is having a safe and happy new year. I am working on a Squeak Smalltalk frontend for SchemeMosaic, my concatenative synthesis toolkit add-on for Snd. Squeak has a rich graphical user interface framework called Morphic, so this frontend should be much nicer and much more usable than the Emacs one I built before. I have attached some screenshots of the (very rough but working) GUI thus far. I don't have to stop at just the features of Mosaic. Although it may not be possible to replicate the entire GUI of Snd, a significant range of functionality could be exposed to the graphical Squeak environment. This could be really fun for experimenting with beats and concatenative synthesis. SchemeMosaic's current bleeding edge source can be found at: https://gitlab.com/dto/mosaic but I wouldn't try running the GUI just yet. I need a little more time to make a proper alpha release. If you want some general information about the project, the old webpage is here, I'm finding a new home for it so the only option right now is Internet Archive. http://web.archive.org/web/20210115113453/http://xelf.me/scheme-mosaic.html I will keep you informed! -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: Mosaic Chopper.png Type: image/png Size: 33079 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: Mosaic Instance Manager.png Type: image/png Size: 23271 bytes Desc: not available URL: From iainduncanlists at gmail.com Sat Jan 15 09:52:16 2022 From: iainduncanlists at gmail.com (Iain Duncan) Date: Sat, 15 Jan 2022 09:52:16 -0800 Subject: [CM] question about pretty-print and object serialization Message-ID: Hi Bill and list, I've been playing with the pretty-print function in write.scm in further attempts to make a nice "back to code" serializer for my sequencers. I have the back to text part working at a basic level using the below, but it comes out as one long line. (define (save-seq seq-obj filename) (let ((data (object->string (seq-1 'get '_) :readable))) (call-with-output-file filename (lambda (port) (write data port))))) It would be great to be able to use pretty-print to have it formatted with nice indendtation, but (pp obj) doesn't print entire vectors, they end with the ... stuff. Is there a way to use pretty-print with object->string to get a pretty printed dump that has everything one needs to reload via eval-string? Or some other approach that I haven't thought of? Figured I'd ask before I start mucking with regex's. thanks! iain -------------- next part -------------- An HTML attachment was scrubbed... URL: From bil at ccrma.Stanford.EDU Sat Jan 15 10:33:21 2022 From: bil at ccrma.Stanford.EDU (bil at ccrma.Stanford.EDU) Date: Sat, 15 Jan 2022 10:33:21 -0800 Subject: [CM] question about pretty-print and object serialization In-Reply-To: References: Message-ID: I think the "..." truncation of vectors depends on the (*s7* 'print-length) setting. It's 12 for historical reasons. I think the :readable argument to object->string (and the `W format option) came after write.scm and pretty-print, so pretty-print might not be as complete in that regard. From iainduncanlists at gmail.com Sat Jan 15 10:38:35 2022 From: iainduncanlists at gmail.com (Iain Duncan) Date: Sat, 15 Jan 2022 10:38:35 -0800 Subject: [CM] question about pretty-print and object serialization In-Reply-To: References: Message-ID: thanks Bill. I'll keep poking at it! iain On Sat, Jan 15, 2022 at 10:33 AM wrote: > I think the "..." truncation of vectors depends on the > (*s7* 'print-length) setting. It's 12 for historical > reasons. I think the :readable argument to object->string > (and the `W format option) came after write.scm and > pretty-print, so pretty-print might not be as complete > in that regard. > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From iainduncanlists at gmail.com Sun Jan 16 09:47:40 2022 From: iainduncanlists at gmail.com (Iain Duncan) Date: Sun, 16 Jan 2022 09:47:40 -0800 Subject: [CM] Error trying to load Alex Shinn's regext library Message-ID: Hi, I thought I would try loading Alex's Shinn's iregex library from http://synthcode.com/scheme/irregex but I'm getting an error that I'm not sure how to fix. I try to load irregex.scm and get the error below. I'm hoping someone can tell me if this is something I just need to patch in s7? or any other suggestions? thanks! > (load "irregex.scm") ;integer->char argument 1, 55295, is out of range (it doen't fit in an unsigned byte) ; integer->char ; irregex.scm, line 360, position: 15546 ; ((integer->char 57344) (integer->char 111... ; ((lambda (hook lst) (if (do ((p lst (cdr ... -------------- next part -------------- An HTML attachment was scrubbed... URL: From iainduncanlists at gmail.com Sun Jan 16 09:49:01 2022 From: iainduncanlists at gmail.com (Iain Duncan) Date: Sun, 16 Jan 2022 09:49:01 -0800 Subject: [CM] Error trying to load Alex Shinn's regext library In-Reply-To: References: Message-ID: FWIW, his site says "A fully portable and efficient R[4567]RS implementation of regular expressions, supporting both POSIX syntax with various (irregular) PCRE extensions, as well as SCSH's SRE syntax, with various aliases for commonly used patterns. " So seems like it should be possible? iain On Sun, Jan 16, 2022 at 9:47 AM Iain Duncan wrote: > Hi, I thought I would try loading Alex's Shinn's iregex library from > http://synthcode.com/scheme/irregex but I'm getting an error that I'm not > sure how to fix. I try to load irregex.scm and get the error below. I'm > hoping someone can tell me if this is something I just need to patch in s7? > or any other suggestions? > > thanks! > > > (load "irregex.scm") > > ;integer->char argument 1, 55295, is out of range (it doen't fit in an > unsigned byte) > ; integer->char > ; irregex.scm, line 360, position: 15546 > ; ((integer->char 57344) (integer->char 111... > ; ((lambda (hook lst) (if (do ((p lst (cdr ... > -------------- next part -------------- An HTML attachment was scrubbed... URL: From iainduncanlists at gmail.com Sun Jan 16 09:52:45 2022 From: iainduncanlists at gmail.com (Iain Duncan) Date: Sun, 16 Jan 2022 09:52:45 -0800 Subject: [CM] Error trying to load Alex Shinn's regext library In-Reply-To: References: Message-ID: My apologies for the noise, I'm an idiot who didn't read far enough through the docs. (RTFM and all that). One just needs to change the *all-chars* definition to the ASCII version in irregex.scm. I'll let people know how it goes! iain On Sun, Jan 16, 2022 at 9:49 AM Iain Duncan wrote: > FWIW, his site says "A fully portable and efficient R[4567]RS > implementation of regular expressions, supporting both POSIX syntax with > various (irregular) PCRE extensions, as well as SCSH's SRE syntax, with > various aliases for commonly used patterns. " > > So seems like it should be possible? > iain > > > On Sun, Jan 16, 2022 at 9:47 AM Iain Duncan > wrote: > >> Hi, I thought I would try loading Alex's Shinn's iregex library from >> http://synthcode.com/scheme/irregex but I'm getting an error that I'm >> not sure how to fix. I try to load irregex.scm and get the error below. I'm >> hoping someone can tell me if this is something I just need to patch in s7? >> or any other suggestions? >> >> thanks! >> >> > (load "irregex.scm") >> >> ;integer->char argument 1, 55295, is out of range (it doen't fit in an >> unsigned byte) >> ; integer->char >> ; irregex.scm, line 360, position: 15546 >> ; ((integer->char 57344) (integer->char 111... >> ; ((lambda (hook lst) (if (do ((p lst (cdr ... >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From deeteeoh1138 at gmail.com Sun Jan 16 10:57:23 2022 From: deeteeoh1138 at gmail.com (David O'Toole) Date: Sun, 16 Jan 2022 13:57:23 -0500 Subject: [CM] Squeak frontend to SchemeMosaic and Snd In-Reply-To: References: Message-ID: A quick follow up: I've made some audiovisual demos of the updated GUI. https://www.youtube.com/watch?v=I4adAAyYWO8 https://www.youtube.com/watch?v=Y-LNlHgOFeQ Feel free to reach out if you are interested in concatenative synthesis or related topics! On Thu, Jan 13, 2022 at 7:56 PM David O'Toole wrote: > Greetings, S7 Schemers :) > > I hope everyone is having a safe and happy new year. > > I am working on a Squeak Smalltalk frontend for SchemeMosaic, my > concatenative synthesis toolkit add-on for Snd. Squeak has a rich graphical > user interface framework called Morphic, so this frontend should be much > nicer and much more usable than the Emacs one I built before. I have > attached some screenshots of the (very rough but working) GUI thus far. > > I don't have to stop at just the features of Mosaic. Although it may not > be possible to replicate the entire GUI of Snd, a significant range of > functionality could be exposed to the graphical Squeak environment. This > could be really fun for experimenting with beats and concatenative > synthesis. > > SchemeMosaic's current bleeding edge source can be found at: > https://gitlab.com/dto/mosaic > but > I wouldn't try running the GUI just yet. I need a little more time to make > a proper alpha release. > > If you want some general information about the project, the old webpage is > here, I'm finding a new home for it so the only option right now is > Internet Archive. > http://web.archive.org/web/20210115113453/http://xelf.me/scheme-mosaic.html > > I will keep you informed! > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From salutis at me.com Mon Jan 17 07:36:18 2022 From: salutis at me.com (=?utf-8?Q?Rudolf_Adamkovi=C4=8D?=) Date: Mon, 17 Jan 2022 16:36:18 +0100 Subject: [CM] R7RS support Message-ID: Hi there! At Egghead Games, we would like to use Scheme for in-app scripting. We wired up s7 and SQLite to kick things off, but s7 support for R7RS does not seem to work. Below, I include some examples to illustrate my point. A basic example from the R7RS standard, page 54, ? (with-exception-handler (lambda (x) (display "something went wrong\n")) (lambda () (+ 1 (raise ?an-error)))) ? results in: > Error: catch error handler should accept two arguments: # The simplest library ? (load "r7rs.scm") (define-library (some lib) (export some-proc) (import (scheme base) (scheme r5rs)) (begin (define (some-proc x) (display x)))) ? results in: > Error: symbol->value first argument, {gensym}-1, is a macro but should > be a symbol (define-macro ({gensym}-1 . names)... We picked s7 because the website says ? > I believe it is compatible with r5rs and r7r ? but per a quick grep, there seem to exist no tests for define-library or with-exception-handler. Any ideas? Rudy -- "Logic is a science of the necessary laws of thought, without which no employment of the understanding and the reason takes place." -- Immanuel Kant, 1785 Rudolf Adamkovi? [he/him] Studenohorsk? 25 84103 Bratislava Slovakia From iainduncanlists at gmail.com Mon Jan 17 07:52:26 2022 From: iainduncanlists at gmail.com (Iain Duncan) Date: Mon, 17 Jan 2022 07:52:26 -0800 Subject: [CM] R7RS support In-Reply-To: References: Message-ID: Hi Rudolf, Bill would be the person to address this better than me, but I think the Egghead team should read through the s7.html page pretty closely to see if s7 is a good fit. It's pretty clear in there that there is *limited* R7RS compatibility, but that s7 is not R7RS and nor is that a stated goal. For example, s7 does not do macros with syntax-case or syntax-rules, but uses CL style macros. If R7RS is what you need, you might be better off with an implementation that makes that a goal, such as Chibi. I use s7 embedded in audio programs, which shares a fair bit of domain space with games, and I personally chose s7 because the performance and ease of embedding made up for that, but YMMV! HTH iain On Mon, Jan 17, 2022 at 7:36 AM Rudolf Adamkovi? wrote: > Hi there! > > At Egghead Games, we would like to use Scheme for in-app scripting. We > wired up s7 and SQLite to kick things off, but s7 support for R7RS does > not seem to work. Below, I include some examples to illustrate my > point. > > A basic example from the R7RS standard, page 54, ? > > (with-exception-handler > (lambda (x) > (display "something went wrong\n")) > (lambda () > (+ 1 (raise ?an-error)))) > > ? results in: > > > Error: catch error handler should accept two arguments: # > > The simplest library ? > > (load "r7rs.scm") > (define-library (some lib) > (export some-proc) > (import (scheme base) > (scheme r5rs)) > (begin > (define (some-proc x) > (display x)))) > > ? results in: > > > Error: symbol->value first argument, {gensym}-1, is a macro but should > > be a symbol (define-macro ({gensym}-1 . names)... > > We picked s7 because the website says ? > > > I believe it is compatible with r5rs and r7r > > ? but per a quick grep, there seem to exist no tests for define-library > or with-exception-handler. > > Any ideas? > > Rudy > -- > "Logic is a science of the necessary laws of thought, without which no > employment of the understanding and the reason takes place." -- Immanuel > Kant, 1785 > > Rudolf Adamkovi? [he/him] > Studenohorsk? 25 > 84103 Bratislava > Slovakia > > _______________________________________________ > Cmdist mailing list > Cmdist at ccrma.stanford.edu > https://cm-mail.stanford.edu/mailman/listinfo/cmdist > -------------- next part -------------- An HTML attachment was scrubbed... URL: From bil at ccrma.Stanford.EDU Mon Jan 17 10:12:53 2022 From: bil at ccrma.Stanford.EDU (bil at ccrma.Stanford.EDU) Date: Mon, 17 Jan 2022 10:12:53 -0800 Subject: [CM] R7RS support In-Reply-To: References: Message-ID: <3571dfda0c344032cbca207bf9fce33a@ccrma.stanford.edu> The with-exception definition in r7rs.scm probably should be (define (with-exception-handler handler thunk) (catch #t thunk (lambda args (apply handler args)))) The define-library code dates from the days (years ago) when s7's define-macro returned the symbol rather than the value. Also, I apparently missed the built-in library for r5rs names. For the latter add (apply define (symbol (object->string '(scheme r5rs))) (inlet) ()) For the former 295c296 < (cons 'export (symbol->value --- > (cons 'export ;(symbol->value 297c298 < `(set! *export* (append ',names *export*)))))) --- > `(set! *export* (append ',names *export*)))));) That is, symbol->value is probably not needed anymore. From m.gubinelli at gmail.com Mon Jan 17 10:41:57 2022 From: m.gubinelli at gmail.com (Massimiliano Gubinelli) Date: Mon, 17 Jan 2022 19:41:57 +0100 Subject: [CM] TeXmacs & S7 Message-ID: <266105D8-925E-4861-A99F-DAAD322EF302@gmail.com> Dear all, integration of S7 in the TeXmacs document editor (www.texmacs.org) has been quite successful so far. You can grab the associated development branch here at github https://github.com/texmacs/texmacs/tree/wip_s7 you will need Qt 4/5 and some other libraries to compile it. Some preliminary tests (which I think I've already posted on this list) and comments on the intergation of various kinds of schemes in TeXmacs are here https://texmacs.github.io/notes/docs/scheming.html Speed is great, much better than guile 1.8 (our standard scheme implementation) for the most part. Some users reported slowing down in some tasks (like converting to LaTeX) but I still haven't measured this. We use a mostly unmodified version of S7 where only the patch attached below is used. It modifies the way lookup_from works, by putting at the beginning of the symbol list symbols which are way back and are looked upon. For us this is a game-changer : without it TeXmacs/S7 is unusable. We rely on scheme on many places, in particular the menus and the UI is dynamically generated from scheme descriptions at each keypress, in response to changes of the position of the cursor in the document (which affects which element the user is current focussing and therefore which UI elements are appropriate to show). We experience problems with the memory footprint of the program. TeXmacs/Guile uses usually ~500MB on my Mac while TeXmacs/S7 goes slowly up to ~1GB and some users saw also ~2GB of memory footprint. I have a couple of requests for the developer(s?): 1) would it be possible to have loopup_from implemented via some hash table or some speedier lookup? It would be great to shave some more performances out of this. Alternatively, can our patch be made into the official version? (or maybe some improved version of it) 2) Suggestions to explain the high memory usage? Do somebody else also experience these problems? Thanks for this great program. Best regards, Massimiliano Gubinelli ------ diff --git a/src/src/Scheme/S7/s7.c b/src/src/Scheme/S7/s7.c index ed5965591..f0c3488dd 100644 --- a/src/src/Scheme/S7/s7.c +++ b/src/src/Scheme/S7/s7.c @@ -10124,10 +10124,20 @@ static inline s7_pointer lookup_from(s7_scheme *sc, const s7_pointer symbol, s7_ } for (; is_let(e); e = let_outlet(e)) { - s7_pointer y; - for (y = let_slots(e); tis_slot(y); y = next_slot(y)) - if (slot_symbol(y) == symbol) - return(slot_value(y)); + s7_pointer y, py; + int steps = 0; + for (y = let_slots(e); tis_slot(y); py = y, y = next_slot(y), steps++) + if (slot_symbol(y) == symbol) { + /* (TeXmacs) We try to bring back symbols which are used frequently to the + beginning of the list. This improves the lookup in TeXmacs. + The threshold is chosen heuristically.*/ + if (steps > 100) { + next_slot(py) = next_slot(y); + next_slot(y) = let_slots(e); + let_slots(e) = y; + } + return(slot_value(y)); + } } if (is_slot(global_slot(symbol))) return(slot_value(global_slot(symbol))); From bil at ccrma.Stanford.EDU Mon Jan 17 12:13:10 2022 From: bil at ccrma.Stanford.EDU (bil at ccrma.Stanford.EDU) Date: Mon, 17 Jan 2022 12:13:10 -0800 Subject: [CM] TeXmacs & S7 In-Reply-To: <266105D8-925E-4861-A99F-DAAD322EF302@gmail.com> References: <266105D8-925E-4861-A99F-DAAD322EF302@gmail.com> Message-ID: Thanks for the observations -- I'm glad s7 has worked out reasonably well. On your questions: 1) would it be possible to have lookup_from implemented via some hash table...? Alternatively, can our patch be made into the official version? Currently, s7's optimizer sometimes depends on the position of the variables in environments, so your change is only safe if the optimizer gives up. Since the order matters, a hash-table lookup is unlikely to work without some serious overhead. Most environments have only a handful of locals, and a small linear search is faster than a hash-table lookup (and the search is unnecessary if the variables have unique names). I think your situation is an unusual case: you apparently have more than 100 local variables in an environment, and the ones you want do not have unique names. I wonder if you could use a hash-table for the local variables. Or (kinda ugly) look at the code and place the most used variables so they are at the front of the list of slots (I can't immediately remember whether that means first or last in the list of let variables). 2) Suggestions to explain the high memory usage? (*s7* 'memory-usage) can tell you what is taking up the space. If that doesn't help, you might be able to tune the GC with the gc-related fields in *s7*. From elronnd at elronnd.net Mon Jan 17 12:23:20 2022 From: elronnd at elronnd.net (Elijah Stone) Date: Mon, 17 Jan 2022 12:23:20 -0800 (PST) Subject: [CM] TeXmacs & S7 In-Reply-To: References: <266105D8-925E-4861-A99F-DAAD322EF302@gmail.com> Message-ID: <68892cb3-b5b-330-13e7-f9f87d73194@elronnd.net> On Mon, 17 Jan 2022, bil at ccrma.Stanford.EDU wrote: > Currently, s7's optimizer sometimes depends on the position of the > variables in environments, so your change is only safe if the optimizer > gives up. Since the order matters, a hash-table lookup is unlikely to > work without some serious overhead. Most environments have only a > handful of locals, and a small linear search is faster than a hash-table > lookup (and the search is unnecessary if the variables have unique > names). Why not maintain a hash table whose values are offsets into the flat environment? Then it's a cheap branch or two on lookup to see: 1) is there a hash table; 2) should I build one (is the env big enough, and have there been enough lookups). -E From elronnd at elronnd.net Mon Jan 17 12:28:06 2022 From: elronnd at elronnd.net (Elijah Stone) Date: Mon, 17 Jan 2022 12:28:06 -0800 (PST) Subject: [CM] TeXmacs & S7 In-Reply-To: <68892cb3-b5b-330-13e7-f9f87d73194@elronnd.net> References: <266105D8-925E-4861-A99F-DAAD322EF302@gmail.com> <68892cb3-b5b-330-13e7-f9f87d73194@elronnd.net> Message-ID: Another idea is inline caching... On Mon, 17 Jan 2022, Elijah Stone wrote: > On Mon, 17 Jan 2022, bil at ccrma.Stanford.EDU wrote: > >> Currently, s7's optimizer sometimes depends on the position of the >> variables in environments, so your change is only safe if the optimizer >> gives up. Since the order matters, a hash-table lookup is unlikely to work >> without some serious overhead. Most environments have only a handful of >> locals, and a small linear search is faster than a hash-table lookup (and >> the search is unnecessary if the variables have unique names). > > Why not maintain a hash table whose values are offsets into the flat > environment? Then it's a cheap branch or two on lookup to see: 1) is there a > hash table; 2) should I build one (is the env big enough, and have there been > enough lookups). > > -E > _______________________________________________ > Cmdist mailing list > Cmdist at ccrma.stanford.edu > https://cm-mail.stanford.edu/mailman/listinfo/cmdist > From bil at ccrma.Stanford.EDU Mon Jan 17 12:34:58 2022 From: bil at ccrma.Stanford.EDU (bil at ccrma.Stanford.EDU) Date: Mon, 17 Jan 2022 12:34:58 -0800 Subject: [CM] TeXmacs & S7 In-Reply-To: <68892cb3-b5b-330-13e7-f9f87d73194@elronnd.net> References: <266105D8-925E-4861-A99F-DAAD322EF302@gmail.com> <68892cb3-b5b-330-13e7-f9f87d73194@elronnd.net> Message-ID: <54fb7ee8ee1d07b0c8a2f579bc7d007c@ccrma.stanford.edu> > Why not maintain a hash table whose values are offsets into the flat > environment? > Then it's a cheap branch or two on lookup to see: 1) is there a hash > table; > 2) should I build one (is the env big enough, and have there been > enough lookups). I call that serious overhead. Environments come and go at an amazing pace. Most lookups are already immediate (do not involve a search). In some cases (non-recursive, safe functions), I can save the environment and reuse it, so some analysis might be acceptable. I doubt that applies here because apparently the optimizer already threw up its hands. (Environments in s7 are very dynamic -- I do not currently try to keep the env's length stored somewhere, and to get it is nearly as bad as a linear search). From bil at ccrma.Stanford.EDU Mon Jan 17 12:40:53 2022 From: bil at ccrma.Stanford.EDU (bil at ccrma.Stanford.EDU) Date: Mon, 17 Jan 2022 12:40:53 -0800 Subject: [CM] TeXmacs & S7 In-Reply-To: References: <266105D8-925E-4861-A99F-DAAD322EF302@gmail.com> <68892cb3-b5b-330-13e7-f9f87d73194@elronnd.net> Message-ID: <56892dcc4562cb2d2741ddeac1d27f40@ccrma.stanford.edu> > Another idea is inline caching... And probably better than a hash-table, but it's yet another layer in an already complicated process. I might try that just to see what happens -- thanks for the suggestion! From elronnd at elronnd.net Mon Jan 17 12:52:50 2022 From: elronnd at elronnd.net (Elijah Stone) Date: Mon, 17 Jan 2022 12:52:50 -0800 (PST) Subject: [CM] TeXmacs & S7 In-Reply-To: <54fb7ee8ee1d07b0c8a2f579bc7d007c@ccrma.stanford.edu> References: <266105D8-925E-4861-A99F-DAAD322EF302@gmail.com> <68892cb3-b5b-330-13e7-f9f87d73194@elronnd.net> <54fb7ee8ee1d07b0c8a2f579bc7d007c@ccrma.stanford.edu> Message-ID: <10da8b6-237c-f5a8-991-6fd8fe5aaada@elronnd.net> > Environments come and go at an amazing pace That's why I suggest to only build a hash table only after a certain number of accesses. -E From m.gubinelli at gmail.com Mon Jan 17 14:08:44 2022 From: m.gubinelli at gmail.com (Massimiliano Gubinelli) Date: Mon, 17 Jan 2022 23:08:44 +0100 Subject: [CM] TeXmacs & S7 In-Reply-To: References: <266105D8-925E-4861-A99F-DAAD322EF302@gmail.com> Message-ID: <00701745-D843-41CD-9F38-3198E41CE7DC@gmail.com> Dear Bill, thanks for the remarks. Do I understand you correclty that the patch I implemented break some assumption of your code. Is there a way to be sure I'm not introducing any bug? Best, Max > On 17. Jan 2022, at 21:13, bil at ccrma.stanford.edu wrote: > > Currently, s7's optimizer sometimes depends on the position of the variables > in environments, so your change is only safe if the optimizer gives up. > Since the order matters, a hash-table lookup is unlikely to work without > some serious overhead. Most environments have only a handful of locals, and > a small linear search is faster than a hash-table lookup (and the search is > unnecessary if the variables have unique names). > -------------- next part -------------- An HTML attachment was scrubbed... URL: From bil at ccrma.Stanford.EDU Mon Jan 17 14:28:23 2022 From: bil at ccrma.Stanford.EDU (bil at ccrma.Stanford.EDU) Date: Mon, 17 Jan 2022 14:28:23 -0800 Subject: [CM] TeXmacs & S7 In-Reply-To: <00701745-D843-41CD-9F38-3198E41CE7DC@gmail.com> References: <266105D8-925E-4861-A99F-DAAD322EF302@gmail.com> <00701745-D843-41CD-9F38-3198E41CE7DC@gmail.com> Message-ID: <491efd46a01855c1b9ce4dda904a396b@ccrma.stanford.edu> > Do I understand you correclty that the patch I > implemented break some assumption of your code In general, yes. I'd have to read through the code -- I glanced at it a few months ago, but can't remember any details, except that it struck me as written for Guile 1.8? and perhaps awkward for s7 (something about modules?). From mike at eggheadgames.com Mon Jan 17 15:01:51 2022 From: mike at eggheadgames.com (mike at eggheadgames.com) Date: Tue, 18 Jan 2022 07:01:51 +0800 Subject: [CM] R7RS support In-Reply-To: References: Message-ID: <11258CB3-4C1A-4FBA-84BF-CC494FA195B0@eggheadgames.com> Thanks Iain, great observations and info. Yes, we?ve read s7.html many times and will continue to do so. There?s a lot of great info there! (We?ve found many of the included scm files are also good sources too.) FYI, we?re looking at adopting R7RS more as a future-proofing strategy than ?we need every single feature and exact compatibility?. Having successfully shipped some basic functionality on iOS as a proof-of-concept, we?re stepping back and tweaking our development environment & tooling. Currently we?re attempting to run our code with Guile and its R7RS libraries, in part to take advantage of the nice tooling in Geiser in Emacs. The goal is to have our integration & unit tests run in both s7 and Guile (and/or other R7RS-compatible Schemes) with minimal shim layers. If we can keep the ease of embedding, small size and performance of s7 for mobile while doing this, then dare I say we?ll have our cake and eat it too? :) Cheers, Michael On 17 Jan 2022, at 23:52, Iain Duncan wrote: > Hi Rudolf, Bill would be the person to address this better than me, > but I > think the Egghead team should read through the s7.html page pretty > closely > to see if s7 is a good fit. It's pretty clear in there that there is > *limited* R7RS compatibility, but that s7 is not R7RS and nor is that > a > stated goal. For example, s7 does not do macros with syntax-case or > syntax-rules, but uses CL style macros. If R7RS is what you need, you > might > be better off with an implementation that makes that a goal, such as > Chibi. > I use s7 embedded in audio programs, which shares a fair bit of domain > space with games, and I personally chose s7 because the performance > and > ease of embedding made up for that, but YMMV! > > HTH > iain > > On Mon, Jan 17, 2022 at 7:36 AM Rudolf Adamkovi? > wrote: > >> Hi there! >> >> At Egghead Games, we would like to use Scheme for in-app scripting. >> We >> wired up s7 and SQLite to kick things off, but s7 support for R7RS >> does >> not seem to work. Below, I include some examples to illustrate my >> point. >> >> A basic example from the R7RS standard, page 54, ? >> >> (with-exception-handler >> (lambda (x) >> (display "something went wrong\n")) >> (lambda () >> (+ 1 (raise ?an-error)))) >> >> ? results in: >> >>> Error: catch error handler should accept two arguments: #>> (x)> >> >> The simplest library ? >> >> (load "r7rs.scm") >> (define-library (some lib) >> (export some-proc) >> (import (scheme base) >> (scheme r5rs)) >> (begin >> (define (some-proc x) >> (display x)))) >> >> ? results in: >> >>> Error: symbol->value first argument, {gensym}-1, is a macro but >>> should >>> be a symbol (define-macro ({gensym}-1 . names)... >> >> We picked s7 because the website says ? >> >>> I believe it is compatible with r5rs and r7r >> >> ? but per a quick grep, there seem to exist no tests for >> define-library >> or with-exception-handler. >> >> Any ideas? >> >> Rudy >> -- >> "Logic is a science of the necessary laws of thought, without which >> no >> employment of the understanding and the reason takes place." -- >> Immanuel >> Kant, 1785 >> >> Rudolf Adamkovi? [he/him] >> Studenohorsk? 25 >> 84103 Bratislava >> Slovakia >> >> _______________________________________________ >> Cmdist mailing list >> Cmdist at ccrma.stanford.edu >> https://cm-mail.stanford.edu/mailman/listinfo/cmdist >> > _______________________________________________ > Cmdist mailing list > Cmdist at ccrma.stanford.edu > https://cm-mail.stanford.edu/mailman/listinfo/cmdist -------------- next part -------------- An HTML attachment was scrubbed... URL: From m.gubinelli at gmail.com Tue Jan 18 01:03:50 2022 From: m.gubinelli at gmail.com (Massimiliano Gubinelli) Date: Tue, 18 Jan 2022 10:03:50 +0100 Subject: [CM] TeXmacs & S7 In-Reply-To: <491efd46a01855c1b9ce4dda904a396b@ccrma.stanford.edu> References: <266105D8-925E-4861-A99F-DAAD322EF302@gmail.com> <00701745-D843-41CD-9F38-3198E41CE7DC@gmail.com> <491efd46a01855c1b9ce4dda904a396b@ccrma.stanford.edu> Message-ID: <95635502-DE9A-44A4-B986-BF26FE1EAD9B@gmail.com> > On 17. Jan 2022, at 23:28, bil at ccrma.stanford.edu wrote: > >> Do I understand you correclty that the patch I >> implemented break some assumption of your code > > In general, yes. I'd have to read through the > code -- I glanced at it a few months ago, but > can't remember any details, except that it struck > me as written for Guile 1.8? and perhaps > awkward for s7 (something about modules?). > Yes, the current code was written for Guile 1.8 and we use some module stuff, which I simulated via lets. (It is some time I wrote that code too, so now I forgot the fine details). We have a large module which contains all the user accessible procedures and we have a system to overload them (tm-define, you can look it up in the file ./TeXmacs/progs/kernel/texmacs/tm-define.scm). My guess is that this module is getting populated with a lot of symbols and this slows down S7 without my patch. But frankly I do not understand well the logic of lookup in S7. Would you mind to give us a (maybe rapid) overview of how lookup is implemented? I would really like to have some "correct" solution which make S7 works with TeXmacs. We are currently evaluating seriously to use it in the future but we would like to have to iron out these problems (lookup & memory footprint) which even if small produce large effects in our usecase. I guess the problem with lookup is localized in this only large module that we have. What I prefer not do is to change all our implementation because of it. Ideally I would like to keep the code "implementation agnostic" as it is now, and provide a compatibility layer to adapt to various scheme implementations. This is currently the case, we have implementations working with Guile 1.6, 1.8, 3.0 and S7. Best Max From bil at ccrma.Stanford.EDU Tue Jan 18 05:59:52 2022 From: bil at ccrma.Stanford.EDU (bil at ccrma.Stanford.EDU) Date: Tue, 18 Jan 2022 05:59:52 -0800 Subject: [CM] TeXmacs & S7 In-Reply-To: <95635502-DE9A-44A4-B986-BF26FE1EAD9B@gmail.com> References: <266105D8-925E-4861-A99F-DAAD322EF302@gmail.com> <00701745-D843-41CD-9F38-3198E41CE7DC@gmail.com> <491efd46a01855c1b9ce4dda904a396b@ccrma.stanford.edu> <95635502-DE9A-44A4-B986-BF26FE1EAD9B@gmail.com> Message-ID: <70319d54ba152c187cbfe2fc5b53da21@ccrma.stanford.edu> It's not the size of the environment that matters; look at libgsl.scm (or the timing test tools/tgsl.scm) -- it creates the *libgsl* environment that has about 2600 entries, but lookup_from takes up maybe 2% of the total time). Or tools/tlet.scm which creates an environment with 1000000 entries, then sums them all and so on. It essentially never has to do a linear search. If I can find the time, I'll try to see what is happening in texmacs. annotate_callgrind output from a sample run might help. (Run texmacs under valgrind --tool=callgrind, then run the output of that through annotate_callgrind --auto=yes --show-percs=no --threshold=100 callgrind.out. > output) where is the number at the end of the callgrind output file name.) From salutis at me.com Tue Jan 18 08:48:07 2022 From: salutis at me.com (Rudolf =?utf-8?Q?Adamkovi=C4=8D?=) Date: Tue, 18 Jan 2022 17:48:07 +0100 Subject: [CM] R7RS support In-Reply-To: <3571dfda0c344032cbca207bf9fce33a@ccrma.stanford.edu> References: <3571dfda0c344032cbca207bf9fce33a@ccrma.stanford.edu> Message-ID: bil at ccrma.Stanford.EDU writes: > The with-exception definition in r7rs.scm probably should be > > (define (with-exception-handler handler thunk) > (catch #t thunk (lambda args (apply handler args)))) It still fails with the 101 example from the R7RS standard: ;; ? (with-exception-handler ;; (lambda (x) ;; (display "something went wrong\n")) ;; (lambda () ;; (+ 1 (raise 'an-error)))) I get the error: ;; (apply handler args): too many arguments: ((lambda (x) ...) ;; unbound-variable ("unbound variable ~S in ~S" ;; raise (+ 1 (raise 'an-error)))) ;; (apply handler args) ;; *stdout*, line 1, position: 92 ;; (apply handler args) I came up with the following, which seems to work: ;; ? (define (with-exception-handler handler thunk) ;; (catch #t thunk (lambda args (apply handler args)))) As a beginner, I ask: Do you approve? > The define-library code dates from the days (years ago) > when s7's define-macro returned the symbol rather than > the value. Also, I apparently missed the built-in library > for r5rs names. For the latter add > > [?] > > That is, symbol->value is probably not needed anymore. This helped me tremendously. *** Thank you so much, Bill! *** (It also made me scared to use the R7RS features!) To finish the job, I made the libraries load *implicitly* with ? ;; (define-macro (import . libs) ;; (begin ;; ;; (let recur ((libs libs)) ;; (if (null? libs) #t ;; (begin ;; (load (library-file (car libs))) ;; (recur (cdr libs))))) ;; ;; `(varlet ? where the 'library-file' procedure converts, for example, '(foo-bar baz)' to 'foo-bar-baz.scm'. Now, a simple 'import' call loads the library and every works right away, like in the big Schemes. I would like to thank you again, Bill. Your expert advice helped me. P.S. We now have two screens in one of our games powered by s7, and everything seems good. Onward and upward! Rudy -- "'Contrariwise,' continued Tweedledee, 'if it was so, it might be; and if it were so, it would be; but as it isn't, it ain't. That's logic.'" -- Lewis Carroll, Through the Looking Glass Rudolf Adamkovi? [he/him] Studenohorsk? 25 84103 Bratislava Slovakia From deeteeoh1138 at gmail.com Tue Jan 18 09:23:46 2022 From: deeteeoh1138 at gmail.com (David O'Toole) Date: Tue, 18 Jan 2022 12:23:46 -0500 Subject: [CM] [audio] recent concatenative synthesis demos Message-ID: Hi! I've been working on improvements to the Mosaic system and have some brief audio demos to share. https://soundcloud.com/worcesterwave/sets/new-demos I sliced seven Whitney Houston a cappella vocal recordings into a database of about 10,000 fragments, and did the same for Zoltan Kodaly's Sonata for Solo Cello. Then I experimented with matching these to each other and to Ligeti's piano etudes. Results are somewhat mixed but highly promising in my opinion. My choice of material is more or less arbitrary, and in some areas matching performance isn't great. (It's easy to silence incorrect matches in an editor, so this is still quite usable. But I want to constantly improve it.) But in other spots the matching is eerily appropriate! Especially when Paulstretched, I enjoy some of these as experimental "magnetic tape collage" pieces made out of various recordings. I just added a feature to set the lowpass cutoff of the spectra being compared during search, and that boosted the quality I think, hence my posting of some new sounds. Hope you enjoy! -------------- next part -------------- An HTML attachment was scrubbed... URL: From bil at ccrma.Stanford.EDU Tue Jan 18 09:28:23 2022 From: bil at ccrma.Stanford.EDU (bil at ccrma.Stanford.EDU) Date: Tue, 18 Jan 2022 09:28:23 -0800 Subject: [CM] R7RS support In-Reply-To: References: <3571dfda0c344032cbca207bf9fce33a@ccrma.stanford.edu> Message-ID: <8b204712f6cd5be50f381dd7550657bb@ccrma.stanford.edu> > As a beginner, I ask: Do you approve? Yes. > (It also made me scared to use the R7RS features!) Do you know if there is a test suite for the r7rs additions? > To finish the job, I made the libraries load *implicitly* with ? Oh, I assumed the libraries were already loaded -- could you send me the library-file code also? -- I'll update r7rs.scm -- thanks! From mike at eggheadgames.com Tue Jan 18 19:38:18 2022 From: mike at eggheadgames.com (mike at eggheadgames.com) Date: Wed, 19 Jan 2022 11:38:18 +0800 Subject: [CM] R7RS support In-Reply-To: <8b204712f6cd5be50f381dd7550657bb@ccrma.stanford.edu> References: <3571dfda0c344032cbca207bf9fce33a@ccrma.stanford.edu> <8b204712f6cd5be50f381dd7550657bb@ccrma.stanford.edu> Message-ID: <6D3F26AD-5A23-4FCF-A7D9-EBA094E232F4@eggheadgames.com> > Do you know if there is a test suite for the r7rs additions? There are a lot of tests in the chibi-scheme repo, e.g.: https://github.com/ashinn/chibi-scheme/blob/master/tests/r7rs-tests.scm I?m not sure if that?s what you were seeking, but hopefully it?s useful. It appears to cover many R7RS features. However other files in that directory appear at first glance to test overlapping areas as well. Thanks again for your responses Bill! Cheers, Michael From salutis at me.com Wed Jan 19 11:58:03 2022 From: salutis at me.com (Rudolf =?utf-8?Q?Adamkovi=C4=8D?=) Date: Wed, 19 Jan 2022 20:58:03 +0100 Subject: [CM] R7RS support In-Reply-To: <8b204712f6cd5be50f381dd7550657bb@ccrma.stanford.edu> References: <3571dfda0c344032cbca207bf9fce33a@ccrma.stanford.edu> <8b204712f6cd5be50f381dd7550657bb@ccrma.stanford.edu> Message-ID: bil at ccrma.Stanford.EDU writes: >> As a beginner, I ask: Do you approve? > > Yes. Thank you! >> To finish the job, I made the libraries load *implicitly* with ? > > Oh, I assumed the libraries were already loaded -- could you send > me the library-file code also? -- I'll update r7rs.scm -- thanks! Please see the WIP attached patch. You will probably want to inline the 'library-file' function, optimize things, etc. Note that we now also use "(import (prefix ?", and it loads and works great. -------------- next part -------------- A non-text attachment was scrubbed... Name: 0001-Load-R-RS-libraries-on-import.patch Type: text/x-patch Size: 2226 bytes Desc: R7RS load on import URL: -------------- next part -------------- Rudy -- "Logic is a science of the necessary laws of thought, without which no employment of the understanding and the reason takes place." -- Immanuel Kant, 1785 Rudolf Adamkovi? [he/him] Studenohorsk? 25 84103 Bratislava Slovakia From bil at ccrma.Stanford.EDU Wed Jan 19 13:43:31 2022 From: bil at ccrma.Stanford.EDU (bil at ccrma.Stanford.EDU) Date: Wed, 19 Jan 2022 13:43:31 -0800 Subject: [CM] R7RS support In-Reply-To: References: <3571dfda0c344032cbca207bf9fce33a@ccrma.stanford.edu> <8b204712f6cd5be50f381dd7550657bb@ccrma.stanford.edu> Message-ID: <92ce760461959b75810def4fed7139b1@ccrma.stanford.edu> Thanks! I'll merge those changes into my version. r7rs.scm can almost pass the chibi r7rs tests -- if I had 2 minutes of uninterrupted time, I'd be done. From salutis at me.com Fri Jan 21 08:27:31 2022 From: salutis at me.com (Rudolf =?utf-8?Q?Adamkovi=C4=8D?=) Date: Fri, 21 Jan 2022 17:27:31 +0100 Subject: [CM] R7RS support In-Reply-To: <92ce760461959b75810def4fed7139b1@ccrma.stanford.edu> References: <3571dfda0c344032cbca207bf9fce33a@ccrma.stanford.edu> <8b204712f6cd5be50f381dd7550657bb@ccrma.stanford.edu> <92ce760461959b75810def4fed7139b1@ccrma.stanford.edu> Message-ID: bil at ccrma.Stanford.EDU writes: > Thanks! I'll merge those changes into my version. > r7rs.scm can almost pass the chibi r7rs tests -- if I > had 2 minutes of uninterrupted time, I'd be done. I wanted to try the new version, but I get: ;can't get (*s7* 'filenames); no such field in *s7* ; (unless (member lib-filename (*s7*... Two extra notes on 'r7rs.scm': (1) I have to always delete the *libc* stuff to avoid: ;unbound variable *libc* in (*libc* 'getenvs) ; (*libc* 'getenvs) ; s7.scm, line 465, position: 15208 ; (*libc* 'getenvs) (2) I needed 'parameterize' today, and it does not seem to work. The following 101 example from R?RS ? (parameterize ((current-output-port (open-output-string))) (display "piece") (display " by piece ") (display "by piece.") (newline) (get-output-string (current-output-port))) ? fails with the following message: ;unbound variable value in (set! old-values (cons value old-values)) ; (set! old-values (cons value... The example works in Guile, FYI. As we use it, it also fails (the same way): (define (test description expected actual) (or (equal? expected actual) (parameterize ((current-output-port (current-error-port))) (display (list "expected" description "to return" expected "but got" actual)) (newline)))) Rudy -- "I love deadlines. I love the whooshing noise they make as they go by." -- Douglas Adams, The Salmon of Doubt Rudolf Adamkovi? [he/him] Studenohorsk? 25 84103 Bratislava Slovakia From iainduncanlists at gmail.com Fri Jan 21 09:50:38 2022 From: iainduncanlists at gmail.com (Iain Duncan) Date: Fri, 21 Jan 2022 09:50:38 -0800 Subject: [CM] Fastest way to copy scheme variables into a shared buffer? Message-ID: Hi folks, just hoping for suggestions here before I get too far. I would like to have an s7 interpreter running in a low priority UI thread read data from a higher priority thread instance. The low instance will maintain a periodically update a copy of the data for a display, with the buffering done at the C level in my external. I'm just wondering what the recommended way would be to store scheme variables in some C memory, where the type and size is known on both ends (or can be described in a notification from one to the other). Any suggestions most appreciated! thanks iain -------------- next part -------------- An HTML attachment was scrubbed... URL: From bil at ccrma.Stanford.EDU Fri Jan 21 10:15:47 2022 From: bil at ccrma.Stanford.EDU (bil at ccrma.Stanford.EDU) Date: Fri, 21 Jan 2022 10:15:47 -0800 Subject: [CM] R7RS support In-Reply-To: References: <3571dfda0c344032cbca207bf9fce33a@ccrma.stanford.edu> <8b204712f6cd5be50f381dd7550657bb@ccrma.stanford.edu> <92ce760461959b75810def4fed7139b1@ccrma.stanford.edu> Message-ID: <30cc93ca415a5a43a544e4b9197890f9@ccrma.stanford.edu> Thanks. (*s7* 'filenames) should be (*s7* 'file-names). If you don't want the libc stuff, just comment out the (require libc.scm) at the top of the file. I didn't realize that r7rs thinks current-output-port is a built-in parameter object. It isn't in s7 -- sorry. From wdouglass at carnegierobotics.com Fri Jan 21 12:48:20 2022 From: wdouglass at carnegierobotics.com (Woody Douglass) Date: Fri, 21 Jan 2022 20:48:20 +0000 Subject: [CM] Bug in read Message-ID: All, I may have found a bug in `read` consider the following ``` (define (strtest) (let* ((num "#xff") (in (open-input-string "#xff")) (val (read in))) (= (port-position in) (length num)))) ``` (strtest) defined above returns #f, i think it should return #t I think reader macros are increasing port-position to what the position would be post-macro, not pre-macro Has anyone seen this? Thanks, Woody Douglass From bil at ccrma.Stanford.EDU Fri Jan 21 13:49:38 2022 From: bil at ccrma.Stanford.EDU (bil at ccrma.Stanford.EDU) Date: Fri, 21 Jan 2022 13:49:38 -0800 Subject: [CM] Bug in read In-Reply-To: References: Message-ID: <2ed533bcc7b65b0b70b974c060ef9363@ccrma.stanford.edu> I need to look at this more closely, but at least in this case, you can fix it by changing lines 28669: #if 0 if (*str != 0) port_position(pt) += (k - 1); else port_position(pt) += k; #else port_position(pt) += (k - 1); #endif This passes s7test.scm, but I'm currently still running my main tests. From elronnd at elronnd.net Fri Jan 21 18:07:58 2022 From: elronnd at elronnd.net (Elijah Stone) Date: Fri, 21 Jan 2022 18:07:58 -0800 (PST) Subject: [CM] Fastest way to copy scheme variables into a shared buffer? In-Reply-To: References: Message-ID: <8ac79ff0-99e9-6377-4414-f8301da9cff@elronnd.net> > I'm just wondering what the recommended way would be to store scheme > variables in some C memory, where the type and size is known on both > ends (or can be described in a notification from one to the other). Any > suggestions most appreciated! If by 'scheme variable' you mean an actual scheme-level object, I do not think it is possible. If you want a scheme-level wrapper for a (non-scheme) object which is shared, I would use a c object. (I think there are some examples in snd.) I use s7_c_type_set_ref to set up accessors (viz univeral applicative syntax), which is a bit nicer than putting them in the global namespace. (And a question for Bil: any chance we can get more than a single word of data for c objects? I know there is more space in s7_cell... :) -E From bil at ccrma.Stanford.EDU Sat Jan 22 05:43:34 2022 From: bil at ccrma.Stanford.EDU (bil at ccrma.Stanford.EDU) Date: Sat, 22 Jan 2022 05:43:34 -0800 Subject: [CM] =?utf-8?q?Fastest_way_to_copy_scheme_variables_into_a_shared?= =?utf-8?q?_buffer=3F?= In-Reply-To: References: Message-ID: <77a79c85d910a511a80d0af165c1540a@ccrma.stanford.edu> > I'm just wondering what the recommended way would be to store > scheme variables in some C memory I'm not sure what you want to do -- could you send me a more detailed description? As Elijah mentions, s7 c-objects are aimed at this, I think, (and c-pointer is the inverse). From chris.actondev at gmail.com Sat Jan 22 05:50:41 2022 From: chris.actondev at gmail.com (Christos Vagias) Date: Sat, 22 Jan 2022 14:50:41 +0100 Subject: [CM] Fastest way to copy scheme variables into a shared buffer? In-Reply-To: <8ac79ff0-99e9-6377-4414-f8301da9cff@elronnd.net> References: <8ac79ff0-99e9-6377-4414-f8301da9cff@elronnd.net> Message-ID: Hi Iain, In case you indeed want to show the current value of some scheme object (and c-object/shared c-pointer doesn't cut it), here are some thoughts: One obvious way would be to use some mutex around any s7 operations in both threads, and share the s7_scheme* instance in the 2. The low level thread would acquire a lock, "print" somehow the value to display. But that would have some performance impact. Another option would be to share 2 message queues between the 2 (ideally lock-free ones) and send messages from the low thread -> you read from the high thread, and then there you send some message to the low level. The message sending to high->low could be s7_object_to_c_string that if I recall correctly gives you back a c-string that you have to free yourself : so you would free it from the low-level thread). On Sat, 22 Jan 2022 at 03:08, Elijah Stone wrote: > > > I'm just wondering what the recommended way would be to store scheme > > variables in some C memory, where the type and size is known on both > > ends (or can be described in a notification from one to the other). Any > > suggestions most appreciated! > > If by 'scheme variable' you mean an actual scheme-level object, I do not > think it is possible. If you want a scheme-level wrapper for a > (non-scheme) object which is shared, I would use a c object. (I think > there are some examples in snd.) I use s7_c_type_set_ref to set up > accessors (viz univeral applicative syntax), which is a bit nicer than > putting them in the global namespace. > > (And a question for Bil: any chance we can get more than a single word > of data for c objects? I know there is more space in s7_cell... :) > > -E > _______________________________________________ > Cmdist mailing list > Cmdist at ccrma.stanford.edu > https://cm-mail.stanford.edu/mailman/listinfo/cmdist From bil at ccrma.Stanford.EDU Sat Jan 22 06:01:06 2022 From: bil at ccrma.Stanford.EDU (bil at ccrma.Stanford.EDU) Date: Sat, 22 Jan 2022 06:01:06 -0800 Subject: [CM] =?utf-8?q?Fastest_way_to_copy_scheme_variables_into_a_shared?= =?utf-8?q?_buffer=3F?= In-Reply-To: <8ac79ff0-99e9-6377-4414-f8301da9cff@elronnd.net> References: <8ac79ff0-99e9-6377-4414-f8301da9cff@elronnd.net> Message-ID: > any chance we can get more than a single word of data for c objects? Yes, but I don't see the need. If the s7_cell space is made available to the user, I lose any flexibility in using that space later, and I'll need to add a half-dozen more procedures to the c-object interface: s7_c_object_value2, 2-value forms for the equality, mark, free, and the 3 make procedures (in s7.h all the cases where (void *) value occurs), etc. The value-passing equal, mark and gc cases are informally deprecated, so I guess they don't count, but it's kind of unavoidable in the make cases, unless I add s7_c_object_set_value1|2. Why can't you use a C struct or array, or an s7 vector or list as the value, and store any number of things through the value field? And if you need 2, surely you'll soon need 3. From elronnd at elronnd.net Sat Jan 22 06:22:51 2022 From: elronnd at elronnd.net (Elijah Stone) Date: Sat, 22 Jan 2022 06:22:51 -0800 (PST) Subject: [CM] Fastest way to copy scheme variables into a shared buffer? In-Reply-To: References: <8ac79ff0-99e9-6377-4414-f8301da9cff@elronnd.net> Message-ID: <48e51cd-ff61-b64c-9ba-4a939d7fc129@elronnd.net> > Yes, but I don't see the need. If the s7_cell space is made available > to the user, I lose any flexibility in using that space later I was imagining: #define S7_C_OBJECT_VALUE_SIZE, user either ensures their junk fits in that or indirects. Well, Hyrum's law applies, and I guess it is a little fragile, but certainly doable. > Why can't you use a C struct or array, or an s7 vector or list as the > value, and store any number of things through the value field? I am irrationally fearful of allocations, pay me no mind :) -E From iainduncanlists at gmail.com Sat Jan 22 07:47:17 2022 From: iainduncanlists at gmail.com (Iain Duncan) Date: Sat, 22 Jan 2022 07:47:17 -0800 Subject: [CM] Fastest way to copy scheme variables into a shared buffer? In-Reply-To: <48e51cd-ff61-b64c-9ba-4a939d7fc129@elronnd.net> References: <8ac79ff0-99e9-6377-4414-f8301da9cff@elronnd.net> <48e51cd-ff61-b64c-9ba-4a939d7fc129@elronnd.net> Message-ID: thanks for the answers, it sounds like I did a poor job of explaining what I'm trying to do, ha. Let's try again! There are two Max external instances, each with a complete s7 interpreter. One only runs in the high thread and one in the low. In the high thread there are sequencers, which have their sequence data stored in vectors of vectors of numbers, and meta data in hashtables (though this could be switched to vectors too). I want a UI object in the low thread that has a shadow copy of the sequence data and is used to make a programmable display. Nothing it does will ever lead to a change in the main data vectors. I would like to periodically (say every 100 to 500ms) update the shadow copy - it's ok if it takes a moment for the UI to update after a sequence changing operation. All of this can be done at the C level if need be. As in, I can have FFI functions that copy from the players vectors into some other buffer, and have the low side read from this other buffer. The shape of the data does not need to be changeable once it's going. So really I just want the low thread to be able to read the blocks of numbers that are in the vectors of vectors, they don't need to manipulate or be aware of the identity of the s7 objects, just their contents. Hopefully that is a better explanation, I probably don't know the right terminology to use here! thanks iain On Sat, Jan 22, 2022 at 6:23 AM Elijah Stone wrote: > > Yes, but I don't see the need. If the s7_cell space is made available > > to the user, I lose any flexibility in using that space later > > I was imagining: #define S7_C_OBJECT_VALUE_SIZE, user either ensures their > junk fits in that or indirects. Well, Hyrum's law applies, and I guess it > is a little fragile, but certainly doable. > > > > Why can't you use a C struct or array, or an s7 vector or list as the > > value, and store any number of things through the value field? > > I am irrationally fearful of allocations, pay me no mind :) > > -E > _______________________________________________ > Cmdist mailing list > Cmdist at ccrma.stanford.edu > https://cm-mail.stanford.edu/mailman/listinfo/cmdist > -------------- next part -------------- An HTML attachment was scrubbed... URL: From bil at ccrma.Stanford.EDU Sat Jan 22 09:30:49 2022 From: bil at ccrma.Stanford.EDU (bil at ccrma.Stanford.EDU) Date: Sat, 22 Jan 2022 09:30:49 -0800 Subject: [CM] =?utf-8?q?Fastest_way_to_copy_scheme_variables_into_a_shared?= =?utf-8?q?_buffer=3F?= In-Reply-To: References: <8ac79ff0-99e9-6377-4414-f8301da9cff@elronnd.net> <48e51cd-ff61-b64c-9ba-4a939d7fc129@elronnd.net> Message-ID: If the numbers are just integers or just floats, you could use float-vectors or int-vectors (or byte-vector) in s7, and use memcpy to copy the data from the C int64_t or double array (or actually share the data: see s7_float_vector_elements and s7_int_vector_elements). If the inner vectors are all the same size, you can grab all of them in one operation by using s7 multidimensional vectors. Otherwise, I think you'll need to use s7_integer, s7_real, and maybe the make-* cases -- kinda slow, perhaps -- I'm probably forgetting something obvious. From iainduncanlists at gmail.com Sun Jan 23 08:28:11 2022 From: iainduncanlists at gmail.com (Iain Duncan) Date: Sun, 23 Jan 2022 08:28:11 -0800 Subject: [CM] Fastest way to copy scheme variables into a shared buffer? In-Reply-To: References: <8ac79ff0-99e9-6377-4414-f8301da9cff@elronnd.net> <48e51cd-ff61-b64c-9ba-4a939d7fc129@elronnd.net> Message-ID: thanks Bill, I will try playing with those and see if it makes enough of a difference! iain On Sat, Jan 22, 2022 at 9:30 AM wrote: > If the numbers are just integers or just floats, you > could use float-vectors or int-vectors (or byte-vector) > in s7, and use memcpy to copy the data from the C int64_t > or double array (or actually share the data: see > s7_float_vector_elements and s7_int_vector_elements). > If the inner vectors are all the same size, you > can grab all of them in one operation by using > s7 multidimensional vectors. Otherwise, I think > you'll need to use s7_integer, s7_real, and maybe > the make-* cases -- kinda slow, perhaps -- > I'm probably forgetting something obvious. > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From salutis at me.com Tue Jan 25 10:37:54 2022 From: salutis at me.com (Rudolf =?utf-8?Q?Adamkovi=C4=8D?=) Date: Tue, 25 Jan 2022 19:37:54 +0100 Subject: [CM] R7RS support In-Reply-To: <30cc93ca415a5a43a544e4b9197890f9@ccrma.stanford.edu> References: <3571dfda0c344032cbca207bf9fce33a@ccrma.stanford.edu> <8b204712f6cd5be50f381dd7550657bb@ccrma.stanford.edu> <92ce760461959b75810def4fed7139b1@ccrma.stanford.edu> <30cc93ca415a5a43a544e4b9197890f9@ccrma.stanford.edu> Message-ID: bil at ccrma.Stanford.EDU writes: > Thanks. (*s7* 'filenames) should be (*s7* 'file-names). > If you don't want the libc stuff, just comment out the > (require libc.scm) at the top of the file. I didn't > realize that r7rs thinks current-output-port is a built-in > parameter object. It isn't in s7 -- sorry. Got it. Thanks so much! FYI, we still do not use the official s7 import code because it does not take into account [module] directories. While R7RS says nothing about it, e.g. Guile interprets library names such that library '(A B-C D-E-F)' resides in file 'A/B-C/D-E-F.scm'. I hacked the directory support in as follows: ;; Return the name of the file containing the LIB. For example, we ;; expect the library (A B-C D-E-F) in the file A/B-C/D-E-F.scm. (define (library-file lib) (let* ((chars-old (string->list (object->string lib))) (chars-new (let recur ((chars chars-old)) (if (null? chars) chars (let* ((old (car chars)) (new (cond ((or (char-alphabetic? old) (char-numeric? old) (char=? old #\-)) old) ((char-whitespace? old) #\/) (else #f)))) (if new (cons new (recur (cdr chars))) (recur (cdr chars)))))))) (string-append (list->string chars-new) ".scm"))) This brings s7 *much* closer to others, and we can now run unit tests on both s7 and Guile side-by-side! Perhaps s7 should do this out of the box? P.S. 1/2: 'r7rs.scm' needs a dummy definition for the '(scheme process-context)' library. Without it, anything with e.g. 'exit' breaks for no good reason. P.S. 2/2: Speaking of ports [in the original message], I found that the following code does not say "hi" in s7 for some reason: (display "hi" (current-error-port)) (flush-output-port (current-error-port)) (exit 1) Thank you again for all your help! Rudy -- "Thinking is a momentary dismissal of irrelevancies." -- Richard Buckminster Fuller, 1969 Rudolf Adamkovi? [he/him] Studenohorsk? 25 84103 Bratislava Slovakia From bil at ccrma.Stanford.EDU Tue Jan 25 11:31:06 2022 From: bil at ccrma.Stanford.EDU (bil at ccrma.Stanford.EDU) Date: Tue, 25 Jan 2022 11:31:06 -0800 Subject: [CM] R7RS support In-Reply-To: References: <3571dfda0c344032cbca207bf9fce33a@ccrma.stanford.edu> <8b204712f6cd5be50f381dd7550657bb@ccrma.stanford.edu> <92ce760461959b75810def4fed7139b1@ccrma.stanford.edu> <30cc93ca415a5a43a544e4b9197890f9@ccrma.stanford.edu> Message-ID: <437d463f9a7384541dbde3a20b4971c1@ccrma.stanford.edu> On the guile library filename handling, does any other scheme treat the names that way? I have added the rest of the built-in libaries to r7rs.scm: eval, process-context, case-lambda, lazy, load, and repl. s7 ignores these import statements. (display "hi" (current-error-port)) works for me. It is the same as (display "hi" *stderr*); since there is no buffering in this case, the flush-output-port has no effect, unless someone has redirected stderr. From deeteeoh1138 at gmail.com Tue Jan 25 13:41:58 2022 From: deeteeoh1138 at gmail.com (David O'Toole) Date: Tue, 25 Jan 2022 16:41:58 -0500 Subject: [CM] snd-22.0 won't run on cygwin Message-ID: I can't get snd-22 to run after successful compilation on cygwin. I've attached the configure command/output and resulting error. -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- Sandy at DESKTOP-05G3UUV /home/Sandy/src/snd-22.0 $ ./configure --without-gui --without-audio && make checking build system type... x86_64-pc-cygwin checking host system type... x86_64-pc-cygwin checking for gcc... gcc checking whether the C compiler works... yes checking for C compiler default output file name... a.exe checking for suffix of executables... .exe checking whether we are cross compiling... no checking for suffix of object files... o checking whether we are using the GNU C compiler... yes checking whether gcc accepts -g... yes checking for gcc option to accept ISO C89... none needed checking for a BSD-compatible install... /bin/install -c checking how to run the C preprocessor... gcc -E checking for grep that handles long lines and -e... /bin/grep checking for egrep... /bin/grep -E checking for ANSI C header files... yes checking for sys/types.h... yes checking for sys/stat.h... yes checking for stdlib.h... yes checking for string.h... yes checking for memory.h... yes checking for strings.h... yes checking for inttypes.h... yes checking for stdint.h... yes checking for unistd.h... yes checking whether byte ordering is bigendian... no checking size of void *... 8 checking for pkg-config... /bin/pkg-config checking for fftw3... no checking for gsl... no checking for oggdec... /bin/oggdec checking for oggenc... /bin/oggenc checking for mpg123... no checking for mpg321... no checking for speexdec... no checking for speexenc... no checking for flac... /bin/flac checking for timidity... no checking for wavpack... no checking for wvunpack... no checking for audio system... None configure: creating ./config.status config.status: creating makefile config.status: creating mus-config.h Options selected ------------------------- Snd version ...........: 22.0 CFLAGS ................: -O2 -I. -g -O2 LDFLAGS ...............: LIBS...................: prefix.................: /usr/local extension language.....: s7 audio system...........: None graphics toolkit.......: None optional libraries.....: random features........: environs...............: x86_64-pc-cygwin gcc gcc -c -DSCRIPTS_DIR=\"/usr/local/share/snd\" -O2 -I. -g -O2 s7.c gcc -c -DSCRIPTS_DIR=\"/usr/local/share/snd\" -O2 -I. -g -O2 headers.c <............. snip output of build ......................> Sandy at DESKTOP-05G3UUV /home/Sandy/src/snd-22.0 $ ./snd loading libc_s7.so ;unbound variable fileno in (fileno stdin) ; (fileno stdin) ; repl.scm, line 207, position: 6849 ; (fileno stdin) ; ((terminal-fd (fileno stdin)) (tab-as-spa... ;unbound variable fileno in (fileno stdin) ; (fileno stdin) ; repl.scm, line 1234, position: 44399 ; (fileno stdin) ; ((terminal-fd (fileno stdin)) (tab-as-spa... ; (not (defined? 'c-define-output-file-coun... ; (*repl* 'run) From bil at ccrma.Stanford.EDU Tue Jan 25 13:56:04 2022 From: bil at ccrma.Stanford.EDU (bil at ccrma.Stanford.EDU) Date: Tue, 25 Jan 2022 13:56:04 -0800 Subject: [CM] snd-22.0 won't run on cygwin In-Reply-To: References: Message-ID: You can run snd -noinit to get around the use of repl.scm, but the error is puzzling -- did you make libc_s7.so on cygwin? Is fileno available in cygwin? I see others asking about it online: maybe use -std=gnu99? From deeteeoh1138 at gmail.com Tue Jan 25 14:14:55 2022 From: deeteeoh1138 at gmail.com (David O'Toole) Date: Tue, 25 Jan 2022 17:14:55 -0500 Subject: [CM] snd-22.0 won't run on cygwin In-Reply-To: References: Message-ID: Ok, snd -noinit seems to work fine. Thank you. Using -std=gnu99 did not affect the issue when run without -noinit. Yes, i built the whole thing with cygwin's GCC using the typical configure && make. On Tue, Jan 25, 2022 at 4:56 PM wrote: > You can run snd -noinit to get around the use of repl.scm, > but the error is puzzling -- did you make libc_s7.so on > cygwin? Is fileno available in cygwin? I see others > asking about it online: maybe use -std=gnu99? > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From mike at eggheadgames.com Tue Jan 25 15:14:05 2022 From: mike at eggheadgames.com (mike at eggheadgames.com) Date: Wed, 26 Jan 2022 07:14:05 +0800 Subject: [CM] R7RS support In-Reply-To: <437d463f9a7384541dbde3a20b4971c1@ccrma.stanford.edu> References: <3571dfda0c344032cbca207bf9fce33a@ccrma.stanford.edu> <8b204712f6cd5be50f381dd7550657bb@ccrma.stanford.edu> <92ce760461959b75810def4fed7139b1@ccrma.stanford.edu> <30cc93ca415a5a43a544e4b9197890f9@ccrma.stanford.edu> <437d463f9a7384541dbde3a20b4971c1@ccrma.stanford.edu> Message-ID: > does any other scheme treat the names that way? Chibi?s module handling is similar to Guile: > modules are searched for in a module load path. The definition of the > module (foo bar baz) is searched for in the file "foo/bar/baz.sld". http://synthcode.com/scheme/chibi#h3_ModuleSystem Chicken does not construct a path (but I didn?t delve into their module system, and the rsr7 mapping to it, to understand what it does instead): > Some implementations treat library name components as filesystem > paths and attempt to load the library (foo bar baz) from the file > "foo/bar/baz.scm", for example. This [r7rs] egg does not. https://wiki.call-cc.org/eggref/5/r7rs#library-loading Chez is similar to Guile and Chibi: > A library to be loaded implicitly via import must reside in a file > whose name reflects the name of the library. For example, if the > library's name is (tools sorting), the base name of the file must be > sorting with a valid extension, and the file must be in a directory > named tools which itself resides in one of the directories searched by > import. https://cisco.github.io/ChezScheme/csug9.5/use.html#./use:h4 Happy to look at others if it would help guide this. Thanks as ever for your continued fast responses! Cheers, Michael On 26 Jan 2022, at 3:31, bil at ccrma.Stanford.EDU wrote: > On the guile library filename handling, does any other scheme > treat the names that way? I have added the rest of the built-in > libaries to r7rs.scm: eval, process-context, case-lambda, lazy, > load, and repl. s7 ignores these import statements. > > > (display "hi" (current-error-port)) > > works for me. It is the same as (display "hi" *stderr*); since > there is no buffering in this case, the flush-output-port has > no effect, unless someone has redirected stderr. > > _______________________________________________ > Cmdist mailing list > Cmdist at ccrma.stanford.edu > https://cm-mail.stanford.edu/mailman/listinfo/cmdist From bil at ccrma.Stanford.EDU Tue Jan 25 15:35:27 2022 From: bil at ccrma.Stanford.EDU (bil at ccrma.Stanford.EDU) Date: Tue, 25 Jan 2022 15:35:27 -0800 Subject: [CM] R7RS support In-Reply-To: References: <3571dfda0c344032cbca207bf9fce33a@ccrma.stanford.edu> <8b204712f6cd5be50f381dd7550657bb@ccrma.stanford.edu> <92ce760461959b75810def4fed7139b1@ccrma.stanford.edu> <30cc93ca415a5a43a544e4b9197890f9@ccrma.stanford.edu> <437d463f9a7384541dbde3a20b4971c1@ccrma.stanford.edu> Message-ID: Thanks for all that info! I'll fix the r7rs.scm file name stuff, probably tomorrow. From salutis at me.com Wed Jan 26 11:58:21 2022 From: salutis at me.com (Rudolf =?utf-8?Q?Adamkovi=C4=8D?=) Date: Wed, 26 Jan 2022 20:58:21 +0100 Subject: [CM] R7RS support In-Reply-To: <437d463f9a7384541dbde3a20b4971c1@ccrma.stanford.edu> References: <3571dfda0c344032cbca207bf9fce33a@ccrma.stanford.edu> <8b204712f6cd5be50f381dd7550657bb@ccrma.stanford.edu> <92ce760461959b75810def4fed7139b1@ccrma.stanford.edu> <30cc93ca415a5a43a544e4b9197890f9@ccrma.stanford.edu> <437d463f9a7384541dbde3a20b4971c1@ccrma.stanford.edu> Message-ID: bil at ccrma.Stanford.EDU writes: > (display "hi" (current-error-port)) > > works for me. [?] I re-tested it, and it works. I apologize for the noise. Rudy -- "Be especially critical of any statement following the word 'obviously.'" -- Anna Pell Wheeler, 1883-1966 Rudolf Adamkovi? [he/him] Studenohorsk? 25 84103 Bratislava Slovakia