Commit graph

181 commits

Author SHA1 Message Date
Simon Brooke bd4d655362 Metadata for file streams 2019-01-31 13:24:06 +00:00
Simon Brooke 86319fd1c3 That seems to fix it! 2019-01-30 01:26:41 +00:00
Simon Brooke eb49ca4e2d Improvements to URL metadata collection
Still not perfect - some corruption of data.
2019-01-30 00:32:55 +00:00
Simon Brooke f9bcac10e7 Fixed, working. 2019-01-29 22:36:20 +00:00
Simon Brooke eb394d153f Setting up medatata works...
And the `inspect` function correctly shows it. However, the `metadata` function segfaults.
2019-01-29 18:31:30 +00:00
Simon Brooke a640c9dff9 It works! 2019-01-28 18:46:24 +00:00
Simon Brooke b15c0e8f89 Tactical commit 2019-01-28 15:02:46 +00:00
Simon Brooke 8334e2bf1f Still segfaults on read from URL. 2019-01-28 10:32:34 +00:00
Simon Brooke 3470f27585 Can now read files from the filesystem. 2019-01-27 18:54:23 +00:00
Simon Brooke d9acb277bf Tests now pass
at least, all the ones that did before!
2019-01-27 17:51:28 +00:00
Simon Brooke 0e11adea1c Compiles, most tests break 2019-01-27 17:22:13 +00:00
Simon Brooke b8f241c2c5 Progress, not working 2019-01-27 12:23:51 +00:00
Simon Brooke a355a28ffa Tactical commit whilst converting to URL_FILE 2019-01-24 19:36:00 +00:00
Simon Brooke f8c20ab3b1 Still broken, but I believe we're moving in the right direction. 2019-01-24 10:12:08 +00:00
Simon Brooke bf72ae379d Getting closer. WARNING: GC disabled in this commit. 2019-01-22 09:48:26 +00:00
Simon Brooke 3fd322af6f Major progress, multiply now almost works
There's a premature free() somewhere, and I'm not sure why.

Print depends on divide, which is easy, but also on mod and floor (of rationals) which isn't.
2019-01-21 16:14:25 +00:00
Simon Brooke 64fc43e9fc OK, my idea that long multiplication is like long addition is wrong.
It's still broken, but it's broken because of fundamental misunderstanding which tinkering won't solve.
2019-01-20 23:34:46 +00:00
Simon Brooke 22fa7314d6 Mostly fixing and standardising documentation. 2019-01-20 20:37:44 +00:00
Simon Brooke 0f8bc990f2 Much investigation of bignum problems
bignum multiply is still not working, but as bignum read and bignum divide depend on it, it's the problem to hit first.
2019-01-19 16:28:15 +00:00
Simon Brooke 46a4132823 Made it easier to run individual unit tests 2019-01-18 20:55:03 +00:00
Simon Brooke c209abb4f9 Added unit tests to establish that bignum addition and print work
the bug must be in multiplication.
2019-01-18 13:39:12 +00:00
Simon Brooke 7f93b04b72 Various refactorings around bignum arithmetic 2019-01-17 17:04:14 +00:00
Simon Brooke d624c671cd Major refactoring, all tests still pass
Bignum issues not yet folly resolved.
2019-01-05 11:42:17 +00:00
Simon Brooke 396e214b5f Increased maximum memory allocation 2019-01-04 11:24:05 +00:00
Simon Brooke 67443e1d46 OK, adding bignums works; multiplying bignums does not work.
There's no evidence of a bug in reading/printing, because the only way I can currently get a number big enough to trigger the supposed bug is by multiplying, which doesn't work.
2019-01-04 11:04:55 +00:00
Simon Brooke 67802a07b8 Now successfully reading/printing 2 cell bignums
Something is wrong with n-cell bignums, but let's make haste slowly.
2019-01-04 10:40:15 +00:00
Simon Brooke d9d789fdd0 Now creating the correct internal bignum representation
add_integers returns an integer which by inspection of the internal representation is correct, but the print representation is not correct.
2019-01-03 11:21:08 +00:00
Simon Brooke 4295b6e57f This isn't working, but it's VERY promising. 2019-01-01 15:04:44 +00:00
Simon Brooke 6d2cf313cb Very small fix to formatting integers. 2018-12-31 16:24:38 +00:00
Simon Brooke a02d286ad5 Spotted a bug in car of a stream, and fixed it. 2018-12-31 16:18:39 +00:00
Simon Brooke e5f40032e9 Now safely detecting (but not dealing with) integer overflow.
Also printing and reading integers with comma separators.
2018-12-31 16:15:14 +00:00
Simon Brooke 72ab4af20e Seem to have fixed the 'oblist getting lost' problem. 2018-12-31 14:43:47 +00:00
Simon Brooke e7dffcad2c Not really making progress. 2018-12-30 19:07:07 +00:00
Simon Brooke 02fe5669d8 Complete reworking of the REPL
which is good in itself, but not what I was meant to be working on.
2018-12-30 17:56:15 +00:00
Simon Brooke 47f4b4c7f7 Bug was in integer_to_string; all tests now pass. 2018-12-30 12:07:38 +00:00
Simon Brooke 61573d85d9 /all-integers-are-bignums: broken, but I don't know why. 2018-12-30 11:10:14 +00:00
Simon Brooke 489f008044 Printing of bignums basically done, not tested. 2018-12-29 23:44:28 +00:00
Simon Brooke 342f0308d3 The beginning of bignums is in place, tests still pass. 2018-12-29 22:30:07 +00:00
Simon Brooke c21a762413 Much better GC, still a few things being missed. 2018-12-29 20:34:31 +00:00
Simon Brooke 7b126ea979 Garbage collection now much better, not good
There's clearly still a lot of things getting incremented but not decremented.
2018-12-29 09:35:29 +00:00
Simon Brooke ad806de656 Freeing vector-space objects, apparently good.
Not freeing enough cons-space objects, though!
2018-12-29 08:23:26 +00:00
Simon Brooke 40e1f3ca64 Whitespace only changes 2018-12-29 07:40:01 +00:00
Simon Brooke 8231c74bae Various fixes while trying to make defun! work
It still doesn't, but I think it's VERY close!
2018-12-28 22:41:00 +00:00
Simon Brooke 2d5fc4a202 Upversioned, README updated 2018-12-28 22:36:26 +00:00
Simon Brooke 570634bc43 Success! All tests pass. 2018-12-28 21:33:35 +00:00
Simon Brooke 96dad29f91 Good news: only one test failing. Bad news: it's nlambda. 2018-12-28 21:21:11 +00:00
Simon Brooke e52ccce0eb Much progress! Half the unit tests pass. 2018-12-28 15:50:37 +00:00
Simon Brooke 75abfb4050 Much better debugging, but it still doesn't work 2018-12-27 21:37:38 +00:00
Simon Brooke 3d5c27cb10 Horribly broken, may have to rethink. 2018-12-26 21:10:24 +00:00
Simon Brooke 9937f344dc Major refactoring. Major problems!
On the right path but it doesn't work yet.
2018-12-26 20:30:14 +00:00
Simon Brooke ae8ba67ed7 Better exceptions, investigation on failure to read/print wide chars. 2018-12-25 15:32:53 +00:00
Simon Brooke 9ff2f14c7d Reverse 2018-12-25 14:44:38 +00:00
Simon Brooke 9e5af35aa0 Read negative numbers 2018-12-25 13:51:15 +00:00
Simon Brooke 6ee9f9b59a Begun work on bignums; changed integer size to 64 bits
I'm fairly sure the size of a long int on my machines is 64 bit anyway, but for portability it needs to be explicit.
2018-12-25 13:18:37 +00:00
Simon Brooke ad9b1cd7f8 Ratio arithmetic separated out into its own files. 2018-12-24 21:06:58 +00:00
Simon Brooke a5e1d3ccd8 Reorganised source files to make navigation easier
All tests still pass (slightly to my surprise)
2018-12-24 19:27:04 +00:00
Simon Brooke f6ff403249 Basics of vector space sort of done, but not yet working. 2018-12-24 15:12:17 +00:00
Simon Brooke 7b1cdf4440 Ratio division 2018-12-24 12:32:41 +00:00
Simon Brooke 7e98207f7e Ratio multiplication and subtraction 2018-12-24 10:28:10 +00:00
Simon Brooke d725097f89 Ratio addition working perfectly; all tests pass. 2018-12-23 21:45:24 +00:00
Simon Brooke 813b24406d Ratio addition now works 2018-12-23 20:54:57 +00:00
Simon Brooke 4c9fdfc3db Added ratio numbers
(but some arithmetic is now broken)
2018-12-23 20:02:38 +00:00
Simon Brooke ea1d4ce7ed Doesn't compile, but I have a mess. 2018-12-23 19:23:00 +00:00
Simon Brooke 2c001a5f98 Sorting out what looked like a premature freeing bug.
It wasn't, but in investigating I tightened up allocation and deallocation in frames.
2018-12-23 15:16:53 +00:00
Simon Brooke 71b9a61814 Upversioned to 0.0.3 2018-12-21 21:39:57 +00:00
Simon Brooke 5a84f5e305 Fixed the eval-real test
So that it passes provided the answer is right to within one part in a million. Also worked on a solution to returning exceptions from make_stack_frame
2018-12-21 21:36:37 +00:00
Simon Brooke 7cd2cbf785 Very small progress. 2018-12-20 11:01:13 +00:00
Simon Brooke 637d78fb1b Much work, all I think positive, but defun still doesn't work. 2018-12-18 21:10:03 +00:00
Simon Brooke cec32eff54 Progress, but there's something wrong with nlambdas 2018-12-13 23:20:34 +00:00
Simon Brooke 11409301da Tactical commit before trying adventurous change in peano 2018-12-13 19:23:44 +00:00
Simon Brooke facd5ccc94 Started work on nlambda. It isn't working yet. 2018-12-13 17:08:47 +00:00
Simon Brooke 0550b0168f And now the interpreter works (I think) correctly! 2018-12-13 13:31:04 +00:00
Simon Brooke 676b231743 Interpreter working! 2018-12-12 18:49:05 +00:00
Simon Brooke 7189c0172c Much work on the interpreter, but it is getting messy
Going to try something radically different
2018-12-12 16:20:16 +00:00
Simon Brooke 7d0b6bec97 Colourised print. 2018-12-12 11:48:24 +00:00
Simon Brooke 9bfc9074b0 Improved (for me) formatting on Mac
Don't yet know whether this will work on Linux.
2018-12-08 14:09:57 +00:00
Simon Brooke 27fd678888 Tried to get more sensible printing of floating point numbers
Results are quite disappointing. Resolution on long doubles is nothing like as good as I hoped; they're out by one part in 10^20.

All unit tests except one pass, and the one that doesn't is a very minor rounding issue, so I'm calling it good.
2018-12-08 00:29:05 +00:00
Simon Brooke fc960dec20 Fixed! A stupid error which was entirely my fault 2018-12-07 22:33:59 +00:00
Simon Brooke d620542ee5 Trying to get to the point where make format works the same
on Linux and MacOS
2018-12-07 21:37:31 +00:00
Simon Brooke 93b84087ce There's an enormous lot of good stuff in this, but I've messed up print
almost certainly by writing a non-wide character to a wide stream.
2018-12-07 20:09:33 +00:00
Simon Brooke 7e40d65df0 Fixed misnamed unit test file; upversioned to 0.0.2 2018-12-07 06:51:00 +00:00
Simon Brooke 645ab3674e All unit tests pass. The eval-quote problem is solved. 2018-12-07 06:43:23 +00:00
Simon Brooke fd9c851185 Merge branch 'develop' of github.com:simon-brooke/post-scarcity into develop 2018-12-07 06:39:23 +00:00
Simon Brooke 1307c65e94 And the answer was, eval is a function, not a special form. 2018-12-07 06:32:02 +00:00
Simon Brooke 88fd7d95d9 Added Doxyfile, updated Makefile, reformatted. 2018-12-06 18:12:15 +00:00
Simon Brooke 3112f190db Work on the eval-quote bug. I have a really profound misunderstanding here!
But, in working on it, I've worked hard on documentation, which is good.
2018-12-06 17:55:54 +00:00
Simon Brooke 7f29c11592 Added new unit test for a failing behaviour in eval 2018-12-05 09:33:37 +00:00
simon 01cf08b100 COND working 2017-10-16 14:37:09 +01:00
simon b989b5e041 PROGN working 2017-10-16 12:22:49 +01:00
simon 05854725c8 Upversion to 0.0.1 2017-10-15 18:31:10 +01:00
simon 685790df43 Apply works; all unit tests pass. 2017-10-15 18:27:55 +01:00
simon 8e7d1ab913 More work on apply, also trying to read dotted pairs. 2017-10-15 17:01:03 +01:00
Simon Brooke 89b4f093f9 Fixed bug which caused reader to infinite loop if symbol contained non-alnum. 2017-10-15 15:14:34 +01:00
Simon Brooke 0685442e1a Tidied up 'wide' printing. 2017-10-15 14:31:57 +01:00
Simon Brooke ba4a31c25a All tests passing except 'apply', which is genuinely broken; I'm not yet sure
what's wrong.
2017-10-15 14:17:54 +01:00
Simon Brooke 3e8e621fdd Merge remote-tracking branch 'refs/remotes/origin/develop'
Conflicts:
	src/consspaceobject.h
2017-10-06 18:28:14 +01:00
simon 0e224e551b EVAL on arithmetic operations still not working 2017-10-06 18:27:01 +01:00
Simon Brooke 77393b70ad Fix build bugs 2017-09-25 13:34:46 +01:00
Simon Brooke b713c1822d WArning! this doesn't even build! Half way through reworking eval. 2017-09-17 20:18:15 +01:00
simon cf1b09c62a Bug in reading reals. 2017-09-17 11:29:49 +01:00