Total Pageviews

Showing posts with label scheme. Show all posts
Showing posts with label scheme. Show all posts

Thursday, 12 October 2017

静态博客程序CHICKEN

CHICKEN is a compiler for the Scheme programming language

from 
http://www.call-cc.org/
https://code.call-cc.org/releases/4.12.0/chicken-4.12.0.tar.gz
http://code.call-cc.org/releases/
http://code.call-cc.org/

示范网站:http://www.zenlife.tk/index

Friday, 15 July 2016

SchemeSpheres

Importante notice: this documentation is pending update. Latest instructions can be found in current version's README.

0. Prerequisites

SchemeSpheres has been tested in GNU/Linux and OS X. You will need the following software installed:
  • A basic development environment (Git, a C/C++ compiler). We recommend a code editor such as Emacs with Paredit).
  • The Gambit Scheme Compiler. You can get the latest version from Github, or just use your distribution's package. We recommend using the latest version.
  • cURL (probably installed in your system already).

Installing Gambit on Linux

Downloading the latest version and running the following commands should do:
cd gambit
./configure --enable-single-host --enable-c-opt
make -j4 from-scratch
make check
sudo make install

Installing Gambit on OSX

Gambit recommends using GCC instead of LLVM for compiling its source. We need to install it with Homebrew:
brew install gcc49
Now we can compile Gambit explicitly using GCC. Substitute with your GCC version.
cd gambit
CC=/usr/local/bin/gcc-4.9 ./configure --enable-single-host --enable-c-opt
make -j4 from-scratch
make check
sudo make install
Note: Even though Homebrew is a very convenient way of installing Gambit, unfortunately it changes the way Gambit's directories are organized. It also removes the ability to tune Gambit's configuration, so SchemeSpheres doesn't support this way of installing Gambit at the moment. We will use Homebrew just for GCC.
Note for Linux and OSX: If your system can't find Gambit after installing it, make sure to link the gsi and gsc binaries to /usr/bin. Another option is to have Gambit's bin directory (/usr/local/Gambit-C/bin by default) in your system's path (both for the user and root).

1. Core Sphere installation

First, get the latest release or the development version from the Github repository.
In the cloned or uncompressed folder, run:
./configure
sudo ./bootstrap
Note for Gambit users: ./configure will create a .gambcini initialization file for you, and overwrite any previous one.

Try it out in the REPL

Now you can start using Spheres for loading code and dependencies in the Gambit REPL. Run gsi and type this in the REPL to see if it works.
(##spheres-load core: testing)
You should see:
-- including -- (core: testing-macros version: ())
-- loading -- (core: testing)
Which means that the module has been loaded, and its syntax macros are ready in the REPL. Now you can use the lightweight testing module directly in the REPL.

2. Installing spheres

If you are going to install OpenGL and SDL2 spheres, you need to have these libraries along with their C headers installed (all SDL libraries, the OpenGL implementation + GLEW). In OSX this can be achieved easily with Homebrew:
brew install sdl2 sdl2_image sdl2_mixer sdl2_net sdl2_ttf glew
In Linux, you need to use your distribution's package manager (emergepacmanapt-get...).
Spheres are installed using the sspheres program. These are the spheres in the latest release:
sudo sspheres install cairo codec crypto energy fabric fusion math object opengl sdl2 strings

3. Using SchemeSpheres

Interactive use

When coding interactively in the Gambit REPL, you have access to Spheres using the form:
(##spheres-load sphere: module)
This will take care of bringing and evaluating a module and its dependencies, for its immediate use in the REPL. Try running gsi and writing this code:
(##spheres-load fabric: algorithm/list)
(fold + 0 '(1 2 3 4 5))
The result should be 15 which is the sum of the list of numbers from 1 to 5.
If you really need to run a Scheme program without creating a managed project, you can run it from the command line like this:
gsi -e '(expander:include "test.scm")'
Compiling unmanaged projects is not supported. You need to create a container project for your code to properly compile code with SchemeSpheres. It is highly recommended to work with managed projects.

Managed project

Creating a project gives you access to the full functionality in SchemeSpheres, allowing multiple source files and properly handling all dependencies. In this example, we will use the OpenGL 2d generator to create a project template that you can use to try out the OpenGL and SDL bindings.
sfusion new -g sdl-opengl my-new-program
Now you can compile and run it on the Host (Linux/OSX), and Android/iOS device. To see which tasks are available, run inside the root folder of the you just created:
cd my-new-program
ssake
Important: For the Android backend to work, you need both Android SDK and NDK, plus the ANDROID_SDK_PATH and ANDROID_NDK_PATH environment variables set up pointing at these directories.
You can check for more generators with Sfusion:
sfusion generators
The key to working with projects is the configuration of the sakefile.scm and config.scm files. Currently, the best source of information is found at:
  • The default, generated config.scm and sakefile.scm files.
  • The ones found in current release Spheres.
  • The How do Spheres Work guide.

4. Where to go from here

Soon, there will be more tutorials and guides. Meanwhile, you can start from the program skeletons provided with Sfusion, and check the spheres for lots of functionality ready to use.
If you want to create a new Sphere, and nicely integrate with SchemeSpheres, the best way to start would be knowing more about how spheres work.
from  http://www.schemespheres.org/guides/en/quickstart,

------------------
SchemeSpheres v0.6 Release

  • Support for Android.
  • New generators, with Android support: (minimal, remote REPL, SDL OpenGL application with remote inspection/debugging).
  • Fusion/Sake tasks handle Scheme/C/Java avoiding recompilation whenever possible.
  • Full SDL2 bindings.
  • Full OpenGL/ES2 bindings.
  • General improvements to the overall infrastructure and bug fixes.
  • More functionality in several spheres.
If you want to try it out follow these quick instructions (or check out the Quickstart and Installation Guide):
  • This release has been developed for Gambit v4.7.2.
  • Download the v0.6 release of Core Sphere.
  • Run:



sudo ./bootstrap

  • Install the rest of the spheres in this release:



sudo sspheres install codec crypto energy fabric fusion math opengl sdl2 strings

  • Create an SDL/OpenGL(ES) skeleton:



sfusion new -g sdl-opengl my-new-program

  • See all available tasks:



sake

  • Run interpreted or compile it on the Host platform (Linux / OS X):



sake host

  • Compile and Run it on Android:



sake android:setup
sake android

If you are running the program called sense at the same time you run your Android App, and the IP address in src/app.scm points to your computer’s local IP, you’ll be connected remotely with a terminal running a Gambit REPL inside your Android device. Now you are free to develop interactively on Android.
Happy hacking! :)
from http://blog.fourthbit.com/2014/01/31/schemespheres-v0-dot-6-release/,

Thursday, 14 July 2016

Gambit Scheme system

The Gambit Scheme system is a complete, portable, efficient and reliable implementation of the Scheme programming language.
This web site is intended for users of the Gambit Scheme system. It is a place where various resources are collected and where users can exchange information related to Gambit.
Download latest release (v4.8.5): Development SourcesMac OS X installer (for Intel 32)Mac OS X installer (for Intel 64)iPhone/iPod touch/iPadWindows installer (for MinGW32)Windows installer (for MinGW64) (for other releases see the distributions). Libraries and module systems are installed separately.

What's Gambit?

Gambit consists of two main programs: gsi, the Gambit Scheme interpreter, and gsc, the Gambit Scheme compiler. The interpreter contains the complete execution and debugging environment. The compiler is the interpreter extended with the capability of generating executable files. The compiler can produce standalone executables or compiled modules which can be loaded at run time. Interpreted code and compiled code can be freely mixed.
Gambit-C is a version of the Gambit programming system in which the compiler generates portable C code. The main features of Gambit-C are:
  • Conformance. The Gambit-C system conforms to the R4RS, R5RS and IEEE Scheme standards and implements all optional features. Tail calls and first class continuations conform to the Scheme semantics. The full numeric tower is implemented, including: arbitrary precision integers (bignums), rationals, inexact reals (floating point numbers), and complex numbers. Several extensions to Scheme are provided, including: lightweight threads, a foreign-function interface (FFI), and extended I/O capabilities (Unicode, networking, subprocesses, ...).
  • Portability. Because the system is mostly written in Scheme and the compiler generates portable C code, it is easy to port the system as well as programs compiled with it to any platform with a decent C or C++ compiler. There is no reliance on a particular C compiler, although the system can take advantage of some gcc-specific constructs. The C code generated is oblivious to the endianness and word size of the target environment (32 and 64 bit architectures are currently supported). There are no external library dependencies, and OS API dependencies can be removed so as to run directly on the bare metal. The system includes high-performance bignum support utilizing sophisticated algorithms, implemented in Scheme.
  • Performance. The compiler includes several powerful program transformations such as user procedure inlining, partial-evaluation, and lambda-lifting. With appropriate declarations in the source code the executable programs generated by the compiler run roughly as fast as equivalent C programs. Programs containing no declarations are also optimized without compromising the Scheme semantics by speculatively inlining predefined procedures (see the benchmarks page for a comparison with other Scheme implementations and other languages). Thanks to an efficient implementation of continuations, the thread system is very efficient and can support millions of concurrent threads.
  • Reliability. Stable releases typically have very few bugs. Bug tracking is done with the issue tracker on github. Gambit-C has been used to develop large-scale real-world software and services in academic and commercial settings.
An overview of the Gambit system was presented by Marc Feeley at the 2010 International Lisp Conference. The slides of the "Gambit Scheme: Inside Out" talk are here. The slides for the talk "Compiling for Multi-language Task Migration" given at DLS 15 are here.

Getting Gambit

Gambit is available as prebuilt and source code distributions. There are prebuilt distributions for Mac OS X, iPhone/iPod touch/iPad (on Apple App Store), Microsoft Windows, and other operating systems. The source code distributions must be compiled with a C or C++ compiler. The latest sources are available at the Gambit repo on github.

Documentation

Documentation is available.

Support

Come chat with us in the #gambit channel on Freenode IRC.
from http://gambitscheme.org/wiki/index.php/Main_Page

download url: http://www.iro.umontreal.ca/~gambit/download/gambit/v4.8/prebuilt/
-----------


If you want to use the Gambit Scheme compiler, gsc, to compile Scheme files you will need the gcc C compiler.

Monday, 4 January 2016

编程语言scheme的官网

http://schemers.org
http://www.scheme.dk/planet/
-------------