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
Jon Staab
134163708a
Fix formatting
2019-11-16 16:07:15 -08:00
Jon Staab
40e6616df0
Add support for delete key in repl
2019-11-16 16:01:52 -08:00
Calvin Rose
c9292ef648
Use /MD on windows.
...
Just makes things easier. Assume machines have msvcrt.dll
on them. If not, we can add msvcrt.dll to the dist folder and add to
installer.
2019-11-09 16:05:07 -05:00
Calvin Rose
c5010dffb4
Print error message on bad CLI usage.
...
This was a small regression when bundling cli-main
into boot.janet.
2019-11-05 12:51:15 -06:00
Calvin Rose
280dca3998
Add shell.c to the amalgamation.
...
This allows easy builds of the full interpreter with no
build system.
1. Get janet.c, janet.h, janetconf.h, and shell.c in a directory. Edit
janetconf.h as desired.
2. gcc shell.c janet.c -lm -ldl -O2 -o janet (on GNU-Linux for example)
3. ./janet -h (Yay!)
2019-10-29 19:18:44 -05:00
Calvin Rose
427b2638e0
Fix startup environment.
2019-10-29 18:47:54 -05:00
Calvin Rose
0d16b9e1a1
Move init.janet into cli-main in boot.janet
...
This makes it easier to get the CLI functionality when
embedding Janet, although the main reason is the init script
is now pre-compiled to bytecode when generating the boot image.
2019-10-29 18:16:32 -05:00
Calvin Rose
45c2819068
Improve flychecking.
...
Flychecking will now work correctly with arity checking, and
will better handle imports. Well structured modules should interact
cleanly with the flychecker in a mostly safe manner, but maliciously
crafted modules can execute arbitrary code. As such, the flychecker is
not a good way to validate completely untrusted modules.
We also extend run-context with an :evaluator option to replace
:compile-only. This is more flexible and allows users to create their
own flychecker like functionality.
2019-10-27 16:15:41 -05:00
Calvin Rose
a18a251d16
Address some issues found in lgtm
...
Caught a few potentially issues with overflows, as well as use of
unsafe function localtime.
2019-10-10 22:59:43 -05:00
Calvin Rose
a8afc5b81f
Sourcemapping uses line, column instead of offsets.
...
This should be friendlier to most users. It does, however, mean
we lose range information. However, range information could be
recovered by re-parsing, as janet's grammar is simple enough to do this.
2019-09-22 17:18:28 -05:00
Calvin Rose
060d11e4c2
Add Q and q formatters to buffer/format.
...
These are similar to P and p, but print values
on a single line for a much more compact version.
2019-08-24 22:53:45 -04:00
Calvin Rose
54170d92db
Add some color to stacktraces in repl.
2019-08-12 19:20:01 -05:00
Calvin Rose
8bbe518696
Executables linking to natives working on linux.
...
This involves a bunch of machinery in cook.janet
and even a little bit in the janet C API.
2019-07-28 13:27:20 -05:00
Calvin Rose
7e97687c9e
Update windows installation and automation.
2019-07-27 21:44:44 -04:00
Calvin Rose
a3a3e4c0dc
Add (dyn :executable).
...
Also remove process/args.
2019-07-27 09:31:03 -05:00
Calvin Rose
a0e98b9aa8
Deprecate process/args and add use macro.
...
Use is a shorthand for (import module :prefix "").
process/args has been replaced by (dyn :args) at
the top level.
2019-07-20 16:57:07 -05:00
Calvin Rose
7c4670c3de
Change semantics of -l flag to be more useful.
2019-07-04 12:42:54 -05:00
Calvin Rose
300124961f
Change -c option to use dofile instead of require
2019-06-19 22:05:13 -04:00
Calvin Rose
9ba8728176
Update module system.
...
Add relative imports and path normalization. This should
help towards a more composable build/dependency system.
2019-06-18 22:10:13 -04:00
Calvin Rose
a5e50a0f65
Fix windows getline.
2019-06-18 00:04:29 -04:00
Adam Schwalm
3bbc121c6a
Add support for getting more detailed parser state
2019-06-15 07:37:01 -05:00
Calvin Rose
802a2d6b71
Add more dynamic bindings for printing.
2019-06-08 15:27:13 -04:00
Calvin Rose
bea6dbbf3d
Hint utf8 output on windows console.
2019-05-31 15:30:23 -04:00
Calvin Rose
db55277b58
Work on windows installer.
...
We will probably shift to NSIS as the default
installation method for windows. Shipping around a
single binary just doesn't cut it if we want to be able
to reliably use tools like `jpm` to build things.
2019-05-28 20:45:39 -04:00
Calvin Rose
ce9cd4fcef
Issue #113 Color console support for windows 10
...
Use SetConsoleMode winapi function to enable ANSI
escape codes if we can.
2019-05-26 22:31:30 -04:00
Calvin Rose
97ad4c4f89
Update manpage and make -k mode not exit on error.
2019-05-19 15:20:59 -04:00
Adam Schwalm
f444bd25ef
Add a 'compile-only' flag to the command line
...
This allows syntax checkers like the emacs 'flycheck-mode' to check
the source without side effects.
2019-05-19 12:55:28 -05:00
Calvin Rose
1cfc7b3b0d
Add preliminary debugger to default repl.
...
Also upddate colors, and fix formatting.
2019-05-02 17:11:30 -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
082639319e
Add colors to repl and string/format.
...
This makes the repl look nicer using ANSI
color codes, which are widely supported. The codes
can also be turned off via the -m flag.
2019-03-24 15:00:22 -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
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
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
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
7ba925c50a
Make getline more useful.
2019-01-31 12:34:22 -05:00
Calvin Rose
737b2449f0
Update highlight and the mainclient.
2019-01-20 10:05:51 -05:00
Calvin Rose
b84b0e4828
Expose more of the module system.
...
The system path can more easily modified at runtime,
and the module/cache and module/loading tables are now exposed.
Properly cache native modules as well.
2019-01-18 12:04:34 -05:00
Calvin Rose
84fb07dd5a
Add quiet option to main client.
2019-01-10 17:10:12 -05:00
Calvin Rose
6f3bc3d577
Update copyright date, fix types, remove trailing whitespace.
2019-01-06 03:23:03 -05:00
Calvin Rose
338b31f5a2
Add janet_fixarity. Update emscripten source.
2019-01-05 20:45:24 -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
8dde89126e
Fix -s flag in janet binary.
2018-12-30 18:23:29 -05:00
Calvin Rose
56927e1b81
Fix -e option.
2018-12-30 17:51:15 -05:00
Calvin Rose
2bcedd5920
Remove indexing with numeric constants from janet.
2018-12-28 23:44:39 -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
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
6185af7227
Try to remove build issues on windows.
2018-12-08 17:20:24 -05:00
Calvin Rose
16e514b351
Update version schema - now have version number
...
and build number.
2018-12-08 14:17:03 -05:00
Calvin Rose
7668cd5772
Don't use generated headers for embedded janet
...
code, use object files.
2018-12-06 14:30:11 -05:00
Calvin Rose
4e4dd31164
Change syntax for namespaces.
...
Add quasiquote, unquote, and unquote-splicing
as specials rather than a macro.
2018-11-30 22:49:21 -05:00
Calvin Rose
25c50f5026
Fix repl default chunks.
2018-11-30 14:17:10 -05:00
Calvin Rose
d4ee760b3e
Change format for declaring flexible arity functions.
2018-11-25 14:03:00 -05:00
Calvin Rose
4c4eff9390
Replace cast with type pun.
2018-11-18 14:17:50 -05:00
Calvin Rose
4d119e4e03
Begin adding more complete documentation.
2018-11-15 15:45:41 -05:00
Calvin Rose
2a127af1ca
A few fixes to things like macro expand, etc.
2018-11-07 22:27:06 -05:00
Calvin Rose
853a839f6c
Add git commit hash to build to get version.
2018-10-31 16:21:21 -04: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
c1923c5ada
Web assembly build with emscripten.
2018-10-16 23:08:26 -04:00
Calvin Rose
e963672977
Make the assembler optional during compilation.
2018-09-29 10:58:57 -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
84f2c84fb5
Fix tabs in repl.
2018-08-25 15:34:27 -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
d95941597f
Fix help.
2018-08-15 22:48:35 -04:00
Calvin Rose
48c2654312
Local changes.
2018-08-07 00:54:47 -04:00
Calvin Rose
7a7291ac3a
Remove extra code.
2018-08-03 21:51:35 -04:00
Calvin Rose
169a22f03e
Fix init.dst, work on metabuild tool to make
...
native module creation easier
2018-08-03 21:50:32 -04:00
Calvin Rose
5b15ad9ff8
Try and fix os.clock on windows.
2018-07-08 20:54:41 -04:00
Calvin Rose
1f37919f39
Rename boot.dst to core.dst
2018-07-04 00:21:18 -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
e60c8a9b75
Update indentation in boot and init to be more like
...
most lisps.
2018-07-01 21:12:46 -04:00
Calvin Rose
5afde3f6d4
Add line numbers to repl like irb.
2018-06-29 13:01:23 -04:00
Calvin Rose
bb406133de
New sourcemaps v1.
2018-06-28 23:37:04 -04:00
Calvin Rose
5e9d1d07b9
Better refresh after coming back from suspend.
2018-06-24 13:20:32 -04:00
Calvin Rose
ceff49a08d
Enable suspending repl with ctrl-z.
2018-06-24 13:18:44 -04:00
bakpakin
1690fee446
Add failure on top level error.
2018-06-08 15:58:23 -04:00
Calvin Rose
8a346ec655
Add option to cli interface to stop scanning options.
2018-05-26 14:17:44 -04:00
Calvin Rose
68895e27d4
Change import semantics. Fix gc bug with fibers.
2018-05-18 20:53:19 -04:00
Calvin Rose
f295692b50
Update copyright to 2018. Add string methods.
2018-05-17 23:41:20 -04:00
Calvin Rose
6ac59251e9
Fix some very mild memory leaks in line.c and the do_bytes function (not
...
deiniting the parser).
2018-05-15 22:05:47 -04:00
Calvin Rose
c6f79eca6d
Make setting up stl easier. Add shared library output to Makefile.
2018-05-14 21:52:51 -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
584c75b3f6
Update Makefile for faster builds.
2018-05-10 11:11:18 -04:00
Calvin Rose
932a0324ee
More work on renaming functions. Change long string syntax to use
...
backticks. Allow custom masks in fibers for custom error and debug
handling.
2018-05-09 17:01:58 -04:00
Calvin Rose
f47323c915
Change convention for naming modules and functions.
2018-05-08 19:40:28 -04:00
Calvin Rose
0cd6cdc28b
Add some more opcodes for comparison with numeric types.
2018-05-07 12:34:04 -04:00
Calvin Rose
104b09d848
Make the -s option more useful.
2018-05-07 01:04:56 -04:00
Calvin Rose
55f0e759d9
Add extra information in repl to show state of parsing.
2018-05-06 23:25:59 -04:00
bakpakin
d9e5019a71
Add -e option to dst for executing inline scripts from the shell.
2018-05-05 14:05:56 -04:00
Calvin Rose
0d5b57daee
Remove exit in favor of os-exit.
2018-03-28 21:24:54 -04:00
Calvin Rose
73ead5c2de
Update core namespace. Clean up some code,
...
and put more emphasis on indexed data-structure combinators
instead of iterators.
2018-03-28 13:58:56 -04:00
Calvin Rose
a3ed7327c9
Make array literals require preceding @ character.
2018-03-24 12:48:42 -04:00
Calvin Rose
e114ec0095
Move web client code.
2018-03-19 17:13:36 -04:00
Calvin Rose
82e5d915f7
Add makefile back.
2018-03-18 09:17:20 -04:00
Calvin Rose
4a76f2ae32
Replace varset! with algol style :=
2018-03-16 18:15:34 -04:00
Calvin Rose
72d8e74a71
Update assembly and add example.
2018-03-16 14:34:48 -04:00
Calvin Rose
1ec704feb9
Remove pretty printer implemented in C.
2018-03-14 13:38:48 -04:00