These are chat archives for fourthbit/spheres

1st
May 2015
Jürgen Geßwein
@jgesswein
May 01 2015 11:26
Are you aware of problems installing SchemeSpheres on OS X? The other day it did not work (using Gambit 4.7.3).
Álvaro Castro-Castilla
@alvatar
May 01 2015 11:40
hi!
Are you using the repo fourthbit/spheres, right?
I'm using this under OSX and recently tested installing it on both OSX and a raspberry Pi.
What are the issues you are experiencing?
Jürgen Geßwein
@jgesswein
May 01 2015 11:42
Yes, I cloned the repository and started from there. (Clicking on the link “code” on the official main page.)
Álvaro Castro-Castilla
@alvatar
May 01 2015 11:43
ok
Where did you encounter issues? The .gambicini? the syntax expander?
Jürgen Geßwein
@jgesswein
May 01 2015 11:44
The machine with the error message just rebooted after coming back from sleep. I’ll try again and report any issues.
Álvaro Castro-Castilla
@alvatar
May 01 2015 11:44
If you are trying to compile the syntax expander with a version prior to latest release it will break, because of very recent changes in Gambit
I should probably mention what version of Gambit is compatible in the README
Jürgen Geßwein
@jgesswein
May 01 2015 11:45
Good idea!
Álvaro Castro-Castilla
@alvatar
May 01 2015 11:47
Done
Jürgen Geßwein
@jgesswein
May 01 2015 11:48
You are fast! ;-)
Álvaro Castro-Castilla
@alvatar
May 01 2015 11:49
:) otherwise I forget it
Is it clear now on the README or should I describe it?
Jürgen Geßwein
@jgesswein
May 01 2015 11:50
May be it would be a good idea to adapt to different Gambit versions. In C/C++ one could check the compiler version (#if…). I think there is an undocumented function for something like this in Gambit.
Should I just wait a couple of minutes until you have it implemented? :-D
Álvaro Castro-Castilla
@alvatar
May 01 2015 11:51
The problem is that there are many delicate changes. Maintaining that is impossible with limited time, I already saw my limitations trying to maintain too many things in previous versions ;)
This new version is much simpler, it uses R7RS modules, so if Gambit hopefully supports that natively I can remove the syntax expander and focus on libraries and tasks for building for multiple platforms.
That is actually the focus of Spheres!
Jürgen Geßwein
@jgesswein
May 01 2015 11:52
I see. Unfortunately some spheres are concerned with low-level stuff that changes between releases… Never mind. Now the supported version in mentioned.
Álvaro Castro-Castilla
@alvatar
May 01 2015 11:52
The problem with maintaining several versions of the Gambit compiler is that for bootstrapped code it means maintaining a new extra layer, that handles conditional expansion.
Jürgen Geßwein
@jgesswein
May 01 2015 11:53
I’ll check if it works with that version on my machine…
Álvaro Castro-Castilla
@alvatar
May 01 2015 11:53
I prefer to keep it in sync with Gambit, I see it more feasible.
Gambit is moving fast lately. I'm actually implementing SSL support for TCP connections, working on it right now.
It's probably going to be in next Gambit version.
Jürgen Geßwein
@jgesswein
May 01 2015 11:54
I’m using the old Snow module system for my programs and want to move to SchemeSpheres. But that requires als Windows support.
Álvaro Castro-Castilla
@alvatar
May 01 2015 11:55
I see.
Jürgen Geßwein
@jgesswein
May 01 2015 11:55
Once I have it working again on OS X and I’ll give it a try on Windows.
Álvaro Castro-Castilla
@alvatar
May 01 2015 11:55
Well, I have to do that soon. In any case, I have to do it in order to make the OpenSSL code work there (otherwise it won' be accepted by Marc).
Jürgen Geßwein
@jgesswein
May 01 2015 11:55
Hopefully it is as easy as OS X…
Álvaro Castro-Castilla
@alvatar
May 01 2015 11:56
I've never done it on Windows before. I've never even tried Gambit there.
Jürgen Geßwein
@jgesswein
May 01 2015 11:56
OK, may be we can join forces…
Álvaro Castro-Castilla
@alvatar
May 01 2015 11:56
How do you use it? Any recommendation on how should I start?
It would be great!
I have almost 0 experience on Windows
Do you use Visual Studio or Mingw for this?
Jürgen Geßwein
@jgesswein
May 01 2015 11:57
I’m using the official libraries released by Marc and link it into a C++ application.
Álvaro Castro-Castilla
@alvatar
May 01 2015 11:57
So you don't compile them?
Jürgen Geßwein
@jgesswein
May 01 2015 11:57
The C++-application is written using the MS tools.
Álvaro Castro-Castilla
@alvatar
May 01 2015 11:57
Ok
Jürgen Geßwein
@jgesswein
May 01 2015 11:57
So I do not compile Gambit for my apps.
Álvaro Castro-Castilla
@alvatar
May 01 2015 11:57
And how do you usually handle in windows all the scripts that you usually run on OSX/Linux in the shell
?
For instance, how should I handle the Spheres installation scripts?
Jürgen Geßwein
@jgesswein
May 01 2015 11:58
What kind of scripts do you mean?
Álvaro Castro-Castilla
@alvatar
May 01 2015 11:58
Like, when I want to compile a module in Spheres, I run 'ssrun compile[modulename]'
Or any other kind of script
Is it reasonable to use mingw for that?
Or do windows user expect to use the powershell or something windows-specific?
Jürgen Geßwein
@jgesswein
May 01 2015 12:00
You can use mingw for this. I’m more familiar with the MS tools. Debugging work way better than on MinGW.
Álvaro Castro-Castilla
@alvatar
May 01 2015 12:00
Actually, in this new version of Spheres, when a module is loaded it can be compiled on the fly, but for that it needs to invoke a script on the shell. That's not a problem on OSX or Linux, but maybe it is for Windows.
Ok
Jürgen Geßwein
@jgesswein
May 01 2015 12:00
I just fired up my VM to check how I do it…
Álvaro Castro-Castilla
@alvatar
May 01 2015 12:01
And when you run 'gsi' on Windows, what shell do you use?
Jürgen Geßwein
@jgesswein
May 01 2015 12:03
I compile all files produced by Gambit within Visual C++. The compilation from Scheme to C is done in a Pre-build script. This script is run in bash – so I can share it between Xcode and VC++.
Álvaro Castro-Castilla
@alvatar
May 01 2015 12:05
ah good
and that bash is run with mingw?
Jürgen Geßwein
@jgesswein
May 01 2015 12:06
Yes I have MinGW installed for that. A bit too much probably. Within MinGW I have only a small amount of tools installed.
Álvaro Castro-Castilla
@alvatar
May 01 2015 12:06
Ok, great
I'll soon set up a working environment on Windows (I actually have to compile Gambit there), so I'll let you know how it goes.
Jürgen Geßwein
@jgesswein
May 01 2015 12:08
The process is a bit complicated. If you want some more info I’ll could try to describe that setup in more detail. But probably I do not have time today. Is during the weekend sufficient?
Álvaro Castro-Castilla
@alvatar
May 01 2015 12:08
Sure, thank you!
Isn't it described anywhere on Gambit's page??
That's important
Jürgen Geßwein
@jgesswein
May 01 2015 12:09
OK, I’ll see what I can do for you… ;-)
Álvaro Castro-Castilla
@alvatar
May 01 2015 12:09
thanks! :))
Jürgen Geßwein
@jgesswein
May 01 2015 12:09
Interfacing with external stuff especially embedding is not documented “to the full extent”.
Álvaro Castro-Castilla
@alvatar
May 01 2015 12:10
Yes... I had to fiddle with that stuff for iOS and Android
Jürgen Geßwein
@jgesswein
May 01 2015 12:11
There are also some rough edges within Gambit that make embedding harder. For instance it captures Ctrl-C. This is not what you want when Gambit is embedding with a Unix CLI tool…
Álvaro Castro-Castilla
@alvatar
May 01 2015 12:11
By the way, I don't want to take more time from you if you are working now, but I'm curious, are you using Gambit for your own projects, client work or within a company?
I've only known companies from Canada using it
Jürgen Geßwein
@jgesswein
May 01 2015 12:13
Hmm. I am using Gambit for my private work. I use it for some commercial applications (FMDiff, FMVis) for a German company.
Álvaro Castro-Castilla
@alvatar
May 01 2015 12:13
awesome!
Jürgen Geßwein
@jgesswein
May 01 2015 12:14
These applications are a mix of Scheme and C++. I’m trying to move more code to Scheme, but this harder than anticipated.
Álvaro Castro-Castilla
@alvatar
May 01 2015 12:14
Well, my intention is to make Spheres not too ambitious, but solid. Testing is a very important part of it.
Jürgen Geßwein
@jgesswein
May 01 2015 12:15
Problem is that the granularity for moving from Scheme to C++ has to be right or there is lots of memory allocated for passing parameters.
Álvaro Castro-Castilla
@alvatar
May 01 2015 12:15
I think the problem is C++ ;)
Jürgen Geßwein
@jgesswein
May 01 2015 12:15
I hope that the FFI-modules in Spheres help me there.
Álvaro Castro-Castilla
@alvatar
May 01 2015 12:16
It is much simpler to interface with C. With C++ you need to make a free function for each method that you need, passing the "this" as a parameter.
Jürgen Geßwein
@jgesswein
May 01 2015 12:16
No it problem it really the passing. I started with TinyScheme long ago and with that Scheme embedding is done in a different way.
Álvaro Castro-Castilla
@alvatar
May 01 2015 12:16
The FFI modules in Spheres simplifies life a lot for C, it is tailored for making clean bidings.
Jürgen Geßwein
@jgesswein
May 01 2015 12:17
The system is easier to extended for custom types and you can step though it with a debugger.
Álvaro Castro-Castilla
@alvatar
May 01 2015 12:17
I see
Well, Gambit is powerful, but rough sometimes.
Jürgen Geßwein
@jgesswein
May 01 2015 12:17
All of this is more trouble some with Gambit although generated code is really good.
Álvaro Castro-Castilla
@alvatar
May 01 2015 12:18
Yes, that's how I see it
Jürgen Geßwein
@jgesswein
May 01 2015 12:18
Yes that is right. And there is no IDE that helps. (yes I know there is Emacs, but have a look at LispWorks or Racket…)
Álvaro Castro-Castilla
@alvatar
May 01 2015 12:19
I'm using Emacs for everything (not just Scheme) anyway ;)
Jürgen Geßwein
@jgesswein
May 01 2015 12:19
If there would be a decent IDE with some libraries I think would boost acceptance.
Something like Turbo Pascal if you can rember that. Fast compile, decent debugging.
Álvaro Castro-Castilla
@alvatar
May 01 2015 12:20
Someone needs to build that IDE then
Like Lightable for Clojure
Jürgen Geßwein
@jgesswein
May 01 2015 12:21
There is Jedi by Guillaume but that last time I tried that JazzScheme i was a big system and behaved sluggish.
Lightable is really nice. It should be possible to setup something like that for Scheme but I have basic problems with my FileMaker databases… Too bad…
Álvaro Castro-Castilla
@alvatar
May 01 2015 12:24
Everything tends to grow easily in complexity, so I think building an IDE would prove complicated after all
Gambit had its own IDE before (Guide was called I think)
But I guess it was abandoned to concentrate on the compiler
In my opinion, what really matters now for Gambit is that it implements native multithreading (SMP)
Jürgen Geßwein
@jgesswein
May 01 2015 12:27
Yes. But this will make debugging of stuff harder. Graphical tools are a plus here.
Álvaro Castro-Castilla
@alvatar
May 01 2015 12:28
I think we can learn from other languages here. I'm using Go now and I'm impressed by its concurrency model and debugging tools.
It gives a very informative stacktrace per thread
Jürgen Geßwein
@jgesswein
May 01 2015 12:30
Can you that in Emacs? (Probably it’s an OS… I’m also using Emacs for editing, but I think I’m not an advanced user.)
BTW: There are open source IDEs. CodeLite or Code::Blocks for instance. May be one can adjust them to use Gambit as a different compiler…
OK, no Emacs with this approach. But the editing component could be based on Hemlock.
Álvaro Castro-Castilla
@alvatar
May 01 2015 12:34
Well, in Emacs you can work interactively with Gambit, send code to the REPL. This, if used well, really speeds up development, as you can test changes live. You have to build your code to be good for this (being able to restart live, for instance).
Then, you can in the repl inspect other threads, see (spheres/util inspect)
Jürgen Geßwein
@jgesswein
May 01 2015 12:40
OK. I see that from the perspective of my applications. Parts are written in C++ and are not yet available to be used within the REPL. Running tests involves Scheme and C++ code and hence needs a compilation.
The interface between the languages is hard to get right with this setup. Hopefully I can repackage some code to get better access to Scheme’s interactive development.