Calvin Rose
115bc6140b
Fix NULL ptr issue.
2019-02-22 17:12:34 -05:00
Calvin Rose
b14fcb068b
Update janet_pcall interface
...
The programmer can now not only get the used fiber, but
provide a fiber to reuse if many calls are made in succession.
2019-02-22 17:10:24 -05:00
Calvin Rose
2ea28f29b0
Shut up some warnings from clang's static analyzer.
...
Not particularly useful actually, by and large false positives.
2019-02-22 12:10:27 -05:00
Calvin Rose
9d60e8b343
Address issue #54
...
Bug when marshalling function environments that were still on a fiber
stack.
2019-02-22 10:16:32 -05:00
Calvin Rose
340a6c4d8d
Update marsh.c to use janet_panic for errors.
...
Before, we used a local setjmp/longjmp for error handling.
Using janet_panic means errors can be more easily expressive and
code can be smaller.
However, we still need to make vector memory get gc collected, as
panics can cause the runtime to skip janet_v_frees.
2019-02-22 10:12:25 -05:00
Calvin Rose
beed839d12
Remove the callable? predicate.
...
Many times are callable now in some circumstances, so
the predicate is not that useful.
2019-02-21 20:38:22 -05:00
Calvin Rose
1147482e62
Address #53 - marshalling fiber strangeness
...
The unmarshaller was not tracking fibers in references.
2019-02-21 19:11:28 -05:00
Calvin Rose
8cff3dd2c3
Fix one more warning.
2019-02-21 11:46:39 -05:00
Calvin Rose
df550efb6b
Fix MSVC compiler warnings.
2019-02-21 11:34:04 -05:00
Calvin Rose
00a47dc0cb
Begin work on new memory layout for all objects and GC.
...
The layout should actually be very similar to the old layout, but
the code will be much easier to change and should be more portable.
2019-02-21 11:22:29 -05:00
Calvin Rose
811b1825cb
Remove tuple/append and tuple/prepend.
...
Use the splice special instead.
2019-02-20 21:08:54 -05:00
Calvin Rose
a982f351d7
Address #50
...
Issues with range when called with 3 arguments.
2019-02-20 12:07:20 -05:00
Calvin Rose
27a274b686
Update some corelib functions.
...
Some corelib functions that were created via janet_quickasm
were missing some flags for arity checking, so they were marked as
accepting any arity.
2019-02-19 23:41:16 -05:00
Calvin Rose
cb002e7b84
Update generating tools to produce stylish code.
...
Really small whitespace changes in generated code.
2019-02-19 21:28:22 -05: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
Dan Skorupski
ef5f80ad38
Fix indentation, converting some tabs to spaces.
2019-02-19 17:54:13 -06:00
Calvin Rose
dbcbb4466d
We don't need to add module/\*headerpath\*.
...
We can just dump janet.h into the lib folder as well.
2019-02-18 22:25:40 -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
8d9a88e759
Add JANET_PATH back in.
2019-02-18 15:31:15 -05:00
Calvin Rose
6af5800d21
Add -m option to command line
...
The -m option set the default system path for finding libraries
for that invocation of Janet.
2019-02-18 15:11:59 -05:00
Calvin Rose
540b326c54
Simpler way to set JANET_PATH at compile time.
2019-02-18 14:48:29 -05:00
Calvin Rose
660a2b41ae
Set module/*syspath*
to JANET_PATH at build time
...
The takes out the hardcoded reference to /usr/local/
2019-02-18 14:31:23 -05:00
Calvin Rose
07912f5ab2
Update comments in strtod.c
2019-02-17 21:44:58 -05:00
Calvin Rose
ffc14f6019
Oops, peg option issue fixed.
2019-02-17 21:25:30 -05:00
Calvin Rose
1e70c97ef0
Allow enabling/disabling of peg module.
...
Use compiler define -DJANET_NO_PEG to turn off the peg module.
2019-02-17 21:22:03 -05:00
Calvin Rose
6d5ff43de7
Make amalg build cleaner.
...
Don't pull in a global header <janet/janet.h> unless we need to.
2019-02-16 23:33:24 -05:00
Calvin Rose
3b6ff3c09a
Add -c option to main client
...
This allows compile janet source modules to images.
2019-02-16 21:55:53 -05:00
Calvin Rose
0ce5acec89
Begin cleaning up string API.
...
Remove string/pretty in favor of buffer/format and string/format. Also
drop string/number, which is more verbose and less flexible than
string/format.
2019-02-16 15:12:34 -05:00
Calvin Rose
44e31cac5d
Merge pull request #40 from jfcap/string-format
...
string/format
2019-02-16 15:02:47 -05:00
Calvin Rose
029394db31
Add buffer/format as well as string/format.
...
buffer/format uses the old string/format behavior. `string/format` no
longer requires a buffer, and returns a string.
2019-02-16 13:59:38 -05:00
Calvin Rose
00020ba8ab
Whitspace and style changes.
2019-02-16 13:40:51 -05:00
Calvin Rose
1f91ee30fe
Make require simpler and module/find more useful.
...
This replaces a lot of the functionality in require by moving
it to module/find. module/native-paths and module/image-paths are also
merged into the one module/paths to make it easier to extend. This of
course breaks some of the less important API - module/native-paths no
longer exists.
2019-02-16 13:21:29 -05:00
J.-F. Cap
a6f022a73d
Added string/format function (snprintf like)
2019-02-16 03:29:04 +01:00
Calvin Rose
2e1ec3700d
Fix compilier warning on -Os, gcc.
2019-02-15 19:01:47 -05:00
Calvin Rose
9e6b1d1b16
Add images.
...
Images are precompiled libraries. They can be created programmatically
via the `write-image` function and then loaded with `require` or
`import`. They can also be run by the command line tool - you must
specify the path to the image without the .jimage extension.
2019-02-15 18:56:41 -05:00
Calvin Rose
bdf03b4706
Fix unmarshalling integers directly, not through readint.
2019-02-15 14:01:32 -05:00
Calvin Rose
4d96ba3ba9
Merge branch 'master' of github.com:janet-lang/janet
2019-02-15 13:21:00 -05:00
Calvin Rose
f161002390
Address #35
2019-02-15 13:20:20 -05:00
J.-F. Cap
e0d26629e0
Fix buffer (and string) used as callee for indexing.
2019-02-12 23:40:59 +01:00
Calvin Rose
17783c3c3e
Add tuple/brackets
...
Fix macro expansion via macex for bracketed tuples.
2019-02-11 18:37:59 -05:00
Calvin Rose
c64e92a5de
Add some unused math functions.
...
Several functions from the C math library were
forgotten in the math module. These have been
added to the core library.
2019-02-10 12:03:22 -05:00
J.-F. Cap
c6672e62ac
Added math/abs binding
2019-02-10 14:06:10 +01:00
Calvin Rose
c6edf03ae8
Fix some code style, add tuple/type function.
...
We need to be able to detect tuple type from janet code, otherwise
tuples will contain hidden state. The tuple/type function is able
to detect the flags in the tuple so the programmer can access them
if needed.
2019-02-09 12:21:11 -05:00
J.-F. Cap
5020a1bae9
Added marshalling code to save tuple_flag
2019-02-09 17:00:35 +01:00
J.-F. Cap
86ba69c16b
Merge remote-tracking branch 'upstream/master' into crazy-brackets
2019-02-08 23:45:55 +01:00
J.-F. Cap
5f70024f87
Experimental stuffs with bracket syntax
2019-02-08 21:49:28 +01:00
Calvin Rose
114a45306d
Add more specialization for marshaling integers.
...
This decreases the core image size by about 16.5k.
2019-02-08 10:14:36 -05:00
Calvin Rose
fe27df528c
Boot core library from image rather than source
...
This should speed up start time and reduce malloc/free
usage to about 15% of what is what previously for startup.
The current cost is slightly larger binary as the representaion
of the image is currently less compact than source code.
2019-02-08 00:44:30 -05:00
J.-F. Cap
8ab60e475a
typo in janet_indexed_view
...
(no consequence but look strange)
2019-02-08 01:10:07 +01:00
Calvin Rose
6321c30cb1
Add methods for file io.
2019-02-06 17:58:27 -05:00