1
0
mirror of https://github.com/janet-lang/janet synced 2024-06-28 08:03:16 +00:00
Commit Graph

108 Commits

Author SHA1 Message Date
Calvin Rose
6d096551f0 Add Peg combinators 'to' and 'thru'.
Inpsired by the REBOL operators of the same name, these
combinators match bytes up to or inculding a given pattern.
(to patt) is (almost) equalivalent to (any (if-not patt 1)), and
(thru patt) is equivalent to (* (to patt) patt). The one difference
is that if the end of the input is reached and patt is not
matched, the entire pattern does not match.
2020-06-10 21:18:50 -05:00
Leaf Garland
6909d9c9c9 Fix c code for latest Janet 2020-05-24 21:30:23 +12:00
Leaf Garland
0d5d820f4f Remove cook code 2020-05-24 21:29:20 +12:00
Leaf Garland
6fbca3416a Move tests to tests dir 2020-05-24 21:28:16 +12:00
Leaf Garland
466d9b31ce Add project.janet for numarray 2020-05-24 21:25:52 +12:00
Calvin Rose
596111c988 Merge branch 'master' into net 2020-04-17 15:08:26 -05:00
Calvin Rose
e1f4cadf41 Add debugger to the core repl.
Debugger functions are prefixed by periods.
2020-04-10 17:20:23 -05:00
Calvin Rose
f4a46ba6ea Add methods to streams.
This makes streams polymorphic with files in many cases.
printf family functions still need porting.
2020-02-12 09:32:41 -06:00
Calvin Rose
f4d7fd97f6 Working TCP echo server and client.
Required a few changes to APIs, namely janet_root_fiber()
to get topmost fiber that is active in the current scheduler.
This is distinct from janet_current_fiber(), which gets the bottom
most fiber in the fiber stack - it might have a parent, and so cannot
be reliably resumed.
This is the kind of situation that makes symmetric coroutines more
attractive.
2020-02-09 20:00:50 -06:00
Calvin Rose
6a39c4b91d Pass thread body explicitly in thread/new.
Doing it via thread/send make sense, but is a bit
strange. Passing the body explicitly will make more
sense to API users.
2019-12-18 15:07:46 -05:00
Calvin Rose
8cc43ad2d1 Fix debugger example. 2019-12-17 23:06:41 -06:00
Calvin Rose
eb1c21b0da Fix some example issue and warnings under -Os. 2019-12-08 12:40:05 -06:00
Calvin Rose
131733549d Get mailbox API working. 2019-12-07 16:51:00 -06:00
Calvin Rose
0e690b4fa0 Add timeout to thread/receive.
If provided, throws an error if no message is received before
timeout. Perhaps should return nil?.
2019-12-06 09:21:36 -06:00
Calvin Rose
c804ae9f7c Update threads.c to avoid a deadlock. 2019-12-06 01:46:23 -06:00
Calvin Rose
e908029392 Work on thread/receive doubling as select. 2019-12-04 22:31:01 -06:00
Calvin Rose
de6c3d6d70 Simplify structure JanetThread and JanetChannel.
Remove JanetThreadShared.
2019-12-04 21:04:43 -06:00
Calvin Rose
474bcd50a1 Add methods to threads. 2019-12-02 04:39:13 -06:00
Calvin Rose
212479188a Have separate encode and decode dicts for threads
This is more correct and mirrors the way marshal -> unmarshal works.
2019-12-01 21:53:39 -06:00
Calvin Rose
8f31a53276 Add thread example.
Also remove reference to pthread_t in the JanetThread structure.
2019-12-01 20:47:22 -06:00
Calvin Rose
7df0ec6aed Fix up debug/step and janet_step.
Also allow debugging on all signals, including errors.
This is gated behind (setdyn :debug true) in the repl.
2019-11-25 20:00:13 -06:00
Calvin Rose
a0a980e0ef Update sample debugger.
Add .break and .step.
2019-11-25 18:21:53 -06:00
Calvin Rose
6988fd3cab Add debug/step to single step a fiber.
Very useful for implementing debuggers.
2019-11-25 18:14:34 -06:00
Calvin Rose
d37c43716a Lots of work on improving debugging.
doc macro can take no arguments and print out
all bindings. Fix an issues with the vm skipping
over a breakpoint in some situations.

Add examples/debugger.janet for proof of concept
debugger.
2019-11-24 17:45:53 -06:00
Calvin Rose
02fc4ae27b Allow seeding RNG with a byte sequence. 2019-11-21 22:53:39 -06:00
Calvin Rose
11998b3913 Remove resolver element in path tuple.
Try to simplify module/paths back to how it used to be.
2019-05-25 17:27:56 -04:00
Calvin Rose
840610facf Add urlloader example.
Demonstrate loading files from URL.
2019-05-25 17:10:25 -04:00
Vedor Vidurakis
0aa2f68793 Primes example fixed
It was failing due to unknown symbol "string/pretty"; (pp (primes 100)) works properly.
2019-05-16 12:03:54 +02:00
Calvin Rose
9100794cea Drop leading and trailing newlines in longstrings.
Long, heredoc style strings can now have
a non semantic leading newline character. This makes it
easier to define large columns of text.
2019-04-21 13:34:41 -04:00
Calvin Rose
2d7df6b78e Many changes for adding dynamic (fiber-level) scope.
- Allow passing a table to fibers, which make fiber level scope easier.
- Add fiber/getenv, fiber/setenv, dyn, and setdyn
- Remove meta, *env*, and *doc-width*
- Some functions changed dignatures, and no longer take an env
2019-04-16 15:41:45 -04:00
Calvin Rose
1e299632e4 Fix example. 2019-03-21 14:32:08 -04:00
Calvin Rose
172261b89f Add a test-install target to the Makefile
This target will be used to check if an installation
of Janet is on the PATH, if native modules can be built
and used via the cook module, etc.
2019-03-03 14:48:17 -05:00
J.-F. Cap
fb5119bf43 Added some tests (suite 5) 2019-02-25 18:49:04 +01:00
J.-F. Cap
febfefa4b2 Added tarray/slice and fix buffer size 2019-02-25 02:21:10 +01:00
J.-F. Cap
0eae75a5c2 added MARSH_EOS check 2019-02-24 18:45:14 +01:00
J.-F. Cap
1d50fd9485 First exeperiments with JS style Binary Typed Arrays 2019-02-21 00:15:48 +01:00
Calvin Rose
9d4effc02e Add make format to format code.
A consistent style should help with contributors and
readability. We use astyle as the formatter as can make a pretty
good approximation of the current style and my preferred style.

Astyle can be found at http://astyle.sourceforge.net/astyle.html
2019-02-19 20:51:34 -05:00
Calvin Rose
ed72dcf82d Rename the header <janet/janet.h> to <janet.h>
Makes it easier to use and remember, and makes the
variable `module/*headerpath*` make more sense.
2019-02-18 20:13:35 -05:00
Calvin Rose
33087fe9de Update game of life example. 2019-02-17 11:20:24 -05:00
Calvin Rose
8343c9edd1 Update example to use API. 2019-02-05 19:49:10 -05:00
Calvin Rose
74e1a3273f Add method syntax to parser. 2019-02-05 19:43:41 -05:00
Calvin Rose
1394dbbd57 Update license to include contributors.
Use 4 spaces for indentation.
2019-02-05 19:11:43 -05:00
J.-F. Cap
49465f71f3 Added a simple C module to test getter/setter. 2019-02-05 18:45:04 +01:00
Calvin Rose
d64a57297d Update examples, add method like semantics to calling keywords. 2019-01-07 14:47:47 -05:00
Calvin Rose
eae4e0dede Add functionality that allows the set macro to
take a tuple as an l-value. Remove the old
multi-sym report in anticipation of a different
mechanism.
2019-01-06 19:33:27 -05:00
Calvin Rose
6b95326d7c First commit removing the integer number type. This should
remove some complexity and unexpected behavior around numbers in
general as all numbers are the same number type, IEEE 754 double
precision numbers. Also update examples and tests, some of which were
out of date.

Some more testing may be needed for new changes to numbers.
2018-12-27 13:05:29 -05:00
Calvin Rose
cc5b4eac0a Update documentation, fix life example. 2018-12-17 21:28:45 -05:00
Calvin Rose
03dbd79165 Rename the := special form to set so it does not look like a keyword. 2018-12-16 21:57:32 -05:00
Calvin Rose
696866ae51 Add textmate syntax highlighting file. 2018-12-16 17:59:16 -05:00
Calvin Rose
34a69d0318 Add janet logo,mMove some lib files to example. 2018-12-11 18:06:10 -05:00