rune.git
8 years agoRune - flesh out type support
Matthew Dillon [Mon, 4 Jan 2016 00:32:23 +0000 (16:32 -0800)]
Rune - flesh out type support

* Pointer arithmatic now able to use any integer type and not just int32_t.

* Add += and -= for pointer arithmatic.

* More namespace separation to make functions related to interpreter
  execution more obvious.

* Cleanup several structural abstractions.

8 years agoRune - Localize interpreter code
Matthew Dillon [Fri, 1 Jan 2016 04:22:26 +0000 (20:22 -0800)]
Rune - Localize interpreter code

* Localize the interpreter code

8 years agoRune - Optimizations
Matthew Dillon [Wed, 30 Dec 2015 08:09:11 +0000 (00:09 -0800)]
Rune - Optimizations

* Inherit SF_NOZERO so arrays of types are properly flagged.

* Test for SF_NOZERO in LVSAlloc() (for heap allocations) and use
  znalloc() if possible.

* zalloc() does not need to bzero() a runevalloc()'d (anon mmap) area, so
  don't.  Document runevalloc*() to return a zero'd area.  The area does not
  have to be faulted in.

* Test 16GB virtual allocation.

8 years agoRune - Optimizations
Matthew Dillon [Wed, 30 Dec 2015 07:40:39 +0000 (23:40 -0800)]
Rune - Optimizations

* Break out of the array initialization loop if the first iteration does
  no work.

* Add "__nozero", remove "uninit".  Implement __nozero to allow allocations
  to skip the bzero() in certain cases (though doing so doesn't really
  improve performance, strangely enough).

* Add "pure" and refactor the pure function / pure expression code.  Do
  not overload "const" for this purpose any more.

* Allow partial compound assignments and structural assignments.
  Fix missing zeroing of compound stack declarations.

* Add more tests, including tests/gfxslider2.d which crates 6400 buttons.

* Fix bug in slab allocator, allocations of 32767 would index zone 80
  which was beyond the array.

* Relaxed storage qualifiers for type comparisons.  Simplify typeof() and
  remove the last resolve*() call from the run-time (libgen).

* Implement EXF_REQ_DCOPY, allowing the parent of an expression to supply
  the return storage for the recursive call.  This reduces bcopy()s and
  will make code generation more optimal.

  NOTE: Calls to getExpTmpData() must occur prior to any exp recursions.

8 years agoRune - Stabilization
Matthew Dillon [Tue, 29 Dec 2015 23:07:37 +0000 (15:07 -0800)]
Rune - Stabilization

* Fix memory corruption, parent's argsctx was being modified by the
  child thread after the child thread detached from the parent.

* Don't use the global hash table for Thread.tsleep/wakeup

* Fixup classes and tests for new tsleep/wakeup mechanic.

* Misc cleanups.

8 years agoRune - thread work
Matthew Dillon [Tue, 29 Dec 2015 20:21:18 +0000 (12:21 -0800)]
Rune - thread work

* Move Unix.waitThreads() to Thread.waitThreads()

* Cleanup sleep and wakeup methods.  Get rid of auxillary
  structure.

  Thread.sleep(ms)
  Thread.tsleep(&rendezvous, ms)
  Thread.wakeup(&rendezvous)

* Fix gfx2

* Remove 'async', go back to the thread_schedule statement and 'preempt'.

* Build cleanups

8 years agoRune - enhance LVALUE, add heap and persist, and more.
Matthew Dillon [Tue, 29 Dec 2015 09:18:31 +0000 (01:18 -0800)]
Rune - enhance LVALUE, add heap and persist, and more.

* More work on the instruction set.

* Allow LVALUE storage to work in more contexts, not just for arguments
  and return values.

* Add support for allocated and mmap()d storage via the 'heap' and 'persist'
  scope keywords.  This feature uses the LVALUE mechanic which embeds a
  LValueStor structure (addr, refstor pointer) in the context, allowing
  addr to be dynamically allocated, mmap()d or otherwise created in an
  out-of-band manner.

* Add support for casting pointers to integers (but not the other way around).
  Pointer values can be useful for in-program unique identifiers and other
  things.  Note that Rune will NEVER allow integers to be cast back to
  pointers (and we need to make sure live .map files don't get corrupted
  as well).

* Fix numerous bugs, but add even more to the TODO.

* Reorg some of the libraries.

8 years agoRune - Cleanup 1/2
Matthew Dillon [Sat, 28 Nov 2015 22:30:50 +0000 (14:30 -0800)]
Rune - Cleanup 1/2

* General cleanup, with some renaming to improve portability.

8 years agorune - var-args tracking, update docs, misc
Matthew Dillon [Fri, 27 Nov 2015 23:51:44 +0000 (15:51 -0800)]
rune - var-args tracking, update docs, misc

* Fix refstor handling for varargs calls and arrays.

* Install to user ~/bin and ~/.rune if not root, else install to
  /usr/local/bin and /usr/local/rune.

* Flesh out instruction set a bit more.

* Change runesize_t to unsigned 64-bits and adjust related use cases.

9 years agoparser - string concat, generic type case
Matthew Dillon [Tue, 28 Oct 2014 05:39:18 +0000 (22:39 -0700)]
parser - string concat, generic type case

* Add string concat, e.g. "abc" "def".

* Superclasses will match subclasses in switch(type) / case statements.

* General cleanup for type naming conventions.

9 years agoalias - Fix aliases
Matthew Dillon [Mon, 27 Oct 2014 02:57:51 +0000 (19:57 -0700)]
alias - Fix aliases

* The alias assignment expression must be duplicated for each use case,
  with a temporary object context pushed.

* Fix the context information.

* Fix the temporary space reservation.

9 years agoparser - more cleanups
Matthew Dillon [Sun, 26 Oct 2014 17:35:35 +0000 (10:35 -0700)]
parser - more cleanups

* more cleanups, better compound type detection

9 years agoParse - Bring in type and variable naming rules
Matthew Dillon [Sun, 26 Oct 2014 06:15:46 +0000 (23:15 -0700)]
Parse - Bring in type and variable naming rules

* We distinguish between type/class names and non-type identifiers
  by the format of the symbol.  This is something I've always wanted to
  do to enforce a little better readability for the code, but it also
  is a huge aid to the front-end parser which has far less context available
  to it than other languages might.  We can differentiate between (type)
  and (subexpression), for example.

  - Any symbol terminating in _t _u _p or _m is considered a type/class id.

  - Otherwise if it starts with a capital letter and all the alpha characters
    are not capitalized, it is a type/class id.

  - If all alpha characters are capitalized it is a constant identifier
    (not currently enforced).

  - Otherwise it is a non-type identifier.

* Examples:

  FUBAR_t - type/class
  FUBAR - constant identifier
  Fubar - type/class
  fubar - normal identifier

* Note that if you are used to a global variable starting with a capital,
  that is not allowed in Rune.  There are numerous reasons for this but
  mainly the problem, other than distinguishing types vs variables, is
  that the global might be referenced by a class path and in that context
  the capitalization can create a lot of confusion.

9 years agosync
Matthew Dillon [Tue, 7 Oct 2014 18:44:00 +0000 (11:44 -0700)]
sync

9 years agoInterpreter - reduce compiled size, improve performance
Matthew Dillon [Mon, 12 May 2014 23:26:00 +0000 (16:26 -0700)]
Interpreter - reduce compiled size, improve performance

* Do not pass RefStor **prs along the exp chain (ex_Func).  Store the
  cumulative value in the run-time context.  Most expressive elements
  do not need to access it.

  This reduces call-saved registers used by one.  Unary operators can
  now run with no save-used (about 7 instructions), and binary operators
  are more streamlined.

* Turn off a debugging assertion in getExpTmpData().  Binary operators
  are also now significantly more optimal (nominally ~26 instructions)
  and code size is further reduced.

9 years agoInterpreter - reduce compiled size
Matthew Dillon [Mon, 12 May 2014 19:46:33 +0000 (12:46 -0700)]
Interpreter - reduce compiled size

* Adjust st_Func to take and return the runctx_p.  By having callers reassign
  this variable, the compiler does not need to save/restore it across
  recursive calls.

* Adjust some inlines in libi/stmt.c such that actual actions taken make
  a real procedure call, to reduce unnecessary inline expansions.

9 years agoInterpreter - Incremental API changes
Matthew Dillon [Mon, 12 May 2014 18:54:15 +0000 (11:54 -0700)]
Interpreter - Incremental API changes

* Pass the run-time context through the call chain and remove the
  IContext global.

* I ultimately intend to make the run-time context a pass-and-return
  entity, which C compilers can optimize to avoid register saves and
  restores, and to move the break/continue count into the runctx.

9 years agoInterpreter - Add ex_TmpOffset, remove run-time temporary space reservation
Matthew Dillon [Mon, 12 May 2014 04:25:02 +0000 (21:25 -0700)]
Interpreter - Add ex_TmpOffset, remove run-time temporary space reservation

* The resolver already resolves temporary space, assign the calculated
  offset to a new field exp->ex_TmpOffset.

* Remove temporary space re-resolution from the interpreter, which saves
  instructions and speeds up the interpreter.  Just use ex_TmpOffset
  instead.

9 years agoInterpreter - Collapse sign-agnostic operators
Matthew Dillon [Mon, 12 May 2014 00:51:20 +0000 (17:51 -0700)]
Interpreter - Collapse sign-agnostic operators

* Collapse sign-agnostic operators.  For example, the result if a signed
  addition and the result of an unsigned addition are identical, so we
  do not need to generate two operator functions for it.

* Misc documentation adjustments (D -> RUNE)

9 years agoArrays - Slight unhacking of array[] expressions
Matthew Dillon [Sun, 11 May 2014 04:01:02 +0000 (21:01 -0700)]
Arrays - Slight unhacking of array[] expressions

* Allow IDs from const declarations to be used in array declaration.
  e.g.  const int COUNT=50; char buf[COUNT];

* We still need to handle basic interpretation to resolve calculated
  constants that might be used in array declarations.

9 years agoCore - Add cast-typeof, fix core bugs
Matthew Dillon [Sat, 10 May 2014 05:44:18 +0000 (22:44 -0700)]
Core - Add cast-typeof, fix core bugs

* Allow casts to use typeof, e.g. (typeof(a))b

* Fix some broken cases in FILE.show() for char, string, and integer
  handling.

* Update the grammar file, with unimplemented items in red, and make
  other corrections and additions.

* Fix bounds check for 0-length objects.

9 years agoGraphics - Fix cross-window event coordinates
Matthew Dillon [Fri, 9 May 2014 22:06:50 +0000 (15:06 -0700)]
Graphics - Fix cross-window event coordinates

* Fix slider handling in virtual sub-windows when the slider is held down.
  The coordinates were not being properly translated for the mouse focus.

* Using tests/gfxsliders.d to test.

9 years agoRUNE - Initial repo re-creation
Matthew Dillon [Fri, 9 May 2014 18:02:29 +0000 (11:02 -0700)]
RUNE - Initial repo re-creation

* Not saving the many prior repos.

* Basic code cleanup and modernization complete.

* This is a good starting point to track in a new repo.