Commits

Author Commit Message Labels Comments Date
Greg Ward
plugins: expose Python functions to Fubsy code. The rules are simple: if a name does not start with '_' and it refers to a callable object, it will be visible to Fubsy code. That means doing stuff like "from os.path import join" will clutter up the Fubsy namespace, so don't do that.
Greg Ward
build scripts: include line number info in generated C files
Greg Ward
coverage: move output files into .build/
Greg Ward
coverage: pass build tags to gocov What we build we test, and what we test we want coverage data on.
Greg Ward
dag: use types.UnsupportedAdd() instead of reinventing it locally
Greg Ward
types: replace unsupportedOperation() with UnsupportedAdd() unsupportedOperation() was overly general and not general enough. That's what you get for overthinking things. Just do the simplest thing that can possibly work.
Greg Ward
build script: add forgotten dependency: of course empython.c depends on empython.c.in
Greg Ward
rearrange so method implementation order matches interface order Types that implement FuObject always implement FuObject methods first: Typename(), String(). etc. Then (when applicable) come Node methods.
Greg Ward
dag: simplify ListNode a smidge; beef up test coverage
Greg Ward
types: use embedding to reduce proliferation of tiny Lookup() methods
Greg Ward
types: change FuString, FuList to structs This will allow us to embed other types in them for easier code reuse. For example, DefaultLookup() could be done with embedding an empty type that just provides a no-op implementation of Lookup().
Greg Ward
remove local copy of golex: download it in configure.sh instead
Greg Ward
plugins: more tests; use new testutils.NoError() function
Greg Ward
plugins: remove some debugging prints
Greg Ward
testutils: add NoError(), and make NoErrors() fail fatally if it fails
Greg Ward
remove local copy of gocov -- download + build it in configure.sh instead
Greg Ward
runtime: generate C wrappers for Python to call builtins Since it's impossible to generate C functions at runtime, we need to generate them at build time.
Greg Ward
runtime: add support for evaluating list literals
Greg Ward
plugins: handle callbacks to builtins more dynamically Instead of a hardcoded set of void pointers to Go callbacks, use an array of void pointers. It's still hardcoded to the current set of builtins, but it's progress!
Greg Ward
runtime: add BuiltinList, a new Namespace implementation for builtins It preserves order, which will be useful for calling builtins from C (e.g. embedded Python, Lua) -- we'll just look them up in a table, which is easy in C. It also disallows assignment by panic()ing.
Greg Ward
build scripts: print required environment variables more clearly and consistently
Greg Ward
plugins: automatically import fubsy module into Python's __main__
Greg Ward
build script: rebuild on changes to *.[ch] too
Greg Ward
plugins: expose builtin functions (mkdir(), etc.) to Python plugins It's quite limited so far: you can only pass strings back and forth. Specifically, function arguments passed from Python must be strings; values returned by Fubsy functions are String()ed and converted to C strings, then to Python strings.
Greg Ward
types,runtime: factor types.BasicArgs out of runtime.FunctionArgs Also rename FunctionArgs to RuntimeArgs, since now it just embeds BasicArgs and adds a pointer to the Runtime object. It exists so that builtin functions have a back-door to access other runtime stuff, notably the DAG. This also lets me ditch StubArgSource: BasicArgs fulfills that role now.
Greg Ward
types,runtime: make the ArgSource interface a bit narrower Drop Arg(), KeywordArg() methods so it's easier to implement. They're redundant anyways.
Greg Ward
plugins: update import path for go-python Needed because of upstream commit ea8c7d1e04a8a7d14dc5720c2eee5424ca7aa7e5
Greg Ward
dsl: make syntax for inline plugins nicer; trim common leading space Require newline right after the "{{{" and before the "}}}", and strip both of those newlines. That means the following are legal: plugin x {{{ }}} plugin x {{{ content }}} plugin x {{{ indented content }}} but these are not: plugin x {{{}}} plugin x {{{content}}} plugin x {{{ content}}}
Greg Ward
add barebones plugins package, just enough to embed Python All it can do right now is run a bit of Python code: there's no access to data back-and-forth, i.e. Fubsy cannot access Python code nor can Python code access Fubsy internals. But hey, it's a start!
Greg Ward
build scripts: factor out configure.sh; start using .build directory configure.sh is responsible for probing the system, downloading dependencies, and building dependencies. It's OK to be slow, because it should run rarely. build.sh builds Fubsy, so it should be fast. Both of these scripts should write build products to .build/1, the "stage 1" build directory. Stage 2 will be for the self-hosted build, i.e. using the "fubsy" binary from stage 1 to build itself. No…
  1. Prev
  2. Next