[CM] Fwd: Re: S7 integrated in TIC-80, and bug reports

2023-02-03 Thread bil
Original Message Subject: Re: [CM] S7 integrated in TIC-80, and bug reports Date: 2023-02-03 10:52 From: b...@ccrma.stanford.edu To: David St-Hilaire Would there be a way to give a better error message? The error message is the third argument to error_nr. One simple

Re: [CM] S7 integrated in TIC-80, and bug reports

2023-02-03 Thread David St-Hilaire
I think it would be a good idea in another context. I think that forbidding IO completely is better aligned with the intentional use of the TIC-80 which is meant to be a fantasy console. The scheme code runs directly on the fictionnal hardware (a bit like your assembly would run from a NES

[CM] Fwd: Re: S7 integrated in TIC-80, and bug reports

2023-02-03 Thread bil
(sorry about the chaotic state of cmdist -- all my fault). Original Message Subject: Re: [CM] S7 integrated in TIC-80, and bug reports Date: 2023-02-03 10:10 From: David St-Hilaire To: b...@ccrma.stanford.edu Hi bil! I implemented your changes and it's working very well. I

Re: [CM] S7 integrated in TIC-80, and bug reports

2023-02-03 Thread Massimiliano Gubinelli
What about implementing a fake filesystem instead of allowing s7 to access the real one? In this way it will be effectively sandboxed. This is the approach used by emscripten to have ports work in webasm. Max > On 3 Feb 2023, at 13:43, David St-Hilaire wrote: > > I think it's mostly writing

Re: [CM] S7 integrated in TIC-80, and bug reports

2023-02-03 Thread David St-Hilaire
I think it's mostly writing to files that is dangerous but disabling reading would be important too, if not only for forbidding "breaking" the fantasy console barriers. I looked at doing some changes but I was really not sure how to do it properly. If you would be generous enough to do the needed

Re: [CM] S7 integrated in TIC-80, and bug reports

2023-02-03 Thread David St-Hilaire
Okay, I have quite the curveball now. My s7 integration was flagged as a serious security risk due to file I/O access. The TIC-80 allows people to download "carts" and so a downloaded game using scheme could start messing with the filesystem. Would there, by any chance, a simple way to disable all

Re: [CM] S7 integrated in TIC-80, and bug reports

2023-02-03 Thread David St-Hilaire
About noreturn, it seems it didn't work anymore (probably because it is now using C23) so I locally defined it to nothing, but I don't know how to make it better. I'm a bit stuck with the rasberry pi baremetal compilation issues like this: /__w/TIC-80/TIC-80/vendor/s7/s7.c:375:25: error: unknown

Re: [CM] S7 integrated in TIC-80, and bug reports

2023-02-03 Thread David St-Hilaire
/facepalm, I accidentally have shadowed map with an api ffi... Yes that would explain my issue! Thanks, I should have seen it coming! On Thu, Feb 2, 2023 at 3:01 PM wrote: > On the first issue, it looks to me like you have > your own map function -- scheme_map is not an s7 > function. It is

Re: [CM] S7 integrated in TIC-80, and bug reports

2023-02-03 Thread David St-Hilaire
for the first issue, I apologize, I wrote the test example from my cell phone, and forgot the backquote, it should have been: (define-macro (test x . args) `(list ,@(map car args))) (test 10 ('x 1) ('y 2)) which crashes S7, when I load from c string this snippet. The bt from gdb looks like this:

Re: [CM] S7 integrated in TIC-80, and bug reports

2023-02-03 Thread bil
Here's a first stab at it -- put this code at line 1430 or thereabouts in s7.c (after the error_nr forward declaration), then build s7 with -DDISABLE_FILE_OUTPUT=1: #ifndef DISABLE_FILE_OUTPUT #define DISABLE_FILE_OUTPUT 0 #endif #if DISABLE_FILE_OUTPUT static FILE *old_fopen(const char

Re: [CM] S7 integrated in TIC-80, and bug reports

2023-02-03 Thread bil
Do you need to disallow reading a file? If it's just creating or altering a file that needs to be blocked, you could redirect fopen and fwrite (in s7.c) to functions that raise an error. I don't think s7 uses creat, open (except with O_RDONLY), or write. Also build it with WITH_C_LOADER=0 (to