commit 90bf8a4eb8a23f48e9938fcba479156fc9949a3c Author: Josh Holtrop Date: Thu Jul 16 23:33:28 2015 -0400 start on a README diff --git a/README.md b/README.md new file mode 100644 index 0000000..f3ff6f3 --- /dev/null +++ b/README.md @@ -0,0 +1,56 @@ +# Embedded Language Ideas + +I would like a scripting language to be able to easily embed in a host application with the following features: + +* Sandboxed for secure execution of untrusted code + + For example, the language should not automatically make available functionality that allows scripts to arbitrarily read or write files in the host filesystem, or spawn processes, or establish network connections. + +* Dynamically typed + +* Multi-paradigm + + The language should support imperative, object-oriented, and some functional aspects. + +* Supports nil, Boolean, Integer, Float, String, Array, Hash, and Class types + +* Supports closures + +# Features of Other Languages to Use or Avoid + +* Lua + * Good: + * Great C API documentation + * Not so good: + * 1-based array indexing + * The '#' operator not handling `nil` values within an array + +* Javascript + * Not so good: + * Having both a `null` and `undefined` value is overcomplicated. + * Classes/types are not types, so `typeof` returns a string. + +* Ruby + * Good: + * One `nil` value + * Clear definition of which objects are "falsey" + * Functional blocks + +# Syntax Ideas + +## Declare a variable + + var foo := 42; + +## Declare a function + + function foo(a, b) + { + a + b; + } + +Similar to Ruby, the result of the last expression is returned from a function, so an explicit `return` is not needed. + +## Anonymous Function + + var f = function(x) { x * x; }