Permalink
Commits on Jun 1, 2016
  1. Use the new and improved uptime module.

    Rather than relying on this error prone klunky old database entry
    which reported the uptime, use the `uptime.awk` module which simply
    hangs around and waits for requests to report it's uptime using a very
    quaintly implemented and nicely formatted string.
    
    Removed the old uptime mechanism from the database.
    committed Jun 1, 2016
  2. Uptime module now initializes correctly

    No longer does uptime.awk assume it's initialized without actually
    responding to the `init` event, nor does it mess with `OFS`. It also
    imports `module.awk` which is now mandatory as of a few changes ago.
    committed Jun 1, 2016
  3. time function can now find it's program

    There was a simple typo which was keeping it from actually calling
    `date '+%s'`.
    committed Jun 1, 2016
Commits on May 31, 2016
  1. Fixed strange stack-frame error

    Now, this is a workaround for what was a bug in gawk. Unfortunately
    haven't been able to create a minimum reproducable case for this
    issue, but before this change we'd get random errors where in eval.c
    we'd be trying to inspect an argument which had no value type.
    
    A little time was spent trying to create a minimum reproducable case
    for this issue, more will come (later).
    committed May 31, 2016
  2. A self-shaving autodestructing yak

    This was an attempt to factor all of the module parsing and loading
    behaviour out into a reusable library which the kernel can use for
    module loading, but which can also be used for testing as well as can
    be used by the kernel itself.
    
    There's a fair amount of additional change associated with it, and it
    should probably be tackled by smaller changes. Placing this off in a
    separate branch so it can be teased apart at a later time.
    committed May 31, 2016
Commits on Oct 5, 2015
  1. Ignore punctuation when testing for the target:

    When trying to figure out who's being addressed, ignore all
    punctuation at the end of a nick.  This has a bug probably, but it'll
    solve awkbot not responding to "awkbot, what's your name?" etc.
    committed Oct 5, 2015
  2. Join the specified channels when starting.

    For reasons that are unclear to me, this was removed at some point.
    Awkbot, when started, should always join the channels in the
    `channels' list in the configuration file.
    committed Oct 5, 2015
  3. Update settings to get online

    committed Oct 5, 2015
Commits on Aug 31, 2015
  1. Super simple spam filter

    committed Aug 31, 2015
Commits on Dec 31, 2011
  1. Fixed minor redundancy in bitwise.awk

     * bit_or was calcualting 2 ^ i twice.
    committed Dec 31, 2011
  2. Added test template for unit testing.

    TODO: Fix test harness once runawk stuff is finished.
    committed Dec 31, 2011
  3. Added notes and bitwise.awk to compiler.

     * The compiler is still not even started in earnest, apart from parsing the
       AST.  But bitwise has been added (it will be necessary for the backend) and
       some notes about how compilation might work have been added in comments.
    
    TODO: Separate front-end and back-end.
    committed Dec 31, 2011
Commits on Dec 30, 2011
  1. Added preliminary (incomplete) parts to a launcher.

     * A new launcher with support for dependency management will be created.  It
       will use a library shared by the amsterdam kernel for launching, which
       constructs an awk commandline.  It's bootstrapped by a shell script so
       exec(1) can be used (delegates to exec(3)).
     * The shared library will be used by the kernel to identify dependencies of
       dynamically loaded modules.  The program flow will be as follows:
       1. bootstrap calls runawk.awk to parse kernel.awk and build dependency graph.
       2. bootstrap exec's awk, running the amsterdam kernel, which uses runawk.awk
          as a dependency.
       3. kernel.awk loads all modules, parsing their dependencies using the code
          from runawk.awk
    
     * This will eliminate any dependencies in runawk.awk, and even dependencies of
       runawk.awk can be simply "known" by the runawk bootstrap.
    
    TODO: Rename runawk to a name that isn't already taken.
    committed Dec 30, 2011
  2. Added bitwise and pack libraries.

     - Bitwise adds basic bitwise-arithmetic functions implemented using base-10
       arithemtic.
     - pack creates binary packing and unpacking to/from integers, it depends on
       bitwise.
    Scott McCoy committed Dec 30, 2011
  3. Added "STOP" operation to virtual machine.

     * The virtual machine now has a "STOP" operation.  The vm_run() loop now
       identifies not only the end of program as a termination point but also
       "STOP".
       - The intent for "STOP" is that it can be used in the initialization of
         processes such as template programs, where a symbol table for the template
         can be built first and then "STOP" will be sent upward to put an end to
         the program, without destroying the VM state.  The next operation after
         the STOP is where execution picks up if vm_run() is called a second time.
       - This could have also been done by having a jmp to the end of the program
         in the instance that the program hasn't been run before, and having a jmp
         *over* the initialization routines otherwise.
       - There is a fair amount of discrepancy between how this works and how
         shared-object loading functions.  But it's worth noting that this is
         intended to be executed, controlled and interacted with by a program not
         running in the VM.  It might be worthwhile to consider other options.
    Scott McCoy committed Dec 30, 2011
  4. Fixed file descriptor leak in kernel.awk.

     * File descriptor leak in dependency scanning in kernel.awk, scanned/processed
       files were not being closed.
    Scott McCoy committed Dec 30, 2011
Commits on Dec 19, 2011
  1. Functioning parser and corrections to the AST:

     * The AST for branches no longer has a separate "otherwise", and conditions
       ("when" nodes) now truely represent two-target branches.
     * Fixed bugs for populating next
     * Fixed bugs in parse_block revolving around termination.
     * Fixed a node chaning bug.
     * Fixed parsing of loop expressions.
     * Added test to dump IR.
    
    TODO: Add compilation routine.
    committed Dec 19, 2011
Commits on Dec 17, 2011
  1. Cleaned up IR a bit.

     * Separated "literal" and "identifier" into separate types.
    committed Dec 17, 2011
  2. Syntax BNF, Literal expression.

     * Added (probably invalid) EBNF for template language syntax in comments.
     * Added example in comments.
     * Added design for data-structures.
       - Meta-parsing example.
       - Type structures, discriminators, etc.
    committed Dec 17, 2011
Commits on Nov 1, 2011
  1. Redesigned bytecode interpreter.

     * For the sake of having a simpler interpreter, doubled the size of the
       bytecode by switching the single register machine for a RAM machine.  The
       new reduced instruction set uses a format as follows:
    
        struct instruction {
            char    op;
            char[4] target;
            char   *data;
        }
    
      * The 13 current instructions should be enough to implement conditionals,
        loops and procedures.
      * Made dependent on chr.awk instead of inlining chr.awk...
    committed Nov 1, 2011
Commits on Oct 31, 2011
  1. Debugged classified operations and examples.

     * Several operations were mismapped.
     * Added JMPIF example
    
    This has been a bit of a futile exercise.  I'm going to toss it in favor of a
    simple stack/RAM machine with a two-operand instruction set.
    committed Oct 31, 2011
  2. Began redesign of instruction set.

     * Optimized instructions so there are classes, creating fewer over-all
       branches in the inner loop of the vm.
    Scott S. McCoy committed Oct 31, 2011
Commits on Oct 28, 2011
  1. Merge branch 'master' of https://github.com/ssmccoy/awkbot

    Scott S. McCoy committed Oct 28, 2011
  2. Initial virtual machine for templating language.

     * Created a simple VM for templating
       - Initial VM supports very basic ops necessary for implementing loops and
         conditions
    
    TODO: There are a few good optimizations available, one could easily remove LIT
    operations by creating a literal operation range.  That would reduce the number
    of conditional branches in the main loop, a key to performance.
    committed Oct 28, 2011
Commits on Oct 24, 2011
  1. Committed pre-working-loop flat-file templating.

     * The flat file template library, which I will wrap to make a module,
       processes a template and "byte compiles" it into an op-tree.  It has three
       basic operations, and nothing else (currently).
        * String::
          A literal string.
        * Value::
          * A variable (named) value.
        * Enumeration::
          * A loop over an array.
    
    I intend to, from this point where most of the opcodes are chosen, exist and
    effectively implemented, I would like to re-write the library because "loop" is
    currently a tertiary concept in both the structure and the processing code.  I
    find this to be somewhat inappropriate, and would actually like to create
    something like a procedure in the opcode and let loop represent an execution of
    the procedure.  This will make scope (enumeration depth) a first-class citizen
    in the structure and allow for greater flexibility and additional features if I
    chose to implement them, such as macros within templates.
    Scott S. McCoy committed Oct 24, 2011
Commits on Sep 16, 2011
  1. Disabled connect operation for connection

    Scott S. McCoy committed Sep 16, 2011
Commits on Sep 15, 2011
  1. Many fixes in amsterdam powered awkbot.

     * Fixed client/listener messaging so unidirectional messaging is atleast
       working.
     * Fixed wrapper script so it sends a hard kill to awkbot.
     * Added newline and subsep escaping to module.awk.  Modules can now send
       eachother messages without having to do anything about the format of the
       string.
    Scott S. McCoy committed Sep 15, 2011
Commits on Aug 11, 2011
  1. Created new IKC system (currently non-functional).

     * New IKC system creates a separate *external* named fifo which accepts
       incoming requests.  This keeps the main kernel feed "private".
       * Client creates it's own fifo for incoming messages, and contacts the
         public fifo requesting the kernel to accept messages from it.
       * Remote listener watches public fifo, and upon seeing a "connect" request
         creates a connection module instance
       * Connection module acts a liaison psuedo-module, a local module which is a
         placeholder for recieving events that are dispatched to the remote kernel.
       * The client creates a listener after initializing the connection, which
         dispatches all events back to the client module.
       * Client module publishes all events recieved.
    
    Notes:
     * This is currently not functioning because the relatively complex design
       apparently got mixed up during implementation a bit.  There is a deadlock on
       the client fifo as a result.
     * This system requires very polite behavior from the client.  Something should
       be done to the design to remove that requirement.  Most modules currently
       fail quite quickly and gracefully, this could easily leave connections
       hanging around and pipes and processes hanging around as a result.
     * This system *does* support synchronous communication fairly well, though.
    
     * The connection is supposed to do *both* things, i.e. be a "relay" and be the
       recipient of events from the kernel on behalf of the client.
    committed Aug 11, 2011
  2. awkbot now initializes with module system.

      * Created pre-load filter for modules which parses awk sources (by searching
        AWKPATH) for special #use comments similar to those supported by runawk.
      * Made awkbot support proper daemonization (bin/awkbot is no longer a
        blocking executable, but instead a controller).
      * Removed crude IKC system which depended on special kernel events.
        * IKC is being moved to a series of modules which support the functionality
          necessary for any two amsterdam powered applications to message
          one-another.
      * kernel now uses the awk command used to start itself as the "awk" command
        when creating new modules.
    committed Aug 11, 2011
Commits on May 23, 2011
  1. Added client module & kernel hooks.

     * Kernel now can accept "attach" commands which bind an arbitrary (given)
       command as a module to the current kernel.
     * client module, which pairs with selector and kernel attach behavior to
       "connect" to another kernel by advertising itself to that kernel as a
       module.  All messages recieved by the client from the remote kernel are
       published as events in the local kernel sourced from the client.
       * Due to the design of the client, the maximum number of arguments available
         drops from 9 to 7, so it may not work with *all* APIs.
     * Extended support in awkbot_db_mysql (added missing messages to dispatch
       table).
     * Created a test for the client.
    
    TODO:
     * Create a way for pipes to be named, or kernels to advertise themselves
       (preferably both)
    committed May 23, 2011
Commits on May 21, 2011
  1. Module shutdown cleans up event handlers.

     * Module shutdown now includes a (relatively inefficient) routine to clean up
       all the event handlers for a module when it calls shutdown.
       * any registered listeners for the module are deleted.
       * any events the module is listening to are cleared.
    committed May 21, 2011
  2. Essentually complete awkbot port.

     * awkbot_db_mysql is now a module.
     * database module is now discovered through configuration.
     * pure-awk calc is used.
     * reconnect/disconnect handled (seemingly) properly.
     * socket now emits "disconnected" event when the socket terminates
       prematurely.
    committed May 21, 2011
  3. Added loadtests.

    Kernel moves approximately 69k messages a second if the context switching is
    low.  This improves up to about 10 modules on my 8 core system.  After that,
    degredation takes place rapidly (20 modules showed only 28k m/s)
    
    The system never takes advatage of more than 1.9 concurrent processing
    channels.  This is likely due to the synchronization around the pipes that
    makes it all work smoothly under light load.  Without the repeated calls to
    fflush(), systems fail to start.
    Scott S. McCoy committed May 21, 2011