These are chat archives for fourthbit/spheres

29th
May 2015
Julián Herrera
@vidjuheffex
May 29 2015 02:35
Hey, quick questions: Blackhole seems dead yet, schemespheres seems to not be a replacement for blackhole? (Per it's description) I guess what I am asking is, is SchemeSpheres for libraries of is it useful for making modules of your code? (I'm primarily looking for the latter, as Gambit has a bigger community than bigloo, but I find code-organization/compiling on Bigloo (and Chicken and Racket and...) quite nice)
Álvaro Castro-Castilla
@alvatar
May 29 2015 09:18
Hi!
Álvaro Castro-Castilla
@alvatar
May 29 2015 09:23

Indeed, Blackhole is dead. I actually tried to hack it to make serve my purposes better, but it is really a mess inside (Per acknowledges this, and that's why he dropped it).

It is a replacement, but with a different philosophy. First of all, it uses the R7RS libraries (modules) system. However, this support is not 100% (it lacks rename, only and a few of these keywords). It is a very thin layer at the moment. The reason I don't pour hours on that front is because Marc is going to provide this functionality within Gambit itself in the near future (along syntax-rules, of course). So, SchemeSpheres focuses on:

  • comprehensive collection libraries ported to Gambit (+180)
  • testing/documentation
  • tools for easily working on multiple platforms with the same code base
Indeed, you can use it for your own libraries, which will follow the R7RS library definition syntax anyway, and be prepared for full Gambit native support. Also the project structure is quite "standard", at least per Gambit's intentions.
With Spheres, the current module support will allow you to make your libraries in r7rs format, which is impleneted in Gambit's namespaces, meaning that you get modules for functions, but syntax sits on a global namespace.
Álvaro Castro-Castilla
@alvatar
May 29 2015 09:31
That is the main disadvantage compared with Blackhole. The main advantage are:
  • is orders of magnitude simpler. Is a thin and hackable layer.
  • it follows r7rs standard, so it will be drop-in-replaced by proper Gambit native syntax/libraries support
  • is way more flexible. Blackhole forces compilation in a way that makes it impossible to build for example iOS/Android apps, or cross-compile to other OS.
This is an example of a library made in R7RS format, for Spheres:
https://github.com/fourthbit/sphere-opengl
Julián Herrera
@vidjuheffex
May 29 2015 14:24

"make your libraries in r7rs format, which is impleneted in Gambit's namespaces, meaning that you get modules for functions, but syntax sits on a global namespace.",

Sorry just to clarify, lets say I have core.scm, my entry point. This would not be a module. But I could make an .sch file, lets say GUI.sch and export functions from there that non-modular code can use?

Sorry if this a dumb question, I'm the product of codeacademy... and am just now starting to explorer more advanced stuff.

Lastly, build instructions don't mention Windows. But I feel like on the gitter for Gambit itself, someone mentioned Windows building successfully.

Álvaro Castro-Castilla
@alvatar
May 29 2015 14:26
Yes, what you say is correct: A plain Scheme file can import libraries.
Take into account that SchemeSpheres gives you both more freedom and more responsibility than Blackhole.
With Blackhole anything is just imported and will run on local. You can also compile to a file. But you can't control over the many options Gambit provides, like producing loadable modules, shared libraries, etc.
For solving that, in SchemeSpheres the ssrunfile will describe the process you wish. This is particularly important for mobile apps, for instance. But imagine that you want to build a program that loads modules on-demand. That is easy with plain Gambit and with SchemeSpheres. In Gambit you would use the #-style files for namespaces, in SchemeSpheres you would use the R7RS style.
So, in summary, SchemeSpheres provides a wrapper on top of Gambit functionality to make it work with its namespaces functionality but with R7RS syntax.
Julián Herrera
@vidjuheffex
May 29 2015 18:58
Thanks. I just built Gambit, (Make test didn't work, but I proceeded with make install and I seem to have a functioning GSI and GSC) so I'll try to build scheme spheres next. Thanks again.
Álvaro Castro-Castilla
@alvatar
May 29 2015 19:14
I'm actually having issues myself now :D
But SchemeSpheres is completely portable code! And SSRun works on Windows too. There's been some movement in Gambit related to Windows path, so there might be a regression there, but the Windows support is there.
Julián Herrera
@vidjuheffex
May 29 2015 19:16
I saw that :) , I was going to say, MSYS2 installs 32bit and 64bit flavors of gcc shell, but shares a usr/local/ dir between them, one directory up. I had issues building gambit yesterday if I didn't -prefix to a C:/based directory
I used c:/Gambit-C