Andrew Chambers
f2e8691ad5
Fix init race for environ lock.
2021-08-09 14:47:41 +12:00
Calvin Rose
a78cbd91da
Address #753 - fix gensym regression.
2021-08-06 16:25:53 -05:00
Damien Ready
934e091410
Note "int" vs "double" representation of seconds
2021-07-31 11:02:48 -05:00
Calvin Rose
7f7ee75954
Patch util.c
2021-07-31 10:00:43 -05:00
Calvin Rose
e76b8da269
Add semantics for closing channels.
...
This makes certain algorithms simpler as channels
now have an explicit lifetime - multiple readers can coordinate
closing without needing to ensure the same number of reads as writes.
2021-07-30 19:26:42 -05:00
Calvin Rose
7e5f226480
Put source mapping info in stack traces.
2021-07-29 21:29:08 -05:00
Calvin Rose
2f634184f0
Merge branch 'master' of github.com:janet-lang/janet
2021-07-28 21:41:34 -05:00
Calvin Rose
e3e01466ee
Merge pull request #741 from sogaiu/remove-duplicate-method
...
Remove duplicate of method recv-from
2021-07-28 20:35:33 -05:00
sogaiu
025918cfcc
Remove duplicate of method recv-from
2021-07-28 14:44:49 +09:00
Calvin Rose
28fb76e602
Merge pull request #740 from yumaikas/hotfix-new-style-math-bindings
...
Fix macro stringification for one-arg math functions
2021-07-27 23:56:16 -05:00
Andrew Owen
b0f97393a3
Fix macro stringification for one-arg math functions
2021-07-27 21:40:25 -06:00
Calvin Rose
2a7041e751
Merge pull request #739 from sogaiu/new-style-core-fn-decl-for-array
...
Update array.c with new style core function declarations
2021-07-27 22:37:35 -05:00
sogaiu
eed158afdd
Merge branch 'janet-lang:master' into new-style-core-fn-decl-for-array
2021-07-28 10:24:11 +09:00
Andrew Owen
1c7505e04a
Merge branch 'master' into new-style-math-bindings
2021-07-27 19:19:39 -06:00
Calvin Rose
617da24942
Merge pull request #726 from yumaikas/new-style-ev-bindings
...
Update ev.c to use the new binding style that provides source information
2021-07-27 20:17:19 -05:00
Andrew Owen
98bdbfd3d5
Add JANET_DEF and co, use in math.c
2021-07-27 19:13:09 -06:00
Andrew Owen
aabae03305
Add rselect bindings
2021-07-27 00:48:28 -06:00
sogaiu
194d645551
Update array.c with new style core function declarations.
2021-07-27 15:34:12 +09:00
Calvin Rose
889d6f9e43
Merge pull request #737 from sogaiu/new-style-core-fn-decl-for-corelib
...
Update corelib.c with new style core function declarations.
2021-07-26 22:07:17 -05:00
Calvin Rose
151de093d0
Merge pull request #736 from sogaiu/new-style-core-fn-decl-for-debug
...
Update debug.c with new style core function declarations.
2021-07-26 22:06:17 -05:00
sogaiu
7492a4c871
Update buffer.c with new style core function declarations.
2021-07-27 11:34:03 +09:00
sogaiu
d20543b92c
Update corelib.c with new style core function declarations.
2021-07-27 11:18:54 +09:00
sogaiu
59aab2ebbd
Update debug.c with new style core function declarations.
2021-07-27 08:01:56 +09:00
Calvin Rose
08f7b1b9e5
Run the formatter.
2021-07-26 17:54:26 -05:00
Calvin Rose
f2ac1c15e6
Merge pull request #735 from sogaiu/new-style-core-fn-decl-for-fiber
...
Update fiber.c with new style core function declarations.
2021-07-26 17:36:54 -05:00
Calvin Rose
eaf8f198c1
Merge pull request #733 from sogaiu/new-style-core-fn-decl-for-io
...
Update io.c with new style core function declarations.
2021-07-26 17:36:37 -05:00
sogaiu
2955286606
Update fiber.c with new style core function declarations.
2021-07-27 07:00:59 +09:00
Calvin Rose
4f00a7db88
Merge pull request #729 from sogaiu/new-style-core-fn-decl-for-os
...
Update os.c with new style core function declarations.
2021-07-26 15:21:15 -05:00
Calvin Rose
acc21d0b76
Merge pull request #724 from sogaiu/new-style-core-fn-decl-for-thread
...
Update thread.c with new style core function declarations.
2021-07-26 15:19:19 -05:00
Calvin Rose
db5df70d0c
Merge pull request #727 from sogaiu/new-style-core-fn-decl-for-string
...
Update string.c with new style core function declarations.
2021-07-26 15:19:07 -05:00
sogaiu
92c132381e
Update inttypes.c with new style core function declarations.
2021-07-26 21:52:02 +09:00
sogaiu
d0575e4087
Update io.c with new style core function declarations.
2021-07-26 21:39:13 +09:00
Calvin Rose
5ca48b96af
Merge pull request #728 from sogaiu/new-style-core-fn-decl-for-parse
...
Update parse.c with new style core function declarations.
2021-07-26 07:22:46 -05:00
Calvin Rose
2a9f30fc8a
Merge pull request #725 from sogaiu/new-style-core-fn-decl-for-table
...
Update table.c with new style core function declarations.
2021-07-26 07:16:28 -05:00
Calvin Rose
ba89a81a3e
Merge pull request #731 from sogaiu/new-style-core-fn-decl-for-net
...
Update net.c with new style core function declarations.
2021-07-26 07:11:15 -05:00
sogaiu
15b4d9363b
Update marsh.c with new style core function declarations.
2021-07-26 18:29:59 +09:00
sogaiu
ceca0e7f0e
Update net.c with new style core function declarations.
2021-07-26 18:20:06 +09:00
Andrew Owen
700770b883
Update math.c for the new style
2021-07-26 01:51:13 -06:00
sogaiu
8365037be5
Update os.c with new style core function declarations.
2021-07-26 16:48:04 +09:00
sogaiu
dfaba7daa6
Update parse.c with new style core function declarations.
2021-07-26 15:42:33 +09:00
sogaiu
5756934144
Update string.c with new style core function declarations.
2021-07-26 15:23:04 +09:00
Andrew Owen
7b3ab2727f
Fix copy/paste mistake in ev/take docs
2021-07-26 00:11:05 -06:00
Andrew Owen
714ba808dd
Update ev.c to use the new binding style that provides source information
2021-07-25 23:25:38 -06:00
sogaiu
6e94e03baa
Update table.c with new style core function declarations.
2021-07-26 14:03:01 +09:00
sogaiu
ac98dbccb8
Update thread.c with new style core function declarations.
2021-07-26 13:46:31 +09:00
Calvin Rose
6e3355d7f2
Merge pull request #723 from sogaiu/new-style-core-fn-decl-for-tuple
...
Update tuple.c with new style core function declarations.
2021-07-25 22:41:42 -05:00
Calvin Rose
97907906c5
Merge pull request #722 from sogaiu/new-style-core-fn-decl-for-compile
...
Update compile.c with new style core function declarations.
2021-07-25 22:41:11 -05:00
Calvin Rose
eb84200f28
Fix linux issues with epoll on normal files.
...
We use the selfpipe trick if epoll fails with EPERM when trying to
register a file descriptor.
2021-07-25 21:47:52 -05:00
sogaiu
caaa26e153
Update tuple.c with new style core function declarations.
2021-07-26 11:33:46 +09:00
sogaiu
dccb98bb92
Update compile.c with new style core function declarations.
2021-07-26 09:07:53 +09:00
bakpakin
cc07b4a89a
Merge branch 'master' of github.com:janet-lang/janet
2021-07-25 14:54:45 -05:00
bakpakin
7e8154e648
Update peg.c with new style core function declarations.
2021-07-25 14:54:25 -05:00
Calvin Rose
dfee997e45
Merge pull request #718 from uvtc/patch-1
...
Add some clarifying backticks to docs
2021-07-25 14:10:44 -05:00
bakpakin
7fba44ccce
Add macro mechanism for defining C source information for functions.
...
This wil let us track source code for C functions more easily.
2021-07-25 13:03:01 -05:00
bakpakin
6f1695ecd4
Add utitities for interrupting the event loop.
...
janet_loop1_interrupt makes the event loop compatible
with safe interruptions for custom scheduling. Does this by exposing
custom events on the event loop. A custom event schedules a function pointer
to run in a way that can interrupt
epoll_wait/poll/GetQueuedCompletionStatus.
2021-07-25 09:08:46 -05:00
John Gabriele
2769a62bb3
Add some clarifying backticks to docs
2021-07-24 16:58:21 -04:00
bakpakin
160dd830a0
Add janet_interpreter_interrupt for custom scheduling.
...
This would allow an embedder to suspend the current Janet fiber
via an external event like a signal, other thread, or really anything.
This is a useful primitive for custom schedulers that would call
janet_interpreter_interupt periodically (say, in an interval with SIG_ALRM),
do some work, and then use janet_continue on the janet_root_fiber, or
for embedding into other soft-realtime applications like a game. To say,
only allow about 5ms per frame of interpreter time.
2021-07-24 15:14:37 -05:00
bakpakin
aafc595e3a
Fix typo.
2021-07-24 12:47:51 -05:00
bakpakin
202783c67a
Add :d switch to os/spawn.
...
This allows for starting processes that can be turned into zombies.
2021-07-24 11:55:04 -05:00
Calvin Rose
f11b2c5a0d
Merge pull request #717 from yumaikas/fix-os-open-write-windows
...
Fix os open write windows, and add TerminateProcess calls
2021-07-24 07:52:40 -05:00
Andrew Owen
e8a86013da
Add fixes for :write on filestreams that come from os/open
2021-07-24 02:30:00 -06:00
Calvin Rose
2e58f5f0d4
Add table/clear.
2021-07-21 19:58:42 -05:00
Calvin Rose
e7ea39f410
Prevent possible bad garbage collection when finalizing streams.
...
The GC finalizer for streams would sometimes try and use other objects
after they had already been freed.
2021-07-20 19:42:35 -05:00
Calvin Rose
a125218d03
Move some defines.
2021-07-20 18:24:56 -05:00
Calvin Rose
55b8563c08
Add janet_loop_fiber C function to run a fiber to completion from C.
...
This is mainly meant for use as the entry point to a C wrapper for a
janet program. This maeans the programmer doesn't need to use an ifdef
to handle if the event loop is enabled.
2021-07-18 09:39:37 -05:00
Calvin Rose
aea1f59f6e
Add option to build janet without thread library.
2021-07-17 15:13:28 -05:00
Calvin Rose
ab27b789e4
Fix minimal build.
2021-07-17 13:10:55 -05:00
Calvin Rose
3a1a59f1eb
Address windows build issue.
2021-07-16 21:10:02 -05:00
Calvin Rose
1ef6db16ed
Add janet_vm_save and janet_vm_load.
...
This lets a user multiplex multiple Janet VMs on a single
thread or process if they are willing to implement context switching
themselves.
2021-07-16 20:59:03 -05:00
Calvin Rose
dc414f1239
Merge pull request #713 from yumaikas/fix-process-terminate-windows
...
Add TerminateProcess to janet_proc_gc and os_proc_kill on Windows
2021-07-11 09:30:07 -04:00
Andrew Owen
12cfda1f58
Add TerminateProcess to janet_proc_gc and os_proc_kill on Windows
2021-07-11 04:05:11 -06:00
Andrew Owen
96b4e71704
Add TerminateProcess to janet_proc_gc and os_proc_kill on Windows
2021-07-11 03:56:08 -06:00
sogaiu
edb415d1a8
Tweak function name
2021-07-11 12:27:15 +09:00
Calvin Rose
72c1d1c484
Fix some error condiditions to have the right number of arguments.
2021-07-10 14:09:59 -04:00
Calvin Rose
5defc3b914
Fix bug with ev/go when passing supervisor and value.
...
value was incorrectly set to nil in these cases. Also
fix some typos in core docstrings.
2021-06-25 18:58:19 -05:00
Calvin Rose
4b96b73858
Add -w and -x flags to janet for linting.
2021-05-31 14:36:25 -05:00
Calvin Rose
bbae43f259
Update copyright dates.
2021-05-31 13:46:02 -05:00
Calvin Rose
60214dc659
Update for windows compiler warning.
2021-05-30 16:42:58 -05:00
Calvin Rose
d204e06e11
Use lint information in run-context.
2021-05-30 10:33:46 -05:00
Calvin Rose
f6b37dbc77
Merge branch 'master' into linting
2021-05-30 09:34:32 -05:00
Calvin Rose
1f4f69a5b6
Fix windows syntax issue.
2021-05-29 20:40:26 -05:00
Calvin Rose
c911f7c47e
Address #694 - Update doc-format with more features.
...
Also allows having doc-format print in color with
(dyn :doc-color).
2021-05-29 20:34:22 -05:00
Calvin Rose
33c000daea
Expose linting array to macros.
...
This has a lot of possible uses, and would let users add a macro-based
type system on top of Janet that would integrate with the usual linting
and warning system.
2021-05-28 15:15:34 -05:00
Calvin Rose
7ff204ec44
Work on system for adding compiler warnings.
...
This is the beginning of a system for compiler warnings. This includes
linting, deprecation notices, and other compiler warnings that are best
detected by the `compile` function and don't require the partial
evalutaion of the flychecker.
2021-05-28 15:12:05 -05:00
Calvin Rose
2db7945d6f
Fix peg bug when there is no default grammar set.
...
This could result in a segfault when we attempt to
read from a NULL pointer.
2021-05-20 21:57:22 -05:00
Calvin Rose
49f66a936c
Merge commit 'f4c9064b79d5b32fd74e5ddf25266356c22dd53b'
2021-04-29 15:58:41 -05:00
Calvin Rose
cbe92bb985
Merge branch 'master' of github.com:janet-lang/janet
2021-04-29 13:13:55 -05:00
Calvin Rose
1baab5eb61
Remove typed arrays from the core.
...
Typed arrays will instead live in an external jpm nodule.
Also, changes have been made to `jpm` to allow other natives to use the
typedarray headers.
2021-04-29 12:33:49 -05:00
Chris Jones
29797b9eb0
Use _NSGetEnviron() on Apple
2021-04-27 11:54:24 +01:00
Calvin Rose
7b7d742bec
Add declare-headers to jpm.
2021-04-25 13:38:24 -05:00
Calvin Rose
612eaff9ff
Fix #682 - Don't hardcode size of sun_path.
2021-04-15 14:57:40 -05:00
Calvin Rose
cde4a505cf
Fix #673 - check typed array index bounds as well as buffer count.
2021-03-30 21:14:42 -05:00
Calvin Rose
3a3003029a
Merge branch 'master' of github.com:janet-lang/janet
2021-03-26 15:44:43 -05:00
Calvin Rose
7c7ff802fa
Add net/shutdown to allow better networking with streams.
2021-03-26 15:36:25 -05:00
Michael Camilleri
ec2d7bf349
Support adding arbitrary metadata to bindings
2021-03-24 09:38:12 +09:00
Andrew Chambers
f4c9064b79
Add config support for custom allocators.
2021-03-23 23:00:48 +13:00
Calvin Rose
90e5828d5d
Update printing when entering debugger.
2021-03-19 15:38:46 -05:00
Calvin Rose
b3e80308d4
Change inheritance rule.
2021-03-19 15:18:19 -05:00
Calvin Rose
3c63a48df4
( #667 ) Add constant inlining for tuples and structs.
...
Structs and tuples composed entirely out of constant values
will themselves be considered constant values during compilation.
This reduces the amount of generated code.
2021-03-16 20:52:55 -05:00
Calvin Rose
e70f64e23d
Sort keys initial.
2021-03-13 19:17:07 -06:00