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

43 Commits

Author SHA1 Message Date
Calvin Rose
7b31a87b3c Update integer limits and printing. 2020-07-03 14:14:59 -05:00
Calvin Rose
6ea530cc48 Address compilation warnings and errors. 2020-07-03 12:25:24 -05:00
Calvin Rose
b89f0fac7b Move clock shims to util (Helps #430).
The thread module should also use these clock shims rather
than clock_gettime, which is not available on older mac systems.
2020-07-03 09:54:58 -05:00
Calvin Rose
b1f76139a7 Add several configurable options - #379 2020-05-09 12:00:01 -05:00
Calvin Rose
4a693222b4 Port net code to windows.
Use winsock2 and WSAPoll. Not the most high performance
solution but should work well.
2020-04-18 19:14:38 -04:00
Calvin Rose
eda61455d3 Work on tcp server code. 2020-02-03 09:29:51 -06:00
Calvin Rose
c0d2140d14 Begin net/ module in core.
Humble beginnings.
2020-02-01 20:39:54 -06:00
Calvin Rose
333ae7c4f8 Make amalgamtion the default when building.
This way we can support fewer build configurations. Also, remove
all undefined behavior due to use of memcpy with NULL pointers. GCC
was exploiting this to remove NULL checks in some builds.
2020-01-28 23:38:52 -06:00
Calvin Rose
a68ee7aac6 Update Copyright 2020. 2020-01-12 10:50:37 -06:00
Calvin Rose
9dd152dc28 Add features.h for feature test macros.
Because we use an amalgated build, feature
test macros should be set in a single file that
is included before any other headers, and is placed
at the top of the amalgamated build.
2019-12-30 19:06:15 -05:00
Calvin Rose
2ba4337e6f Remove all feature test macros from janet.h
This should help improve compatibility with other C code.
2019-12-30 15:12:17 -05:00
Calvin Rose
407d8af026 Address #233
Move _POSIX_C_SOURCE to internal header.
2019-12-30 12:31:26 -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
bca0392738 First work on threading.
Posix only, needs to be disabled on windows. Also
the Makefile needs to be configurable, and meson.build
needs to take pthreads into account.
2019-11-26 23:13:53 -06:00
Calvin Rose
46950a8cb3 Convert os/execute to use posix_spawn. 2019-05-30 18:40:10 -04:00
Calvin Rose
31f502b508 Add more to util.h to help with amalg build. 2019-05-29 12:07:53 -04:00
Calvin Rose
f10028d41a Add function versions of macro API bindings.
This should help address #81. Also hide janet_exit
and janet_assert, as they are really meant for internal usage.
I have not verified that this yet actually works with Rust's
bindgen.
2019-04-27 15:47:12 -04:00
Calvin Rose
2c9195b507 More updates to meson
Redo amalg script so we can more easily run
it from Meson.
2019-03-23 13:50:50 -04:00
Calvin Rose
bad040665f Renamed bigint -> inttypes / int
A lot of refactoring larger integer types. Fix a number
of casting errors, but mostly rename things. Also try to
limit use of template-like macros as they bloat the binary
if not used in moderation. We were able to reduce the size of
typed array code as well by using a single view types.
2019-03-18 18:36:53 -07:00
J.-F. Cap
d29e3a1199 first experiment with bigint 2019-03-18 18:36:53 -07:00
Calvin Rose
021b71ad62 Allow proper serialization of size_t in marsh.c
Typed arrays used size_t in serialization: C APIs will
also often use it, so it makes sense to add first class support
for it rather than assume it will will fint into an integer.

These changes should quiet some visual studio warnings.

Also make some spacing more consistent.
2019-03-07 22:08:44 -05: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
ffc14f6019 Oops, peg option issue fixed. 2019-02-17 21:25:30 -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
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
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
40845b5c1b Initial peg implementation. Tree walk interpretted with
no captures, so not yet ready.
2019-01-11 19:22:24 -05:00
Calvin Rose
6f3bc3d577 Update copyright date, fix types, remove trailing whitespace. 2019-01-06 03:23:03 -05:00
Calvin Rose
5865692401 Surround embedded documentation with a macro so it
can be disabled in a future build.
2019-01-06 01:49:56 -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
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
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
e963672977 Make the assembler optional during compilation. 2018-09-29 10:58:57 -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
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
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
f295692b50 Update copyright to 2018. Add string methods. 2018-05-17 23:41:20 -04:00
bakpakin
30f62ca454 Major refactor and restructure. Add CMake for anticipated windows
support.
2018-01-19 16:43:19 -05:00