Commit graph

202 commits

Author SHA1 Message Date
Alex Orlenko 52be96677b 0.2.1 release 2019-12-26 23:09:11 +00:00
Alex Orlenko c9c8f983e0 0.2.0 release 2019-11-30 01:33:41 +00:00
Alex Orlenko fd17a01456 Add Lua 5.2 support 2019-11-30 00:58:41 +00:00
Alex Orlenko aa3002b7d9 Update README and description 2019-11-04 22:34:31 +00:00
Alex Orlenko ae677b0918 Move lua 5.1 support under new "lua51" feature 2019-11-04 22:23:15 +00:00
Alex Orlenko 551e4f1f87 Add compile_fail tests 2019-11-04 22:23:15 +00:00
Alex Orlenko 6f42a6cca9 Add LuaJIT support 2019-11-04 22:23:15 +00:00
Alex Orlenko c4fd7a9faf Lua 5.1 support 2019-10-17 17:05:42 +01:00
Alex Orlenko 430e2e07ea Clear changelog and update license 2019-10-17 17:05:41 +01:00
Alex Orlenko b7c578c274 Replace libc with std::os::raw 2019-10-02 22:12:28 +01:00
Alex Orlenko 224ed8ff52 Add mlua_derive proc macro module 2019-10-02 22:12:27 +01:00
Alex Orlenko cb109f6e36 Rename to mlua 2019-10-01 16:11:12 +01:00
Alex Orlenko 11e22d1cba Temporary drop "compile-fail" tests due to unstable compiletest_rs crate 2019-09-30 22:34:20 +01:00
Alex Orlenko affa85feb0 Backport changes from rlua 0.16 (master branch) 2019-09-29 12:53:13 +01:00
Alex Orlenko 53b352466e Replace ffi module with implementation from "jcmoyer/rust-lua53" crate 2019-09-29 12:42:07 +01:00
Alex Orlenko b1aa8f8a80 Remove builtin lua 2019-08-08 18:54:08 +01:00
kyren da3d4c4998 (cargo-release) version 0.15.3 2018-10-13 17:56:42 -04:00
Stephen Akridge da6e92d16d Update num-traits dependency to 0.2.6
This crate requires i128 support which is not
added to num-traits until the 0.2.5 release and i128
detection is added in 0.2.6.
2018-10-11 10:40:03 -07:00
kyren 1a259284ab (cargo-release) start next development iteration 0.15.3-alpha.0 2018-10-01 06:10:35 -04:00
kyren 8db6709fb8 (cargo-release) version 0.15.2 2018-10-01 06:10:18 -04:00
kyren e49ecbd6be (cargo-release) start next development iteration 0.15.2-alpha.0 2018-10-01 05:15:25 -04:00
kyren 5610748347 (cargo-release) version 0.15.1 2018-10-01 05:15:09 -04:00
kyren f8665ba334 (cargo-release) version 0.15.0 2018-10-01 04:53:22 -04:00
kyren c3d0110722 Return rlua::Error on out of range numeric conversions using num_traits::cast 2018-09-24 22:14:50 -04:00
kyren 70b67052c9 Upgrade rustyline to 2.0 to avoid confusion 2018-09-24 21:27:29 -04:00
kyren 14090821d3 Make the changes I proposed to PR #79
Allows people (maybe only I care about this?) to build rlua in weird
environments.
2018-09-16 21:18:24 -04:00
kyren c07abdc03e
Merge pull request #79 from acrisci/system-lua-pkg-config
find system lua with pkg-config
2018-09-16 20:57:45 -04:00
kyren 654fff7065 Next version will be 0.15 2018-09-16 20:19:46 -04:00
kyren ac21874d11 (cargo-release) start next development iteration 0.14.3-alpha.0 2018-08-06 19:09:27 -04:00
kyren ca8326475f (cargo-release) version 0.14.2 2018-08-06 19:09:09 -04:00
kyren e4de847395 (cargo-release) start next development iteration 0.14.2-alpha.0 2018-08-05 12:35:05 -04:00
kyren e6ca00b65c (cargo-release) version 0.14.1 2018-08-05 12:33:26 -04:00
kyren 8366960368 Update to failure 0.1.2, rename deprecated methods 2018-08-05 11:48:25 -04:00
kyren e6688e1db2 very small doc fixes 2018-08-05 09:51:32 -04:00
kyren 2d4f4b95c8 (cargo-release) start next development iteration 0.14.1-alpha.0 2018-06-29 01:28:28 -04:00
kyren 0cab2e25de (cargo-release) version 0.14.0 2018-06-29 01:25:15 -04:00
kyren 02bc8da203 Prepare for 0.14.0 release 2018-06-29 01:24:28 -04:00
Tony Crisci 66e49518d3 find system lua with pkg-config 2018-05-14 08:51:51 -04:00
kyren 60bfe1fb07 Nope, require failure 1.0 because otherwise it depends on backtrace automatically 2018-03-20 16:23:23 -04:00
kyren a22c23ae26 rely on failure 0.1.2 from git to get backtrace disabled by default
without relying on an unreleased 1.0 API.  Trying to get rid of the special
chucklefish hack branches in the meantime before 1.0.
2018-03-20 15:17:27 -04:00
kyren 5aa22de68e Use git dependency on failure 1.0 for right now 2018-03-20 14:07:32 -04:00
kyren f0775f4a1a Move several asserts to only be active with debug, bump alpha version number 2018-03-12 16:14:52 -04:00
kyren 964666e11b Use criterion for benchmarking, add some simple benchmarks 2018-03-10 10:31:57 -05:00
kyren 6ab7f99315 Revert "Temporary fix for #71. Remove when rust #48251 is fixed in stable."
This reverts commit 5d96ddc52a.
2018-03-06 07:03:58 -05:00
kyren 0e9a70e688 (cargo-release) start next development iteration 0.13.1-alpha.0 2018-02-28 14:51:50 -05:00
kyren e98d4d1827 Update changelog / cargo.toml in prep for 0.13 2018-02-28 14:44:16 -05:00
kyren 5d96ddc52a Temporary fix for #71. Remove when rust #48251 is fixed in stable. 2018-02-28 14:43:15 -05:00
kyren a49ea51b79 Remove terrible awful no-good evil hack
The breakage is being addressed in rust itself.
2018-02-19 18:09:04 -05:00
kyren e19a5b6481 Cleanup max upvalues constant a bit, add some luaconf.h assumptions 2018-02-19 18:03:18 -05:00
kyren 52eedfd378 I'm not going to release this as is, but I need to weigh my options 2018-02-16 23:43:30 -05:00
kyren dec360f78f Can.. can I do this? Is this a thing that actually works?
Drastic times and all that.
2018-02-16 22:01:41 -05:00
kyren f0186d1799 Provisional "fix" for #71. Requires nightly :( 2018-02-15 21:39:35 -05:00
kyren 6b46e8abe9 prepare for 0.12.2 2018-02-14 00:56:20 -05:00
kyren c22aae461b Some changes for panic correctness, stack usage correctness, and speed 2018-02-12 13:54:31 -05:00
kyren 9388a72d61 Update Cargo.toml for 0.12.1 2018-02-11 17:55:40 -05:00
kyren 61236e685f Change changelog, readme, examples, Cargo.toml for 0.12 release 2018-02-10 19:04:18 -05:00
kyren d4c80d44c8 Attempt to enable compiletest_rs on nightly on travis 2018-02-10 00:27:15 -05:00
kyren f785a3abe4 Don't bother with a feature, just disable LUA_USE_APICHECK in release 2018-02-09 23:59:11 -05:00
kyren 84b009da03 A few small performance improvements
When 'debug_assertions' is not enabled, don't bother doing asserts in
stack_guard / stack_err_guard.  Also, add an optional feature not enabled by
default to disable LUA_USE_APICHECK in release mode.  Once the bugs in rlua that
allow you to trigger LUA_USE_APICHECK are fixed, this feature will be the
default behavior.
2018-02-09 01:22:34 -05:00
kyren cbc882bad0 Bump cargo version to 0.11.0 2018-01-26 22:03:13 -05:00
kyren 0801104762 ACTUALLY expose RegistryKey API
Also fixes a safety issue with RegistryKey, where you could use RegistryKeys
with mismatching Lua instances.
2018-01-26 19:43:53 -05:00
kyren 79ba909db0 Experimentally use the failure crate for errors 2018-01-21 20:08:51 -05:00
kyren 443054f753 Update README, CHANGELOG, and Cargo.toml for 0.10.2 2017-12-17 01:14:11 -05:00
kyren c67ae24c97 bump version for doc spelling fix 2017-12-05 00:16:35 -05:00
kyren 80a98ef29c Couple of changes:
- Update readme, changelog, cargo version number in preparation for release
- Remove panicking behavior on recursive callback calls, add additional error
  variant for recursive callback errors.
2017-12-04 01:47:04 -05:00
kyren cfa2b34a7b Bump version to 0.9.7, update changelog 2017-11-08 14:07:48 -05:00
kyren 00a3153ae0 Bump version / changelog for 0.9.6 2017-10-26 16:53:14 -04:00
kyren 8592af1b16 Bump version to 0.9.5, update changelog 2017-10-25 14:55:05 -04:00
kyren 4bbeeb2b2d Update to 0.9.4, update changelog 2017-10-24 08:59:55 -04:00
kyren 401c06cfe6 Bump cargo version to 0.9.3, update changelog. 2017-10-14 19:27:24 -04:00
kyren ef538d8757 Update rlua to 0.9.2, add SOME kind of changelog. 2017-09-24 19:32:26 -04:00
kyren ec088300f2 Specify gcc crate dependency with minimum bound on version with Build 2017-09-09 21:04:57 -04:00
kyren 1efef92570 I guess I need to bump the cargo version even to change the badge. 2017-08-02 17:43:44 -04:00
kyren fffeb9701b Badge has wrong url, I guess it doesn't expect the github portion 2017-08-02 17:42:58 -04:00
kyren b42d613c5b Update Cargo.toml for 0.9, add travis-ci badge 2017-08-02 17:37:29 -04:00
kyren 2553623b65 Provide custom allocators that ensure that OOM results in an abort
(closes unsafety hole)
2017-08-02 16:33:48 -04:00
Jonas Schievink 3f20319a84 Use rustyline for the REPL
This makes the REPL more usable as you can now edit lines and recall
previously executed statements.
2017-08-02 14:32:45 +02:00
kyren 4549abbb85 Two major API changes to start with:
* Callbacks have generic argument and return types
* All variadics are done with tuples
2017-07-31 01:21:41 -04:00
kyren eafe4c7c30 cargo version bump for linking fix 2017-07-09 17:20:51 -04:00
kyren b8fab1b3ed Make the builtin version of lua 5.3 optional
In case you would need to build a crazy custom version of lua for a weird
platform.  This could possibly be done in a cleaner way.
2017-07-05 19:35:53 -04:00
kyren cd4343c83e Bump cargo version (again! I'm sorry!), and update README 2017-06-25 18:27:52 -04:00
kyren 8548fbd263 Bump cargo version to 0.7.0
I'm not 100% sold on the LuaError design, I think there are a lot of questions
still, but there have been enough bugfixes that it's better to do a cargo bump.
2017-06-25 02:41:02 -04:00
kyren 47db72cac4 Big API incompatible error change, remove dependency on error_chain
The current situation with error_chain is less than ideal, and there are lots of
conflicting interests that are impossible to meet at once.  Here is an
unorganized brain dump of the current situation, stay awhile and listen!

This change was triggered ultimately by the desire to make LuaError implement
Clone, and this is currently impossible with error_chain.  LuaError must
implement Clone to be a proper lua citizen that can live as userdata within a
lua runtime, because there is no way to limit what the lua runtime can do with a
received error.  Currently, this is solved by there being a rule that the error
will "expire" if the error is passed back into rust, and this is very
sub-optimal.  In fact, one could easily imagine a scenario where lua is for
example memoizing some function, and if the function has ever errored in the
past the function should continue returning the same error, and this situation
immediately fails with this restriciton in place.

Additionally, there are other more minor problems with error_chain which make
the API less good than it could be, or limit how we can use error_chain.  This
change has already solved a small bug in a Chucklefish project, where the
conversion from an external error type (Borrow[Mut]Error) was allowed but not
intended for user code, and was accidentally used.  Additionally, pattern
matching on error_chain errors, which should be common when dealing with Lua, is
less convenient than a hand rolled error type.

So, if we decide not to use error_chain, we now have a new set of problems if we
decide interoperability with error_chain is important.  The first problem we run
into is that there are two natural bounds for wrapped errors that we would
pick, (Error + Send + Sync), or just Error, and neither of them will
interoperate well with error_chain.  (Error + Send + Sync) means we can't wrap
error chain errors into LuaError::ExternalError (they're missing the Sync
bound), and having the bounds be just Error means the opposite, that we can't
hold a LuaError inside an error_chain error.

We could just decide that interoperability with error_chain is the most
important qualification, and pick (Error + Send), but this causes a DIFFERENT
set of problems.  The rust ecosystem has the two primary error bounds as Error
or (Error + Send + Sync), and there are Into impls from &str / String to
Box<Error + Send + Sync> for example, but NOT (Error + Send).  This means that
we are forced to manually recreate the conversions from &str / String to
LuaError rather than relying on a single Into<Box<Error + Send + Sync>> bound,
but this means that string conversions have a different set of methods than
other error types for external error conversion.  I have not been able to figure
out an API that I am happy with that uses the (Error + Send) bound.  Box<Error>
is obnoxious because not having errors implement Send causes needless problems
in a multithreaded context, so that leaves (Error + Send + Sync).  This is
actually a completely reasonable bound for external errors, and has the nice
String Into impls that we would want, the ONLY problem is that it is a pain to
interoperate with the current version of error_chain.

It would be nice to be able to specify the traits that an error generated by the
error_chain macro would implement, and this is apparently in progress in the
error_chain library.  This would solve both the problem with not being able to
implement Clone and the problems with (Error + Send) bounds.  I am not convinced
that this library should go back to using error_chain when that functionality is
in stable error_chain though, because of the other minor usability problems with
using error_chain.

In that theoretical situation, the downside of NOT using error_chain is simply
that there would not be automatic stacktraces of LuaError.  This is not a huge
problem, because stack traces of lua errors are not extremely useful, and for
external errors it is not too hard to create a different version of the
LuaExternalResult / LuaExternalError traits and do conversion from an
error_chain type into a type that will print the stacktrace on display, or
use downcasting in the error causes.

So in summary, this library is no longer using error_chain, and probably will
not use it again in the future.  Currently this means that to interoperate with
error_chain, you should use error_chain 0.8.1, which derives Sync on errors, or
wait for a version that supports user defined trait derives.  In the future
when error_chain supports user defined trait derives, users may have to take an
extra step to make wrapped external errors print the stacktrace that they
capture.

This change works, but is not entirely complete.  There is no error
documentation yet, and the change brought to a head an ugly module organization
problem.  There will be more commits for documentation and reorganization, then
a new stable version of rlua.
2017-06-24 18:11:56 -04:00
kyren 7b7f7f36fc Bump cargo version, bugfix for numeric conversions.
This could arguably be a semver update, but the previous behavior was definitely
not intentional, it was a bug.
2017-06-23 03:28:43 -04:00
kyren f92e21d5cb Bump cargo version to 0.6.0 2017-06-20 18:13:40 -05:00
kyren 64d1eae55c New 0.5.x cargo update with important coroutine bugfix, build changes 2017-06-17 23:23:17 -04:00
kyren 44370dd64e bump cargo version, nice addition of Result conversion 2017-06-15 16:28:12 -04:00
kyren 8440298e71 Go ahead and release 0.5.0
partially for the selfish reason that my submodule setup does not deal well with
ureleased versions of cargo libs where the version number ends with -pre
2017-06-11 01:33:08 -04:00
kyren 5c8aa19b8d Two major API changes:
Allow load to return values, allows reimplementing require() like functions
properly.

Make globals table explicit in Lua, remove Lua::get / Lua::set in favor of
Lua::globals.  Allows obeying globals metatable, using other Table functions on
the globals table.

Also added "has" method as shorthand for checking whether a table entry is not
nil.
2017-06-11 01:12:25 -04:00
kyren 1c0b1014ee Improve performance of create_table / create_array_table 2017-06-05 01:46:45 -04:00
kyren 9aed99e3e3 atpanic function was not a good idea, it's not sound
It crosses the C api boundary, the only proper way to panic would be to actually
error guard everywhere, aborting is fine.
2017-06-05 01:05:41 -04:00
kyren b3218137e1 Somewhat smarter strategy for error_guard calls, less ungodly slow.
Also add raw_length table function
2017-06-05 00:41:48 -04:00
kyren e4052bb4d4 Bump cargo.toml version number 2017-06-05 00:06:15 -04:00
kyren bd7ee783e3 fix links, again 2017-05-29 16:34:39 -04:00
kyren ab3f75a90d bump cargo version 2017-05-29 16:33:54 -04:00
kyren 4deb90c1ef Update README / Cargo.toml to point to docs.rs API docs 2017-05-29 16:28:29 -04:00
kyren 9c4029c04c bump cargo version 2017-05-26 23:49:49 -04:00
kyren e73346bc0f version bump 2017-05-25 00:58:28 -04:00
kyren 5c0f183a52 Improved error handling and formatting
Now prints lua backtraces on callback errors as well.  This could be
controlled with LUA_BACKTRACE or just RUST_BACKTRACE or similar.
2017-05-22 14:25:36 -04:00
kyren b15ee9053e Update to use hlist_macro for hlist macros.
You will type hlist! hlist_pat! and HList! so often that every character
counts.  Apologize for the API churn in the README.
2017-05-22 11:16:34 -04:00
kyren ccc83767ec Updates to Cargo.toml metadata 2017-05-22 03:06:33 -04:00
kyren 065c69894a Initial import 2017-05-21 19:50:59 -04:00