Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Jan 13 11:54
    leahneukirchen commented #731
  • Jan 13 11:49
    feeley commented #731
  • Jan 13 11:07
    leahneukirchen commented #731
  • Jan 12 21:13
    feeley closed #729
  • Jan 12 20:43
    belmarca commented #729
  • Jan 12 20:41
    belmarca commented #731
  • Jan 12 13:28
    leahneukirchen edited #731
  • Jan 12 13:28
    leahneukirchen opened #731
  • Jan 11 13:51
    belmarca converted_to_draft #730
  • Jan 11 02:49
    belmarca commented #730
  • Jan 11 02:48
    belmarca opened #730
  • Jan 10 00:35
    feeley commented on fc132b2
  • Jan 09 23:27
    gambiteer commented on fc132b2
  • Jan 09 22:36
    feeley commented on fc132b2
  • Jan 09 04:45
    gambiteer commented on fc132b2
  • Jan 09 04:09
    CI run 1672926224 passed
  • Jan 09 03:41
    Windows-mingw build of CI run 1672918189 failed
  • Jan 09 03:37
    Windows-msvc build of CI run failed
  • Jan 09 03:30
    MacOS build of CI run 1672918189 failed
  • Jan 09 03:27
    Linux build of CI run 1672918189 failed
Marc Feeley
@feeley
Yeah I’m looking at that but the code raises an error
$ gsi -:= srfi/42/test
"lib/srfi/42/test/test.scm"@22.6: FAILED (test-equal (vector 0) (vector-of-length-ec 1 (:range i 1) i)) GOT *** ERROR IN ##dynamic-env-bind -- vector is too long for the comprehension
Bradley Lucier
@gambiteer
When I do a make test-modules I get an error, too:
make[3]: Entering directory '/home/lucier/programs/gambit/gambit/lib/srfi/42'
*** testing srfi/42
*** ERROR IN ##macro-expand -- syntax error
((#(#(source1) (#(#(source1) :range "/home/lucier/programs/gambit/gambit/lib/srfi/42/../../../lib/srfi/42/test/test.scm" 1507425) #(#(source1) i "/home/lucier/programs/gambit/gambit/lib/srfi/42/../../../lib/srfi/42/test/test.scm" 1966177) #(#(source1) 10 "/home/lucier/programs/gambit/gambit/lib/srfi/42/../../../lib/srfi/42/test/test.scm" 2097249)) "/home/lucie...
Marc Feeley
@feeley
I will look into this later… gtg
Jens Axel Søgaard
@soegaard
FWIW on https://gambitscheme.org/dev/ the link to the manual is broken.
Marc-André Bélanger
@belmarca
@kbradyno:matrix.org where can I contact you?
kbradyno
@kbradyno:matrix.org
[m]
You can pm me with matrix or email me: owens.bradyn1999@gmail.com
Marc-André Bélanger
@belmarca
I will email you
somehow the gitter web UI won't let me send you a private message
Marc-André Bélanger
@belmarca
@kbradyno:matrix.org I tried something, did you receive my gitter message?
kbradyno
@kbradyno:matrix.org
[m]
Got it! Thanks! Either one is fine though!
Marc-André Bélanger
@belmarca
@soegaard I will fix this.
vyzo
@vyzo
Julián Herrera
@vidjuheffex

I built the latest gambit and wanted to try out some of the js stuff having understand from the release notes in this chat that Gambit now includes the js stuff "out-of-the-box"

I'm curious what is needed to run the following code in a main.scm:

(import (_six js))

(define (console-log msg) \console.log(`msg))

(console-log "hello world")

Using gsc -target js -exe -o index.html main.scm

and then opening and expecting a console log.

Currently, if I open index.html, I get a ton of alert's asking for permissions to read files (that don't exist at the locations alerted), and then ultimately, I get an ERROR IN ##collect-modules... (can't copy and paste out of browsers alerts, but get-module fails looking for six)

do I need to go copy the src for _six into my projects folder or symlink that directory to the expected location?

Julián Herrera
@vidjuheffex
If I copy it in, (and serve the directory), I still get the same error, it tries to look for "GET /lib/_six/@" which is not a file but some of these others are
::1 - - [12/Jan/2022 14:38:15] "GET /hello.html HTTP/1.1" 304 -
::1 - - [12/Jan/2022 14:38:16] code 404, message File not found
::1 - - [12/Jan/2022 14:38:16] "HEAD /lib/_six/@ HTTP/1.1" 404 -
::1 - - [12/Jan/2022 14:38:17] code 404, message File not found
::1 - - [12/Jan/2022 14:38:17] "GET /lib/_six/js/js.sld HTTP/1.1" 404 -
::1 - - [12/Jan/2022 14:38:18] code 404, message File not found
::1 - - [12/Jan/2022 14:38:18] "GET /lib/_six/js/js.scm HTTP/1.1" 404 -
::1 - - [12/Jan/2022 14:38:19] code 404, message File not found
::1 - - [12/Jan/2022 14:38:19] "GET /lib/_six/js/js.six HTTP/1.1" 404 -
::1 - - [12/Jan/2022 14:38:20] "HEAD /lib/_six/js@gambit409004@js/js.o1 HTTP/1.1" 200 -
::1 - - [12/Jan/2022 14:38:22] code 404, message File not found
::1 - - [12/Jan/2022 14:38:22] "GET /lib/_six/js@gambit409004@js/js.o1.js HTTP/1.1" 404 -
Marc-André Bélanger
@belmarca
Look in the contrib/try directory, do a make try
It shows a fully functional web application, which is hosted at https://try.gambitscheme.org
Julián Herrera
@vidjuheffex
I see, I'd seen that before, but I thought since the new release had ".html" as a an output target, that seem to include the runtime, I thought maybe there was a more straightforward way and that try was a robust example for projects that need a repl, etc...
Thank you! Making sure I wasn't missing an "easy mode" that DWIM
Marc Feeley
@feeley
@vidjuheffex It is not fully automatic, but it can be done by breaking down the process in steps (each one compiling one of the needed libraries) and linking those libraries when doing the gsc -exe …:
$ cat hw.scm 
(import (_six js))
(define (console-log msg) \console.log(`msg))
(console-log "hello world")
$ gsc -target js -c -o js.js ~~lib/_six/js.sld
$ gsc -target js -c -o six-expand.js ~~lib/_six/six-expand.scm
$ gsc -target js -exe -o index.html -nopreload js.js six-expand.js hw.scm
$ open index.html
The library _six/six-expand is used at macro expansion time by _six/js which is the library accessed by the (import (_six js)).
When a library is statically linked with the application it won’t be searched for dynamically.
Marc Feeley
@feeley
If you are ok with dynamically linking these modules you have to setup the server’s directory to have those libraries (in compiled form or source form) in a lib subdirectory in the same directory as index.html. The runtime system is really using the same algorithm as when using Gambit from the shell to find files, except the files are on the web server and ~~lib is mapped to the lib subdirectory on the server.
Julián Herrera
@vidjuheffex
Thanks, I'm a bit confused though as I did copy the source files to that structure and served them, however when I did that it tried looking for _six/@ which did not exist
Marc Feeley
@feeley
@vidjuheffex Yes that is part of the search algorithm (for handling versionned libraries). You can ignore it and put your source code in lib/_six/js/js.sld, etc and if you want a compiled version then add that to lib/_six/js@gambit409004@js/js.o1 and lib/_six/js@gambit409004@js/js.o1.js(which is the same file as the .o1 so a symbolic link will work).
Julián Herrera
@vidjuheffex

I don't follow 😅

If you are ok with dynamically linking these modules you have to setup the server’s directory to have those libraries (in compiled form or source form) in a lib subdirectory in the same directory as index.html. T

Let's say I am okay with dynamic linking.

If I serve, index.html, and lib/_six/ <-copying contents of the lib into this dir,

should running gsc -target js -exe -o index.html main.scm be enough? (because I get the _six/@ missing error)

Julián Herrera
@vidjuheffex
(following the steps above I did get it to work) so now I have js.js and six-expand.js, I'm just asking because I don't understand... This approach is statically linked correct? What am I missing about the dynamic approach?
Marc Feeley
@feeley
@vidjuheffex The 404 on _six/@ is just because the search algorithm is poking around trying to find the _six/js library… this error is expected (when you don’t have a versionned installation of the _six package)
Static linking works fine (and is in some sense preferable for the user experience… faster download of the app) but the build process is a bit clunky currently
Julián Herrera
@vidjuheffex
Thanks
Guillaume Cartier
@gcartier
I stumbled on what seems like a pair of small bugs: ##path->container-hook-set! receives the hook as x but sets ##path->container-hook to #f (same bug with ##container->path-hook-set!). Weirdly, looking into the history it was always like that, which is a mystery to me as I did use those 2 procedures when you added them Marc
Jens Axel Søgaard
@soegaard
Bradley Lucier
@gambiteer
@feeley Did you translate SRFI 42 tests into Gambit's default test framework? I think Jens would like to make iterators and comprehensions to add to the draft array SRFI https://github.com/scheme-requests-for-implementation/srfi-231. The reference implementation is written for Gambit, so the iterators would need to work there, at least.
Jens Axel Søgaard
@soegaard
@gambiteer I forgot I had a question on the srfi. Suppose you have a 3-dimensional array, and you array-extract with an interval of the form (make-interval #(0 5 0) #(10 6 10)). Since there is only one element in the second dimension, it would natural to drop that dimension and work with an array with interval (make-interval #(0 10) #(0 10)). In general, is there a way to easily go down a dimension when a certain axis only have one element?
Bradley Lucier
@gambiteer

"Easily"? that's in the eye of the beholder, I guess. Here's a way to remove a lot of length-one axes at once (untested):

(define (remove-dimensions a k1 . ks)
  (let* ((ks
          (cons k1 ks))
         (dim
          (array-dimension a))
         (all-axes
          (iota dim))
         (permutation
          (list->vector
           (append ks (remove (lambda (k) (memv k ks)) all-axes))))
         (reordered-a
          (array-curry
           (array-permute a permutation)
           (- dim (length ks))))
         (reordered-domain
          (array-domain reordered-a)))
    (apply array-ref
           reordered-a
           (map (lambda (k)
                  (interval-lower-bound k reordered-domain))
                ks))))

This works if the axes (cons k ks) all have length one in the domain of the array.

Do you want to ask this again on the mail list, so everyone will see it?
Jens Axel Søgaard
@soegaard
Thanks. Yes - that's the best place.
Jens Axel Søgaard
@soegaard
Mail sent to the list.
harshrc
@harshrc
Any ideas what this error message means on MinGW/Msys, after a ./configure
$ make
make stamp
make[1]: Entering directory `/d/chickadee/sources/gambit'
make[2]: Entering directory `/d/chickadee/sources/gambit/include'
___STAMP_VERSION changed to v4.9.4-4-g7b2062f
fatal: unknown date format format-local:%Y%m%d
expr: non-numeric argument
makefile:302: recipe for target `stamp' failed
make[2]: *** [stamp] Error 3
make[2]: Leaving directory `/d/chickadee/sources/gambit/include'
makefile:227: recipe for target `stamp' failed
make[1]: *** [stamp] Error 2
make[1]: Leaving directory `/d/chickadee/sources/gambit'
makefile:112: recipe for target `core-pre' failed
make: *** [core-pre] Error 2
Jens Axel Søgaard
@soegaard
It has something to do with git.
Same type of error: https://stackoverflow.com/questions/49521074/git-log-unknown-date-format
image.png
Drew Crampsie
@drewc
You likely need a new version of git
harshrc
@harshrc
Thank you. I also found the 'build from source' instructions at https://gambitproject.readthedocs.io/en/latest/build.html# Hopefully I wont miss anything this time.
Bradley Lucier
@gambiteer
@harshrc Different project named Gambit, I'm afraid.
harshrc
@harshrc
wow that is quite the name clash. thanks for the warning.
harshrc
@harshrc
Used instructions from https://stackoverflow.com/questions/30069830/how-to-install-mingw-w64-and-msys2, installed misc tools such as git, make etc, retried Gambit install.txt instructions on a fresh clone. Build and install was a breeze. Thanks for all the help.
Can I ask JazzScheme questions here or does it have a separate room
Drew Crampsie
@drewc
harshrc
@harshrc
Found the room, the last conversation was Aug 2021 though, hopefully someone drops by, or I can ask the question on their mailing list.
Jaime Fournier
@ober
just ask there, and Guillaume will answer