Commit Graph
76 Commits
Author SHA1 Message Date
retoor 236d69c2d7 New modules.
WrenCI / linux (push) Waiting to run
WrenCI / mac (push) Waiting to run
WrenCI / windows (push) Waiting to run
2026-01-24 19:35:43 +01:00
retoor 1a08b3adf0 Networking. 2026-01-24 09:57:59 +01:00
Michel Hermier 1855363661 wren-cli: Fix build on glibc >= 2.34 (#136)
* wren-cli: Fix build on glibc >= 2.34
2022-04-08 17:09:23 -07:00
Dario Vladovićandruby0x1 8190115b97 Implement Platform.homePath (#48)
* fix naming and path max

Co-authored-by: ruby0x1 <ruby0x1@pm.me>
2021-05-02 13:00:19 -07:00
Josh Goebel 8227330eb6 Improve file/directory utils (#84) 2021-05-01 15:58:17 -07:00
Dario Vladović 4acf7b395d Implement Process.pid & Process.ppid (#43)
* Implement `Process.pid` & `Process.ppid`

* Update `os` test suite
2021-04-28 14:51:23 -07:00
Josh Goebel 9b81aec7e4 parity between ALLOCATE and FINALIZE (#82) 2021-04-28 14:44:36 -07:00
ruby0x1 8229047c3b update code to use wren 0.4.0 2021-04-25 20:52:27 -07:00
Dario Vladović e4a0fa485e Implement Process.version (#42)
* Implement `Process.version`
* Update`os` test suite
2020-06-13 21:23:02 -07:00
Dario Vladović 1ab88ed201 Implement Process.cwd (#41)
* Implement `Process.cwd`
* Update `os` test suite
2020-06-13 21:12:34 -07:00
Dario Vladovic 32b5c96279 Format help output
Add missing `--version` option to optional
arguments listing.
2020-06-06 04:55:54 +02:00
underscorediscovery 6c936d4547 0.3.0: cli can use more portable S_IFDIR 2020-02-11 20:21:58 -08:00
underscorediscovery b89a3cc111 0.3.0: minor tidying 2020-02-11 20:20:34 -08:00
kawa-yoiko 6ab4abe9e3 cli; Fix a memory leak in findModulesDirectory() (#718) 2019-12-27 10:42:32 -08:00
vvn 5725ecad67 Update path.c 2019-06-13 14:51:28 +08:00
kai c58e51fa96 Fixed compiling error of cli on Windows 2019-02-19 15:14:53 +08:00
Bob Nystrom 03ec25720d Add cast to satisfy the C++ warning gods. 2018-07-24 07:21:41 -07:00
Bob Nystrom 7a42a20b98 Merge branch 'master' into smarter-imports
# Conflicts:
#	src/module/io.c
#	src/vm/wren_vm.c
2018-07-15 21:01:14 -07:00
Bob Nystrom c367fc3bfc Get logical imports in "wren_modules" working.
There's a lot of changes here and surely some rough edges to iron out.
Also, I need to update the docs. But I want to get closer to landing
this so I can build on it.
2018-07-15 20:09:41 -07:00
Charlotte Koch 18f74d89c4 Don't forget to #undef FINALIZER 2018-06-05 13:27:45 -07:00
Bob Nystrom c4ae0f5c59 Be a little more conservative with some string operations.
This should hopefully fix #531, though in practice the previous code
should have been safe too.
2018-04-28 16:38:09 -07:00
Bob Nystrom 8210452970 Relative imports!
This is a breaking change because existing imports in user Wren code
that assume the path is relative to the entrypoint file will now likely
fail.

Also, stack trace output and host API calls that take a module string
now need the resolved module string, not the short name that appears in
the import.
2018-03-24 11:10:36 -07:00
Bob Nystrom 5539c59750 Add a minimal path manipulation C module.
This is just for the VM's own internal use, for resolving relative
imports.

Also added a tiny unit test framework for writing tests of low-level
C functionality that isn't exposed directly by the language or VM.
2018-03-24 10:58:07 -07:00
Bob Nystrom 8a71735e0f Expose an API to let the host resolve relative import strings.
This is a breaking API change: wrenInterpret() now takes an additional
parameter for the module name to interpret the code in.
2018-03-23 07:54:09 -07:00
Bob Nystrom 2021e086bf Don't automatically flush on every System.write().
It's handy because it ensures writes are flushed to the terminal before
any calls to read from stdin, but it's also gratuitously slow.

Instead, added a Stdout class with an explicit flush() method that can
be called by the user.

Fix #445.
2017-10-09 07:16:05 -07:00
Bob Nystrom 02bcefcbe4 Add test for user data.
Also moved the VM parameter in the error callback to be first like it
is in other callbacks.
2017-03-22 07:26:19 -07:00
scott cdce553f5a fixed new api issue in cli 2017-01-19 22:58:52 -05:00
Bob Nystrom b59eeaf2d1 Support "--version" in the CLI to print the version. 2016-08-27 17:38:14 -07:00
Bob Nystrom 689cd42269 Start writing the REPL in Wren.
It doesn't actually execute code yet, but it:

- Supports left and right arrow keys for moving the cursor.
- Ctrl-C, Ctrl-D, Ctrl-A, and Ctrl-E for navigating.
- Syntax highlights the line (!).

The next step is to do a rough parse so that we can tell if the line
is an expression, statement, or needs more input. That will tell us
whether we need to interpret it at the top level (statement) and not
worry about a result, evaluate it as an expression and print the result,
or read more lines.
2016-06-09 19:16:41 -07:00
Bob Nystrom 6002cc4d65 Add Stdin.isTerminal. 2016-05-21 12:51:11 -07:00
Bob Nystrom 06731f66d4 Add a Platform class.
- Rename the "process" module to "os".
- Add Platform to it.
- Static "name" method.
- Static "isPosix" method.
- Docs and tests!
2016-05-21 12:44:17 -07:00
Bob Nystrom 6bcc64eb61 Wren 0.1.0!
There's nothing new in this "release", but now is as good a time as any
to start versioning. Going forward, I plan to do periodic releases and
update the changelog so users can see what's going on.
2016-05-21 10:53:05 -07:00
Bob Nystrom 5d98d20175 Add Stdin.isRaw. 2016-05-20 15:19:18 -07:00
Bob Nystrom 984fa1ddd1 Use errorFn for runtime errors. 2016-03-17 07:17:03 -07:00
Bob Nystrom c5855a6fe9 Squashed commit of the following:
commit f93ec6430f9629b5a28765a3961379d1e8296e50
Author: Bob Nystrom <robert@stuffwithstuff.com>
Date:   Wed Mar 16 08:03:25 2016 -0700

    Tiny tweaks.

commit 332a08fe33cddffec82dbd377ee0c941a0066f64
Merge: a673981 14b7a08
Author: Bob Nystrom <robert@stuffwithstuff.com>
Date:   Wed Mar 16 08:01:00 2016 -0700

    Merge branch 'errorFn' of https://github.com/ppvk/wren into ppvk-errorFn

commit 14b7a086ce3dae1b12697319bc2894048fad469f
Author: Paul VanKeuren <paul.vankeuren@gmail.com>
Date:   Tue Mar 15 11:33:37 2016 -0500

    missing semicolon, accessing vm through parser in

commit 924eaa1f9d3fbb26dc07d3ac8be7dc00287138d9
Author: Paul VanKeuren <paul.vankeuren@gmail.com>
Date:   Tue Mar 15 11:25:32 2016 -0500

    fixed missing errorFn in wren.h

commit 3761df111f9dce3bd67407754675c9efbbf2c0b4
Author: Paul VanKeuren <paul.vankeuren@gmail.com>
Date:   Tue Mar 15 11:23:51 2016 -0500

    Added an errorFn to the CLI

commit d51137b4abe339a3f07d7e2f4c5ee0d8d062a009
Author: Paul VanKeuren <paul.vankeuren@gmail.com>
Date:   Tue Mar 15 11:21:16 2016 -0500

    Added a WrenErrorFn typedef, an errorFn slot in WrenConfiguration.  exits early if  is not defined, otherwise it runs the errorFn .
2016-03-16 08:04:03 -07:00
Bob Nystrom 1e4b9e5175 File.realPath().
Not tested yet, because we can't create symlinks from Wren and I don't
want to check symlinks into the repo, but it seems to do the right
thing.
2016-02-27 15:53:02 -08:00
Bob Nystrom 60162575ee More file system checking functions:
- Stat#isFile
- Stat#isDirectory
- Directory.exists()
- File.exists()
2016-02-21 12:23:33 -08:00
Bob Nystrom c6148f8941 Make Stat a foreign class.
Instead of copying the uv_fs_stat struct to a list of Wren numbers, we
store it directly in the Stat object. This is important because we'll
need to implement later methods like isDirectory() in C so we can use
S_ISDIR(). For that, we need to have access to the original stat data.
2016-02-21 11:34:10 -08:00
Bob Nystrom b331915259 Add stat instance method to File. 2016-02-21 10:18:45 -08:00
Bob Nystrom 8e90e3577b More file IO!
Can now create, delete, and write to files.
2016-02-20 09:23:42 -08:00
Bob Nystrom 79558d95e5 Move File.stat() -> Stat.path().
Thanks, Michel!
2016-02-07 09:56:16 -08:00
Bob Nystrom 71e2458a6c Add API for accessing command-line arguments.
- Add process module with Process class.
- Add "arguments" and "allArguments" methods.
- Docs for same.
- Support passing additional arguments to command line.
- Add "--help" support to command line.
2016-01-22 07:57:26 -08:00
Bob Nystrom 5cd8a06fa0 File.stat(). 2016-01-01 09:58:44 -08:00
Bob Nystrom b054526df8 Add an optional offset to File.readBytes(). 2015-12-30 08:13:19 -08:00
Bob Nystrom 678251a00c Fix type for fileFinalizer(). 2015-12-29 21:07:26 -08:00
Bob Nystrom ed6fad6153 Get rid of fiber for finalizers.
Instead, finalizers just get access to the foreign object's raw bytes.
This is deliberately limiting, since it discourages the user from
interacting with the VM in the middle of a GC.
2015-12-28 08:06:29 -08:00
Bob Nystrom 0ac793d4f8 Add Directory.list() to io. 2015-12-24 10:12:12 -08:00
Bob Nystrom 69a5c1d017 Avoid empty array initializer which seems to be problematic on VC++. 2015-11-25 08:36:42 -08:00
Bob Nystrom aaab14959f Get rid of extraneous "," in module macros.
Thanks, Michel!
2015-11-10 07:13:19 -08:00
Bob Nystrom e5176607d9 Move meta and random to "aux" modules.
Wren now has three classes of modules:

- The one magic "core" module that's built in and always needed.
- Auxiliary libraries like "meta" and "random". These do not have any
  dependencies, so can be used even when you embed Wren inside an
  application. But they're also optional and can be disabled if you
  don't need them.
- CLI modules. These ones need libuv and are tied to the CLI wrapper
  around the VM.
2015-10-17 22:09:48 -07:00