An interpreter for a J-inspired language
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
doc Add rotate builtin Apr 3, 2018
examples Add prime sieve example Oct 20, 2016
ic Add while_a21 to compose_templ.c Jan 14, 2017
.gitignore Update gitignore Oct 1, 2016
LICENSE Add ISC license Sep 22, 2016
README.md Add section on portability to README Oct 12, 2016
apply.c Use loop declaration in DO, replacing most uses of DDO Oct 25, 2016
apply.h Add external error flag (reduce now incorrect) Mar 21, 2016
arith.c Combine 2-part and 3-part PROTECT Nov 13, 2016
arith.h Fix build system Feb 19, 2016
asm.c Change UI to U and use in place of I in type.h sometimes Apr 8, 2018
asm.h Add JIT code for identity functions Jan 12, 2017
builtin.c Fix a->ar alignment between apply_R and apply_A Nov 13, 2016
builtin.h Implement reciprocal_a1 Oct 1, 2016
builtin.ijs Add apply_R for register allocation Nov 3, 2016
builtin_auto.h Add apply_R for register allocation Nov 3, 2016
compare.c Replace a->t with a->ts Nov 7, 2016
compose.c Fix type error in right_a2 Jan 13, 2017
dom.c Comment apply.h and move or delete some declarations Mar 1, 2016
fmap.c Fix error handling segfault in fmap Apr 3, 2018
gen_all Add gen_all script to generate all generated files Sep 22, 2016
hash.c Change UI to U and use in place of I in type.h sometimes Apr 8, 2018
hash.h Change UI to U and use in place of I in type.h sometimes Apr 8, 2018
list.c Use unsigned ints in most of list.c Apr 8, 2018
main.c Fix build system Feb 19, 2016
mapping.c Handle non-list results in domain function Apr 3, 2018
mem.c Use unsigned ints in most of mem.c and mem.h Apr 8, 2018
mem.h Use unsigned ints in most of mem.c and mem.h Apr 8, 2018
name.c Add external error flag (reduce now incorrect) Mar 21, 2016
name.h Fix build system Feb 19, 2016
parse.c Style issues Feb 25, 2016
print.c Use loop declaration in DO, replacing most uses of DDO Oct 25, 2016
scan.c Move utility Err from mem.c to scan.c Mar 21, 2016
scan.h Fix build system Feb 19, 2016
stack.h Initial commit May 15, 2012
string.c Replace (for L l) l->p with LP(l) and FREE(LP(l)); FREE(l) with FREEL(l) Mar 21, 2016
type.h Change UI to U and use in place of I in type.h sometimes Apr 8, 2018
type.ijs Change UI to U and use in place of I in type.h sometimes Apr 8, 2018
x86_64.h Change UI to U and use in place of I in type.h sometimes Apr 8, 2018

README.md

The I programming language

I is a language which generalizes the array and functional capabilities of the array-programming language J to deal with a much broader variety of data structures.

Some features and design goals of I include:

  • Automatic mapping. Like J's array operations, I will map over lists, sets, associated arrays, and functions.
  • Soft typing built into the core of the language.
  • Automatic optimization when types are known, using JIT compilation.
  • Functional programming. Everything in I is a function.
  • Near-nonexistent syntax. Everything is function application.
  • Whitespace defines the order of precedence in a visually intuitive way.

Portability

The master branch contains version 0.1, which uses JIT compilation to do some operations very quickly. The compilation currently targets only the x86-64 architecture. Nearly all 64-bit desktop or laptop processors should use this architecture, but if your machine does not, you may want to use version 0.0, branch v0.0. All versions of I have only been tested on Linux and would probably require a small amount of modification to work with other operating systems.

Building I

To build, run gcc *.c -o I. Then ./I is a command-line interpreter.

Resources

See doc/introduction.md to begin learning about I.

The flash of insight that started I, built-in mapping, is documented at doc/BuiltInMapping/BuiltInMapping.pdf. It is presented in a manner that should be accessible to programmers without any specific language knowledge aside from functional programming.