Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Dec 08 22:16
    CI run 1556057518 passed
  • Dec 08 21:32
    CI run 1555914043 passed
  • Dec 08 21:29

    gambiteer on master

    Expand ##fxceiling-ratio inline… (compare)

  • Dec 08 21:16
    CI run 1555865110 passed
  • Dec 08 20:47

    gambiteer on master

    Use shifts and masks in C backe… (compare)

  • Dec 08 20:32

    gambiteer on master

    Isolate quotient and modulo of … Merge branch 'master' of https:… (compare)

  • Dec 08 13:03
    CI run 1553996901 passed
  • Dec 08 12:25

    feeley on master

    Avoid dynamic optimization when… (compare)

  • Dec 07 23:10
    CI run 1551531095 passed
  • Dec 07 22:29

    feeley on master

    Improve speed of fxquotient, fx… Merge branch 'master' of github… (compare)

  • Dec 06 22:02
    CI run 1546657243 passed
  • Dec 06 21:18

    gambiteer on master

    Fix ##exact-int->flonum-exact? (compare)

  • Dec 06 20:46
    Linux build of CI run 1546439939 failed
  • Dec 06 20:18

    feeley on master

    Fix issue with (define-macro fo… (compare)

  • Dec 06 19:24
    CI run 1546085720 passed
  • Dec 06 18:40

    feeley on master

    Simplify list-ref, list-set!, a… (compare)

  • Dec 06 18:23
    Windows-msvc build of CI run failed
  • Dec 06 18:22
    Windows-mingw build of CI run 1545907278 failed
  • Dec 06 18:20
    MacOS build of CI run 1545907278 failed
  • Dec 06 18:16
    Linux build of CI run 1545907278 failed
amirouche
@amirouche
Where did you look?
Hey @drewc do you know the practical difference between preact and reactjs?
Drew Crampsie
@drewc
Oh! That seems cool ... is @scm2host@ now either g_scm2host or RTS.scm2host depending on the gsc args?
Marc-André Bélanger
@belmarca
@amirouche bundle size iirc. You should check out Svelte if you're interested in compilers...
Drew Crampsie
@drewc
@amirouche I do not know the practicality for either of them, let alone the practical difference :)
2 replies
Marc Feeley
@feeley
@drewc yes @foo@ abstracts from the actual namespace prefix and it also keeps track of dependencies (so the rtlib foo feature will be compiled into the RTS by the linker)
amirouche
@amirouche
I prefer the reactjs / preact virtualdom approach compared to backbone, vuejs or even svelte. It is minimal, except the new hook thing that are somewhat overkill. Maybe I do not understand how / why it is all that useful, I mean I have been doing functional without-classes reactjs before hooks, so...
Drew Crampsie
@drewc
I generally use functional components for the most part.
But can do them both, of course ... let me see if I have github code to show
https://github.com/drewc/gloui/blob/main/src/assets/widgets.ss#L166 <--- that is a Vue component written in Gerbil which is transpiled to Gambit which is transpiled to JS using gxjs-loader
Drew Crampsie
@drewc
if you look here you can see the code that it expands to, though it's so minimized that I cannot even tell you where that code goes: https://github.com/drewc/gloui/tree/gh-pages
@feeley That's brilliant, I like that!
Oh, and for an -exe or -link it can see what needs to be in the RTS file by foreign code, not domestic ... that's brilliant as well.
drewc @drewc does a wee happy dance.
amirouche
@amirouche
I will do myself a favor, and read gambit.pdf!
Guillaume Cartier
@gcartier

I’m trying to figure out how to use ##wr. I have the following wr.scm file

(include "~~lib/_gambit#.scm")

(##wr-set!
  (lambda (we obj)
    (if (##symbol? obj)
        (##write-string "123" (macro-writeenv-port we))
      (##default-wr we obj))))

(write 'hello)

and the result I get when I run it is that 123 gets display twice and I cannot figure out why

$ gsi wr
123123

any idea what I’m doing wrong?

Guillaume Cartier
@gcartier
Just figured it, that I need to call (##default-wr we obj) if (macro-writeenv-style we) is ‘mark
amirouche
@amirouche

The following code:

\alert(`42)

Does not work with js backend, it does nothing.

Marc Feeley
@feeley
@amirouche On https://gambitscheme.org/try/ it works fine. What do you mean with “js backend”? The SIX syntax is not enabled by default and you need to import the library (_six js) to activate the handling of \….
amirouche
@amirouche
There is another error:
✦ ❯ cat webui.scm
(import (_six js))

\alert(42)

✦ ❯ ./scm2js.sh webui.scm
+ pwd
+ docker run -v /home/amirouche/src/scheme/arew:/mnt --rm -it schemers/gambit:head gsc -:r7rs -target js -exe /mnt/src/ /mnt/webui.scm
*** ERROR IN "mnt/webui.scm"@3.1 -- Ill-formed expression
amirouche
@amirouche
I am using the latest gambit master (I triggered a build dockerhub side)
Marc Feeley
@feeley
@amirouche I’m looking into it
Marc Feeley
@feeley
there’s something strange happening with the handling of the \… notation by the parser… a literal (six.infix (six.call (six.identifier alert) (six.literal 42))) does not have the problem
Marc Feeley
@feeley
@amirouche Indeed there was a problem with the parser that added an extra level of wrapping of six.infix. This has been fixed and the commit pushed. The program can be compiled and run like this:
% cp `gsc -e '(display(path-expand"~~lib"))'`_six/js*.scm .
% cat webui.scm
(import (_six js))
(define n 2)
\alert(Math.sqrt(`n))
% gsc -target js -exe -o webui.html js.scm webui.scm
js.scm:
/Users/feeley/test/js.js:
webui.scm:
/Users/feeley/test/webui.js:
/Users/feeley/test/webui_.js:
% open webui.html
Drew Crampsie
@drewc
@feeley The latest minimization is brilliant. From 35mb down to 4.5mb with just a couple more added @'s is so nice.
Marc Feeley
@feeley
when you minimize and gzip it gets down to 640KB… I still can’t understand this
Drew Crampsie
@drewc
That makes .... no sense to me either .... my head is going through compression ... a pointer or address is at least char sized ... we have almost no chars ...
Marc Feeley
@feeley
who would have thought that JS code was a path to program compression
Bradley Lucier
@gambiteer
@feeley what can't you understand?
Drew Crampsie
@drewc
It does almost entirely change both my approach and my tactics... 640KB is worth very byte for an entire Gambit ecosystem. Tabarnouche!
Marc Feeley
@feeley
gzip compressing the JS code of the interpreter (including the Gambit runtime library) gives 640KB… gzip compressing the x86 code of the interpreter gives 1.5MB (down from 6.1MB)… I would have thought that machine code is rather compressed to start with
Bradley Lucier
@gambiteer
Aha. The C back end includes a number of tables of floating-point numbers, which are likely somewhat difficult to compress, plus a bit more code for bignum algorithms.
Marc Feeley
@feeley
sure… but 640KB! that means the “information content” of Gambit’s interpreter is <= 640KB… doesn’t sound like much
Drew Crampsie
@drewc
I'm still in shock over that small number.
Bradley Lucier
@gambiteer
Well, that's a good thing, right? Does that include the module code?
Drew Crampsie
@drewc
It also means an increase in performance due to _i being a tiny lookup...
Marc Feeley
@feeley
yes a super good thing… and yes the runtime system includes dynamic module loading (but all the usual modules are preloaded)
Drew Crampsie
@drewc
and changes my entire strategy when it comes to minimal js downloads ... it's so tiny, for almost everything, that it's well worth the little tiny bits of bytes.
Marc Feeley
@feeley
I saved quite a bit by compressing the Unicode tables… they went from 600KB of JS to 5.2KB… more than 100x more compact (and I’m not including the gzip compression factor)
François-René Rideau
@fare
So that's what they meant when they said that nobody needs more than 640KB...
Drew Crampsie
@drewc
I'm still somewhat in shock lol... it's so much in such a small package.
5 and a quarter, it's a small package as it's still floppy!!
Drew Crampsie
@drewc
@feeley I also have to give you some major big-ups on the @async_call@ and the ##callback-loop. That is exactly what I was needing to attempt this week as, I'm sure you well know, that bloody stack and FFI and async do/did not get along.
Marc Feeley
@feeley
yes I’m quite pleased with the solution which interfaces JS async functions and Scheme threads
Drew Crampsie
@drewc
Having most of the interaction be in a promise saves so much headscratching and will totally get rid of my "fake" js#function where I copy the stack and sp. I never thought I'd enjoy the JS universe so much, but 4 odd months of Universal Runtime and interactions with it, I'm now quite a fan.
Uniting threads and async was what I needed to have IndexedDB interactions without having to pass callbacks.
That was my plan this week, with mutexes and a loop, so 10% of what you did in 1000% of a timesink due to my lack of clue... so I'm very happy :) What a fun Monday.
Marc Feeley
@feeley
too bad you don’t also like SIX… but I’ll give you some time
Drew Crampsie
@drewc
I've thought about that as well and already figured a number of reasons to get along with it, so likely next week you'll hear my praise \infix('of)
Marc Feeley
@feeley
I don’t want praise… I want the happy dance