
saphire script language

What is this software?

    a client side script language under linux.

Compiled and tested saphire below Operating systems
    Debian 6
    OSX 10.7.0
    cygwin 1.7.9
    Oracle Solaris 11 Express
    FreeBSD 8.2

ATTENSION
    Use this software on your own risk. Don't use this under importnat systems. I recommend that you use this on your personal systems. I can't take a responsibility on your works with saphire. And use this with understanding that this language is very low performance.

How to compile
    Before compiling saphire, you need to resolve dependencies below. You need development packages.(ex. ncurses-devel or libncurse-dev)

    gcc 
    libc
    libm 
    ncurses
    readline
    oniguruma (which is a fast regex library)
    C/migemo (which is used by romaji completion. If you are Japanese, you may need this library)
    lv (which is needed by shelp inner command)

    Have you installed above libraries? You can type below commands to compile saphire.

    ./configure 
    make
    sudo make install

    or

    ./configure
    make
    su
    make install
    exit

    Default prefix is /use/local/bin, so you need a root comission for make install.

    If you want to change installed directory, type below

    sudo make DESTDIR=??? install

    When you choise normal install, installed saphiresh to /usr/local/bin and setting files to /usr/local/etc.

    configure options are below.

    --prefix --> indicate installed directory. If you use --prefix=$HOME, saphire will be installed $HOME/bin, $HOME/etc. As default, prefix is /usr/local.
    --with-optimize --> compiled with optimize. Fast binary will be made.
    --with-migemo --> enable C/Migemo which is Romaji completion for Japanese.
    --with-onig-dir --> indicate oniguruma installed directory.
    --with-migemo-dir --> indicate C/Migemo installed directory.
    --with-readline-dir --> indicate readline installed directory.
    --with-system-migemo-dir indicate C/Migemo dictionary directory.
    --with-debug --> give -g option to CFLAGS and add a checking memory leak system to saphire.
    --with-gprof-debug --> give -pg option to CFLAGS
    --with-static make saphrie without dynamic linked libraries.

    saphire makes library, so add /usr/local/lib(or your installed directory)  to /etc/ld.so.conf and type below to refresh dynamic loarding searched path cache.
    
    sudo ldconfig
    
    or

    su
    ldconfig
    exit
    

    If you don't have root comission, add the path to LD_LIBRARY_PATH environment variable. (With OSX, you should use DYLD_LIBRARY_PATH_FALLBACK environment variable.)

with OS X
    Before you installed saphire, you should compile readline library because OSX's readline is libedit, saphire need GNU readline.
    Also you can use Macports instead of manually compiling to install GNU readline.

Used files
    /usr/local/bin/saphire --> a program
    /usr/local/bin/saphiresh --> a interactive shell
    /usr/local/etc/saphire.sa --> a source setting file
    /usr/local/etc/saphire.sao --> a compiled setting file
    /usr/local/etc/completion.sa --> a source completion setting file
    /usr/local/etc/completion.sao --> a compiled completion setting file
    /usr/local/etc/shelp.sa --> a source help setting file
    /usr/local/etc/shelp.sao --> a compiled help setting file
    ~/.saphire/saphire.sao --> a compiled user setting file. Saphire read this after /usr/local/etc/saphire.sao.
    ~/.saphire/history --> a command line history file
    ~/.saphire/tmp --> Temporary directory used by saphire.
    /usr/local/share/migemo/{utf-8,eucjp.sjis}/{han2zen.dat,hira2kana.dat,migemo-dict,roma2hira.dat} --> migemo dictionary files
    /usr/share/cmigemo/{utf-8,eucjp.sjis}/{han2zen.dat,hira2kana.dat,migemo-dict,roma2hira.dat} --> migemo dictionary files

Encoding and Line field
    Saphire script source file must be written with UTF-8 encode and LF Linefield. Saphire can treat UTF8, EUCJP, and SJIS encodings and can treat LF, CR, LFCR line fields.
    You should run saphiresh as interactive shell on UTF-8 terminal.

Usage
    You can use saphiresh as a interactive shell with readline, and can use saphire as a acript engine. saphire is faster than saphiresh as a script engine because saphiresh loads readline.
    When using saphiresh, you can run shelp to read saphire usage.

Embbeded for aplications
    You can use saphire as a embbeded script engine for applications.
    See main.c and saphire.h.
    But I've been not completely ready for saphire API yet, so I can't recommend to use this for embbeded script engine.

When saphire upgrades
    Recompile all saphire sources. Pay attention to compile ~/.saphire/saphire.sa.

Files
    AUTHORS
    CHANGELOG.txt --> a changing log wrote by Japanese.
    LINCENSE --> MIT License
    Makefile.in --> Source of Makefile
    README.ja.txt --> Japanese README
    README.en.txt --> This file
    USAGE.ja.txt --> Japanese Usage
    USAGE.en.txt --> Usage
    config.h.in --> source of config.h
    configure --> configure program
    configure.in --> source of configure
    install.sh --> used by configure
    headers/saphire/saphire.h --> saphire header file
    saphire.sa --> saphire run time script
    completion.sa --> saphire completion run time script
    src/saphire_commands.c --> saphire inner commands
    src/saphire_commands_string.c --> saphire inner commands2
    headers/saphire/saphire_inner.h --> saphire inner header
    src/saphire_main.c --> saphire extra functions
    src/saphire_parser.c --> saphire parser
    src/saphire_vm.c --> saphire main function
    src/main.c --> saphire interactive shell program
    src/saphire_curses.c --> original terminal library
    headers/saphire/saphire_curses.h
    src/saphire_debug.c --> debug library
    headers/saphire/saphire_debug.h
    src/saphire_extra.c --> extra library
    headers/saphire/saphire_extra.h
    src/saphire_hash.c --> hash container library
    headers/saphire/saphire_hash.h
    src/saphire_kanji.c --> Japanese image character library
    headers/saphire/saphire_kanji.h
    src/saphire_list.c --> list container library
    headers/saphire/saphire_list.h
    src/saphire_string.c --> string library
    headers/saphire/saphire_string.h
    src/saphire_vector.c --> vector library
    headers/saphire/saphire_vector.h
    src/readline.c --> related to readline

LINCENSE
    MIT Lincense.
