MyNixOS website logo
Description

Compiler from I- to S-Expressions for the Scheme Programming Language.

This compiler translates Scheme source code written with I-Expressions (indented expressions) into S-Expressions (symbolic expressions).

haskeme

This compiler translates Scheme source code written with I-Expressions (indented expressions) into S-Expressions (symbolic expressions).

Usage

Haskeme can read and write files:

haskeme --input "program.hss" --output "program.ss"

Haskeme can also use StdIn and StdOut:

cat "program.hss" | haskeme > "program.ss"

Options

  • -i or --input to specify input file
  • -o or --output to specify output file

I-Expressions

I-Expressions are indented expressions and are translated by few simple rules:

  • a new line translates to a new S-Expression
  • same indentation as the expression above translates to a new S-Expression following the prior one
  • more indentation as the expression above translates to a new S-Expression as an argument to the prior one
  • less indentation as the expression above, but still more indentation as another expression above translates to a new S-Expression, while the prior and further indented block gets wrapped in extra parentheses (look at the let-example)
  • S-Expression can be mixed in while staying in a single line (look at the example for mixed expressions)
  • full line comments starting with ; are ignored
  • a new line can be prevented from being turned into an S-Expression by prepending it with : after the indent (look at the example for prevented expressions)

Example

  • I-Expressions:

    define f
      lambda
        x
        let
            y
              * x x
          if
            > x 0
            + y 1
            : #f
    
  • S-Expressions:

    (define f
      (lambda (x)
        (let ((y (* x x)))
          (if (> x 0)
              (+ y 1)
              #f))))
    
  • mixed I- and S-Expressions:

    define f
      lambda (x)
        let
            y (* x x)
          if (> x 0)
             + y 1
             : #f
    

Install

  • install from Hackage with cabal:

    cabal install haskeme
    
  • clone from GitHub and compile with cabal:

    git clone https://github.com/jumper149/haskeme.git
    cd haskeme
    cabal build
    
  • clone from GitHub and compile with ghc (not recommended, use this PKGBUILD as a template)

  • install from AUR (only ArchLinux-Users)

Dependencies

  • ghc (make)
  • cabal (opt. make)
Metadata

Version

0.1.0.4

Platforms (75)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    WASI
    Windows
Show all
  • aarch64-darwin
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64_be-none
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-darwin
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-darwin
  • i686-freebsd
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • vc4-none
  • wasm32-wasi
  • wasm64-wasi
  • x86_64-cygwin
  • x86_64-darwin
  • x86_64-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-windows