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

55 Commits

Author SHA1 Message Date
Calvin Rose
022be217a2 Remove ==, not==, and order[<,<=,>,>=].
This unifies equality and comparison checking. Before, we had
separate functions and vm opcodes for comparing general values vs.
for comparing numbers, where the numberic functions were polymorphic and
had special cases for handling NaNs. By unfiying them, abstract types
can now better integrate with other number types and behave as keys.

For now, the old functions are aliased but will eventually be removed.
2019-12-28 16:04:15 -05:00
Calvin Rose
f1afc5b0b4 Address #214
This adds several common patterns, which are defined in
boot.janet. This essentially gives more primitive patterns
to work with out of the box.

Fix build when JANET_REDUCED_OS is defined.
2019-12-14 20:39:14 -06:00
Calvin Rose
70c8b6838d Use make-image-dict and load-image-dict in thread/new
Rather than messing with janet_core_dictionary, we
instead cache the core enevironment, and pull out the
needed tables from there. This is more flexible, more correct, and
also exposes janet_resolve_core, which can be easily used from the C
API.
2019-12-02 04:15:22 -06:00
Calvin Rose
6a763aac95 Work on threads.
Add send and receive.
2019-12-01 20:28:12 -06:00
Calvin Rose
bfd3845218 Fix cfunction debugging issue
Cfunction were not describing themselves very well, as
their names were not be added to the registry.
2019-03-27 00:14:51 -04:00
Calvin Rose
94a2084723 Add tostring method for abstract types.
This lets abstract types customize how they
print for debugging.
2019-03-19 13:36:26 -04:00
Calvin Rose
95e54c66b6 Use one tag type true and false
We moved the literals true and false into one tag
type, so we an extra tag for raw pointer types
(light userdata). These can be used from the C API via
janet_wrap_pointer and janet_unwrap_pointer.
2019-03-13 14:50:25 -04:00
Calvin Rose
a363dce943 Allow proper overriding of cfunctions in the core.
Allow overriding functions in the core libray to provide better
functionality on startup. Used to include our getline function in
the repl but use a simpler version in the core library.
2019-03-08 11:39:18 -05:00
Calvin Rose
0382dc976b More code to better integrate with size_t
Typed arrays use proper size_t support in more
places now.
2019-03-08 00:44:26 -05:00
J.-F. Cap
9c1c7fb384 Remove AT id use name as tag 2019-02-24 02:51:34 +01:00
J.-F. Cap
af48912f11 Simplify Abstract type introspection 2019-02-24 02:02:54 +01:00
J.-F. Cap
2becebce92 fix C source format 2019-02-23 17:13:43 +01:00
J.-F. Cap
0cc6c6ff33 implement typed array marshal/unmarshal and
generic marshaling capabilities to abstract types.
2019-02-23 16:58:47 +01:00
J.-F. Cap
7cb1c7cef2 added ta marshalling 2019-02-22 17:41:27 +01:00
J.-F. Cap
db9ac6dba5 marshal buffer ok 2019-02-22 15:57:48 +01:00
J.-F. Cap
59e4b15fad added some abstract type instrospection capabilities
registering abstract type in vm_register table
2019-02-22 10:54:22 +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
J.-F. Cap
86ba69c16b Merge remote-tracking branch 'upstream/master' into crazy-brackets 2019-02-08 23:45:55 +01: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
611543c48b Add source amalgamation
The amalgamated source concatenates all sources
to a file janet.c which can be used for
embedding janet, much in the same way as sqlite
or mongoose.
2019-01-24 00:15:58 -05:00
Calvin Rose
6f3bc3d577 Update copyright date, fix types, remove trailing whitespace. 2019-01-06 03:23:03 -05:00
Calvin Rose
b60e3e302a Update C API to use friendlier functions rather than macros.
Error handling is implemented with setjmp/longjmp so code
can be more concise. This required a very large but straight forward refactor for all
of the libraries.
2019-01-05 20:09:03 -05:00
Calvin Rose
337a498edb Fix some keyword related issues. 2019-01-02 22:08:51 -05:00
Calvin Rose
e9c94598e6 Add native keyword type to replace symbols with leading ':'
character.
2019-01-02 19:41:07 -05:00
Calvin Rose
fe22a8db39 Fix 32 bit platforms janet number handling. 2018-12-30 14:23:52 -05:00
Calvin Rose
d724c5b959 Update number representation so that wrapping numbers isn't
doesn't need to check for NaNs. Change ordering of types.
2018-12-30 12:37:50 -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
e8c0dcd14e Make source mapping use byte offset instead of line and col
for better debugging support in repl. Add debug module for better
debugging support.
2018-12-13 18:46:53 -05:00
Calvin Rose
4d119e4e03 Begin adding more complete documentation. 2018-11-15 15:45:41 -05:00
Calvin Rose
98f2c6feab Add lookups for marshalling and unmarshalling.
Allow generating lookup tables from the current environment.
2018-10-21 01:35:07 -04:00
Calvin Rose
1ba3aeb3cd Make stacktrace part of public API. 2018-09-09 21:20:33 -04:00
Calvin Rose
56c3b8aa94 Add ability to index into structs and dictionaries generically. 2018-09-09 12:13:32 -04:00
Calvin Rose
c8ef2a0d88 Rename to janet 2018-09-05 22:18:42 -04:00
Calvin Rose
75c66ea6dd Refactor native module declarations. marshal can now
serialize entire environment.
2018-08-26 14:35:01 -04:00
Calvin Rose
1b009b4f1f Fix dst_register. 2018-08-22 22:12:47 -04:00
Calvin Rose
510feeed7f Allow marshaling of more functions for core.
Fix indentation in some files.
2018-08-22 21:41:25 -04:00
Calvin Rose
634ec85b07 Fix funcdef flags when marshaling. 2018-08-21 15:07:37 -04:00
Calvin Rose
910cfd7ddf Lots of updates. Function marshaling WIP. 2018-08-19 20:21:27 -04:00
Calvin Rose
547529ebb2 Refactor dst_view_* functions. 2018-07-04 13:21:30 -04:00
Calvin Rose
a018f9f54a Major refactor. Move files around, merge compiler into
core and other changes, work on inlining many c functions.
2018-07-03 23:07:35 -04:00
Calvin Rose
363a17ff8c Convert get, put and length to normal functions, not c functions. 2018-06-17 13:55:02 -04:00
Calvin Rose
0cf10946b0 Add first version of marsh (marshaling). 2018-06-12 14:24:45 -04:00
Calvin Rose
fb409201b4 Strip trailing whitespace from many files.
Add native modules to import with module.native-path.
2018-05-19 21:16:00 -04:00
Calvin Rose
f295692b50 Update copyright to 2018. Add string methods. 2018-05-17 23:41:20 -04:00
Calvin Rose
dafc121f4d Change c function macros to be explicitly non functional by
capitalizing them.
2018-05-12 20:31:28 -04:00
Calvin Rose
181a38f412 Add sqlite3 native module to repo. 2018-05-05 23:51:29 -04:00
Calvin Rose
53f9c18669 More work on improving errors. 2018-04-29 20:13:04 -04:00
Calvin Rose
10934bcfb9 Add errorhandling helper functions and macros for writing c functions. 2018-04-28 18:10:57 -04:00