pez
9 years agoMerge branch 'master' of github.com:pete/pez master
Pete Elmore [Sun, 5 Apr 2015 23:28:43 +0000 (16:28 -0700)]
Merge branch 'master' of github.com:pete/pez

9 years agoAttempt to make that memory contiguous.
Pete Elmore [Sun, 5 Apr 2015 23:24:08 +0000 (16:24 -0700)]
Attempt to make that memory contiguous.

It speeds things up, but not as much as I'd hoped.

9 years agoAdd a bug to TODO.
Pete Elmore [Sun, 5 Apr 2015 23:22:58 +0000 (16:22 -0700)]
Add a bug to TODO.

9 years agoMerge pull request #4 from larsbrinkhoff/master
Pete [Thu, 26 Mar 2015 18:08:06 +0000 (11:08 -0700)]
Merge pull request #4 from larsbrinkhoff/master

Make GitHub detect *.pez as Forth

9 years agoMake GitHub detect *.pez as Forth
Lars Brinkhoff [Thu, 26 Mar 2015 09:07:32 +0000 (10:07 +0100)]
Make GitHub detect *.pez as Forth

11 years agoI love getting to delete m4 files!
Pete Elmore [Sat, 2 Jun 2012 05:55:02 +0000 (22:55 -0700)]
I love getting to delete m4 files!

11 years agoLightning isn'used any more.
Pete Elmore [Sat, 2 Jun 2012 05:54:00 +0000 (22:54 -0700)]
Lightning isn'used any more.

12 years agoThere is not much to this, but it is a small library for fractions.
Pete Elmore [Wed, 4 Jan 2012 19:39:39 +0000 (11:39 -0800)]
There is not much to this, but it is a small library for fractions.

12 years agoPoke at write and gets a little. Need sighandlers.
Pete Elmore [Wed, 4 Jan 2012 19:38:07 +0000 (11:38 -0800)]
Poke at write and gets a little.  Need sighandlers.

12 years agoFix the the spell checker example to use the new FFI.
Pete Elmore [Wed, 28 Dec 2011 03:45:18 +0000 (19:45 -0800)]
Fix the the spell checker example to use the new FFI.

12 years agoSeems lib/prime-sieve.pez had been "staged" but not "committed" for months. GIT!
Pete Elmore [Wed, 28 Dec 2011 03:41:53 +0000 (19:41 -0800)]
Seems lib/prime-sieve.pez had been "staged" but not "committed" for months. GIT!

12 years agoNew words: pipe, fddup, fddup2. Wrappers around pipe(2), dup(2), dup2(2).
Pete Elmore [Wed, 28 Dec 2011 03:39:41 +0000 (19:39 -0800)]
New words:  pipe, fddup, fddup2.  Wrappers around pipe(2), dup(2), dup2(2).

12 years agoTODO is a file which will never be zero lines long.
Pete Elmore [Wed, 28 Dec 2011 03:38:47 +0000 (19:38 -0800)]
TODO is a file which will never be zero lines long.

12 years agoPut Wolf in the credits, that guy is awesome.
Pete Elmore [Wed, 28 Dec 2011 03:38:30 +0000 (19:38 -0800)]
Put Wolf in the credits, that guy is awesome.

12 years agoA couple of minor error-handling fixes, and make bounds-checking the default.
Pete Elmore [Thu, 24 Nov 2011 23:59:33 +0000 (15:59 -0800)]
A couple of minor error-handling fixes, and make bounds-checking the default.

12 years agoGeneral cleanup; fix a couple of undefined behaviors and make bounds checking
Pete Elmore [Wed, 16 Nov 2011 07:54:51 +0000 (23:54 -0800)]
General cleanup; fix a couple of undefined behaviors and make bounds checking
something you turn off instead of on.
(Incidentally, the overhead for bounds-checking is insanely small for most
of the code I've tested.  Might just leave it always on.)

12 years agoReformat comments, and don't be an idiot around pointers.
Pete Elmore [Sun, 13 Nov 2011 05:33:24 +0000 (21:33 -0800)]
Reformat comments, and don't be an idiot around pointers.

12 years agoRedo TODO
Pete Elmore [Sun, 13 Nov 2011 05:33:02 +0000 (21:33 -0800)]
Redo TODO

12 years agoTake the puts() out, baller style.
Pete Elmore [Tue, 6 Sep 2011 08:02:39 +0000 (01:02 -0700)]
Take the puts() out, baller style.

12 years agoHere I was, worried that adding libtcc to the autotools mess would be a
Pete Elmore [Tue, 6 Sep 2011 07:37:12 +0000 (00:37 -0700)]
Here I was, worried that adding libtcc to the autotools mess would be a
pain.  It was not...yet.

12 years agoDropping Lightning from the FFI in favor of libtcc.
Pete Elmore [Tue, 6 Sep 2011 07:33:42 +0000 (00:33 -0700)]
Dropping Lightning from the FFI in favor of libtcc.

12 years agoIncorrectly checked overflow rather than underflow.
Pete Elmore [Sun, 26 Jun 2011 16:08:12 +0000 (09:08 -0700)]
Incorrectly checked overflow rather than underflow.

12 years agoPrefetching IP. This is experimental! Eliminating the pointer-chasing speeds
Pete Elmore [Thu, 16 Jun 2011 23:09:31 +0000 (16:09 -0700)]
Prefetching IP.  This is experimental!  Eliminating the pointer-chasing speeds
a lot of operations up by 10-30%, but slows some down (mainly pushing literals)
due to (I suspect without being certain) branch-predictor misses.  Getting those
back up to speed involves a reworking of (LIT).  My intention is to do one of
these:  re-add the (LIT0), (LIT1), etc., words from the old branch; use
lightning to generate (LITx) words as needed; tag literals and only resort to
use of (LIT) when we need all N bits of a cell; revert this patch.  Still not
quite certain.

12 years agoNew word: w_nohang, flag for wait.
Pete Elmore [Sun, 29 May 2011 00:28:53 +0000 (17:28 -0700)]
New word:  w_nohang, flag for wait.

12 years agoNew word: rdrop
Pete Elmore [Sun, 29 May 2011 00:28:17 +0000 (17:28 -0700)]
New word:  rdrop

13 years agoEliminate branches for comparisons. Pfffft.
Pete Elmore [Fri, 3 Dec 2010 03:08:35 +0000 (19:08 -0800)]
Eliminate branches for comparisons.  Pfffft.

13 years agoNew word: 'times', ( word n -- ). It takes a word and a number of times to execute...
Pete Elmore [Thu, 18 Nov 2010 08:11:10 +0000 (00:11 -0800)]
New word:  'times', ( word n -- ).  It takes a word and a number of times to execute the word.

13 years agoI wanted some math.
Pete Elmore [Thu, 18 Nov 2010 08:11:00 +0000 (00:11 -0800)]
I wanted some math.

13 years agoAdd a couple of float stack manipulators, make 'clear' clear both stacks,
Pete Elmore [Sun, 14 Nov 2010 06:38:44 +0000 (22:38 -0800)]
Add a couple of float stack manipulators, make 'clear' clear both stacks,
and reorder/trim the interpreter struct.  Believe it or not, this made Pez
faster by about 5%.

13 years agoNew word: log10. Toyed with calling it log[10], wisely chickened out.
Pete Elmore [Wed, 27 Oct 2010 06:42:10 +0000 (23:42 -0700)]
New word:  log10.  Toyed with calling it log[10], wisely chickened out.

13 years agoThe C preprocessor told me that it was disappoint.
Pete Elmore [Sun, 10 Oct 2010 08:59:11 +0000 (01:59 -0700)]
The C preprocessor told me that it was disappoint.

13 years agoDone having build issues with what was already a bad idea.
Pete Elmore [Sun, 10 Oct 2010 08:54:15 +0000 (01:54 -0700)]
Done having build issues with what was already a bad idea.

13 years agoMoved to the dispenser repo.
Pete Elmore [Sun, 10 Oct 2010 08:47:30 +0000 (01:47 -0700)]
Moved to the dispenser repo.

13 years agoNew word: die (like die!, but no message). Fix a bug in waitpid.
Pete Elmore [Sun, 10 Oct 2010 08:46:45 +0000 (01:46 -0700)]
New word:  die (like die!, but no message).  Fix a bug in waitpid.

13 years agoBLOOPSAPHONE!
Pete Elmore [Fri, 3 Sep 2010 06:31:26 +0000 (23:31 -0700)]
BLOOPSAPHONE!

13 years agoThere was a bug in the handling of floats/doubles when loading/storing explicit
Pete Elmore [Fri, 3 Sep 2010 04:50:24 +0000 (21:50 -0700)]
There was a bug in the handling of floats/doubles when loading/storing explicit
C types.  Discovered while writing an interface for _why's bloopsaphone (for
epic justice; it'll be checked in when it definitely works).

13 years agoThat changed a long time ago.
Pete Elmore [Mon, 16 Aug 2010 23:15:54 +0000 (16:15 -0700)]
That changed a long time ago.

13 years agoGone.
Pete Elmore [Mon, 16 Aug 2010 20:54:47 +0000 (13:54 -0700)]
Gone.

13 years agoAnd AWIB ( http://code.google.com/p/awib/ ) actually won't run without more
Pete Elmore [Sat, 7 Aug 2010 23:08:24 +0000 (16:08 -0700)]
And AWIB ( code.google.com/p/awib/ ) actually won't run without more
cells.

13 years agoAnd this is the solution that should have occurred to me *first*.
Pete Elmore [Sat, 7 Aug 2010 22:57:17 +0000 (15:57 -0700)]
And this is the solution that should have occurred to me *first*.

13 years agoThat's the dumb but less hacky version. Next up...
Pete Elmore [Sat, 7 Aug 2010 22:55:17 +0000 (15:55 -0700)]
That's the dumb but less hacky version.  Next up...

13 years agospeling.pez, an implementation of Norvig's spelling corrector.
Pete Elmore [Wed, 4 Aug 2010 09:01:17 +0000 (02:01 -0700)]
speling.pez, an implementation of Norvig's spelling corrector.

13 years agoVery simple benchmarking lib.
Pete Elmore [Wed, 4 Aug 2010 08:19:50 +0000 (01:19 -0700)]
Very simple benchmarking lib.

13 years agoFix a bug in 'execute', document exword() (so as to avoid this bug in the
Pete Elmore [Wed, 4 Aug 2010 08:18:15 +0000 (01:18 -0700)]
Fix a bug in 'execute', document exword() (so as to avoid this bug in the
future), and then a few other comment tweaks.

13 years agoDrop a bug from read-file in core.pez.
Pete Elmore [Wed, 4 Aug 2010 08:17:58 +0000 (01:17 -0700)]
Drop a bug from read-file in core.pez.

13 years agoI needed one of these.
Pete Elmore [Sun, 1 Aug 2010 22:22:07 +0000 (15:22 -0700)]
I needed one of these.

13 years agostrform was lying!
Pete Elmore [Sat, 31 Jul 2010 11:05:50 +0000 (04:05 -0700)]
strform was lying!

13 years agoIf you check the date I added that TODO, you'll see how long this has been
Pete Elmore [Sat, 31 Jul 2010 10:49:08 +0000 (03:49 -0700)]
If you check the date I added that TODO, you'll see how long this has been
bothering me.

13 years agoFloats get their own stack.
Pete Elmore [Sat, 31 Jul 2010 10:07:32 +0000 (03:07 -0700)]
Floats get their own stack.
Advantages:
  * Faster
  * Cleaner (much less alignment special-casing)
  * Simpler (especially for the FFI)

13 years agoThis left a pointer to the library name on the stack. This would actually be
Pete Elmore [Thu, 22 Jul 2010 07:41:10 +0000 (00:41 -0700)]
This left a pointer to the library name on the stack.  This would actually be
and accidental feature, were it not for the fact that popping it off would
cause the else clause to do bad stuff to memory.

13 years agoMinor additions to the core library.
Pete Elmore [Thu, 22 Jul 2010 07:40:54 +0000 (00:40 -0700)]
Minor additions to the core library.

13 years agoNew word: ht-values. Yes, I copypasta'd.
Pete Elmore [Sun, 11 Jul 2010 21:18:37 +0000 (14:18 -0700)]
New word:  ht-values.  Yes, I copypasta'd.

13 years agoTwo new words: ht-size and ht-keys, to get the size and an array of the keys
Pete Elmore [Sun, 11 Jul 2010 21:03:08 +0000 (14:03 -0700)]
Two new words:  ht-size and ht-keys, to get the size and an array of the keys
out of a hash table, respectively.

13 years agoUnnecessary output.
Pete Elmore [Tue, 6 Jul 2010 06:16:45 +0000 (23:16 -0700)]
Unnecessary output.
(I was doing diffs against prime lists generated by another program
to verify; the "[pez]" was there to make them easier to read.)

13 years agoDang but reverse Polish notation seems to have made me reason backwards.
Pete Elmore [Tue, 6 Jul 2010 06:15:26 +0000 (23:15 -0700)]
Dang but reverse Polish notation seems to have made me reason backwards.

13 years agoWhy did I have the word "pile" in there?
Pete Elmore [Tue, 6 Jul 2010 05:55:55 +0000 (22:55 -0700)]
Why did I have the word "pile" in there?

13 years agoAdding a prime number sieve example.
Pete Elmore [Tue, 6 Jul 2010 05:51:55 +0000 (22:51 -0700)]
Adding a prime number sieve example.

13 years agoThese are going away, actually, and moving elsewhere. Stay tuned.
Pete Elmore [Tue, 6 Jul 2010 02:11:10 +0000 (19:11 -0700)]
These are going away, actually, and moving elsewhere.  Stay tuned.

13 years agoWhoa, that's a *bug*.
Pete Elmore [Tue, 6 Jul 2010 02:10:34 +0000 (19:10 -0700)]
Whoa, that's a *bug*.

13 years agoatoi
Pete Elmore [Tue, 6 Jul 2010 02:10:20 +0000 (19:10 -0700)]
atoi

13 years agoLeft that off until now.
Pete Elmore [Sun, 13 Jun 2010 21:55:23 +0000 (14:55 -0700)]
Left that off until now.

13 years agoNew words: chomp and chomp!
Pete Elmore [Sun, 13 Jun 2010 21:51:02 +0000 (14:51 -0700)]
New words:  chomp and chomp!

13 years agoKeep out the generated file.
Pete Elmore [Sun, 13 Jun 2010 20:31:22 +0000 (13:31 -0700)]
Keep out the generated file.

13 years agoSome FFI cleanup.
Pete Elmore [Sun, 13 Jun 2010 20:30:36 +0000 (13:30 -0700)]
Some FFI cleanup.

13 years agoDe-dup that.
Pete Elmore [Sat, 12 Jun 2010 16:23:50 +0000 (09:23 -0700)]
De-dup that.

13 years agoNew words: $, waitpid. "some command line" $ is similar to backticks in other
Pete Elmore [Sat, 12 Jun 2010 16:21:23 +0000 (09:21 -0700)]
New words:  $, waitpid.  "some command line" $ is similar to backticks in other
languages, waitpid is about what you expect.

13 years agoFor FFI stuff to build with the same options as Pez, it needs config.h around.
Pete Elmore [Sat, 12 Jun 2010 07:13:48 +0000 (00:13 -0700)]
For FFI stuff to build with the same options as Pez, it needs config.h around.

13 years agoWhoops!
Pete Elmore [Sat, 12 Jun 2010 06:48:22 +0000 (23:48 -0700)]
Whoops!

13 years agoNew word: fsleep, which takes a float.
Pete Elmore [Sat, 12 Jun 2010 06:44:31 +0000 (23:44 -0700)]
New word:  fsleep, which takes a float.

13 years agoAdding the beginnings of the SDL lib. Currently testing it out, should have
Pete Elmore [Sat, 12 Jun 2010 02:04:42 +0000 (19:04 -0700)]
Adding the beginnings of the SDL lib.  Currently testing it out, should have
the rest up soon, as well as some helpers for compiling C-FFI stuff.

13 years agoStuffing these into the API. Amazed they weren't there.
Pete Elmore [Sat, 12 Jun 2010 02:04:14 +0000 (19:04 -0700)]
Stuffing these into the API.  Amazed they weren't there.

13 years agoNew word: rand.
Pete Elmore [Fri, 11 Jun 2010 05:21:01 +0000 (22:21 -0700)]
New word:  rand.

13 years agoStuff all of that into core.pez.
Pete Elmore [Wed, 9 Jun 2010 22:17:00 +0000 (15:17 -0700)]
Stuff all of that into core.pez.

13 years agoNew word: realloc. Apparently, uh, reading a few megabytes of data is slow as
Pete Elmore [Wed, 9 Jun 2010 22:06:29 +0000 (15:06 -0700)]
New word:  realloc.  Apparently, uh, reading a few megabytes of data is slow as
hell if you do it by reading 4k chunks and s+'ing them.  Ahem.

13 years agoA light touch-up for the list concatenator. It's still O(n)!
Pete Elmore [Wed, 9 Jun 2010 22:05:44 +0000 (15:05 -0700)]
A light touch-up for the list concatenator.  It's still O(n)!

14 years agoPoke at the linked list library, make it use the new struct stuff.
Pete Elmore [Tue, 11 May 2010 04:19:13 +0000 (21:19 -0700)]
Poke at the linked list library, make it use the new struct stuff.

14 years agoA whitespace change to move a comment immediately above the function it
Pete Elmore [Tue, 11 May 2010 04:18:26 +0000 (21:18 -0700)]
A whitespace change to move a comment immediately above the function it
describes.  Definitely my best commit ever.

14 years agoThat was broken anyway. It will be back shortly, though.
Pete Elmore [Mon, 10 May 2010 00:53:38 +0000 (17:53 -0700)]
That was broken anyway.  It will be back shortly, though.

14 years ago755
Pete Elmore [Mon, 10 May 2010 00:39:50 +0000 (17:39 -0700)]
755

14 years agoWow, it feels good to take that out of the TODO.
Pete Elmore [Sun, 9 May 2010 23:01:44 +0000 (16:01 -0700)]
Wow, it feels good to take that out of the TODO.

14 years agoAdd support for structs, at long last!
Pete Elmore [Sun, 9 May 2010 22:57:38 +0000 (15:57 -0700)]
Add support for structs, at long last!
Also fix sdup and gets, a warning in tuck and 2tuck, and document system.
Non-atomic, but not my only atrocity of the day.

14 years agoThat example segfaulted if no arguments were passed.
Pete Elmore [Sun, 9 May 2010 22:54:35 +0000 (15:54 -0700)]
That example segfaulted if no arguments were passed.

14 years agoInclude those files in the build.
Pete Elmore [Sun, 9 May 2010 22:54:18 +0000 (15:54 -0700)]
Include those files in the build.

14 years agoThis was the stuff I was putting off because it was tedious. Even generating
Pete Elmore [Sun, 9 May 2010 22:52:08 +0000 (15:52 -0700)]
This was the stuff I was putting off because it was tedious.  Even generating
it was tedious.  Anyway, this should be all we need to make structs worse.

14 years agoI had some fun printing prime factors of things.
Pete Elmore [Sun, 9 May 2010 22:51:08 +0000 (15:51 -0700)]
I had some fun printing prime factors of things.

14 years agoTODO update.
Pete Elmore [Sun, 18 Apr 2010 23:08:58 +0000 (16:08 -0700)]
TODO update.

14 years agoNew words: tuck, 2tuck, and some tests.
Pete Elmore [Sun, 18 Apr 2010 23:01:03 +0000 (16:01 -0700)]
New words:  tuck, 2tuck, and some tests.

14 years agoClean that horror up a little.
Pete Elmore [Sun, 11 Apr 2010 05:57:38 +0000 (22:57 -0700)]
Clean that horror up a little.

14 years agoAdd a thousand annoying size words and accessors for various types, for talking
Pete Elmore [Sun, 11 Apr 2010 05:24:52 +0000 (22:24 -0700)]
Add a thousand annoying size words and accessors for various types, for talking
to C libraries.  Some use standard C types with platform-dependent sizes, some
use types that explicitly mention sizes, and it's just a mess.  No two ways
about it.  (But, thankfully, autotools can shield us from parts of it.)

14 years agoThree new words: sdup, ht-dup, format. Will eventually do fformat.
Pete Elmore [Sat, 10 Apr 2010 21:34:26 +0000 (14:34 -0700)]
Three new words:  sdup, ht-dup, format.  Will eventually do fformat.

14 years agoUpdate an example.
Pete Elmore [Sat, 10 Apr 2010 21:33:27 +0000 (14:33 -0700)]
Update an example.

14 years agoLaying it out a little more plainly.
Pete Elmore [Sat, 10 Apr 2010 21:33:08 +0000 (14:33 -0700)]
Laying it out a little more plainly.

14 years agoAUTOMATIC
Pete Elmore [Sat, 10 Apr 2010 21:32:58 +0000 (14:32 -0700)]
AUTOMATIC

14 years agoYeah, the flags are a little obscure, still.
Pete Elmore [Fri, 2 Apr 2010 07:24:00 +0000 (00:24 -0700)]
Yeah, the flags are a little obscure, still.

14 years agoTODOne!
Pete Elmore [Fri, 2 Apr 2010 07:20:07 +0000 (00:20 -0700)]
TODOne!

14 years agoMove the zero-branch checking into ; (i.e., at compilation finish) so that
Pete Elmore [Fri, 2 Apr 2010 07:12:13 +0000 (00:12 -0700)]
Move the zero-branch checking into ; (i.e., at compilation finish) so that
we can avoid the cost of doing it at runtime.  The one caveat is that ; doesn't
always get called (!!) and I don't have a good solution yet, but presumably
you know the risks if you're assembling words yourself or using does>.

14 years agoGots to do something about that problem.
Pete Elmore [Fri, 2 Apr 2010 06:48:44 +0000 (23:48 -0700)]
Gots to do something about that problem.

14 years agoChecking for bad branches.
Pete Elmore [Thu, 1 Apr 2010 07:17:40 +0000 (00:17 -0700)]
Checking for bad branches.

14 years agoWell, that solves the mystery of the angry floats.
Pete Elmore [Thu, 1 Apr 2010 07:04:30 +0000 (00:04 -0700)]
Well, that solves the mystery of the angry floats.

14 years agoAnd another.
Pete Elmore [Thu, 1 Apr 2010 06:37:32 +0000 (23:37 -0700)]
And another.