wasmerio / rusty_jsc Goto Github PK
View Code? Open in Web Editor NEWRust bindings for the JavaScriptCore engine.
License: MIT License
Rust bindings for the JavaScriptCore engine.
License: MIT License
I haven't been able to figure out how to pass value(s) to a Rust callback nor how to read an output value on the JS side from a Rust callback.
If you could provide a simple example for each of those that'd be very much appreciated!
Are there any plans for adding a Serde serializer/deserializer for JSC values?
Hi!
I'm not sure if the information is entirely recoverable but is there a chance to get tags to match the released versions? (or at least 0.1.0
). While trying to workaround for some seemingly missing concepts (specifically Promises and Protection) I see there's a commit dated on Apr 25th that includes some of these developments but these are not on 0.1.0
even tho it's dated Apr 27th.
So if there's a way to get that it'd be terrific. Also to know if there are plans on releasing the latest work.
Thanks for the hard work! I'm still in my very early stages with rust but I'm enjoying working with this wrapper.
Hey, this looks great!
Applogies if this is a silly question, I’ve essentially just started exploring the space :)
Is it possible to load & call into WebCore APIs; eg fetch?
Also, perhaps relatedly, how I can discover what the context provides by default? I see the punjs (lol, A+) example runs a console.log
script but 1) where is console coming from? 2) I don’t see it log, so is that effectively a noop since evaluateScript only prints the return value? Or do I have to define my own console global callback which passes thru to println?
Thanks !
If I upgrade using this git repo, I get errors:
5 | #[callback]
| ^^^^^^^^^^^
| |
| expected struct rusty_jsc_sys::OpaqueJSContext
, found struct OpaqueJSContext
| arguments to this function are incorrect
Hello, I'm trying to use cargo-wasi
to build a rust app that uses rusty_jsc, but I'm seeing this error when I run cargo wasi build
:
❯ cargo wasi run
Compiling rusty_jsc_sys v0.0.2
Compiling anyhow v1.0.66
Compiling rusty_jsc_sys v0.0.3
error: library kind `framework` is only supported on Apple targets
error: could not compile `rusty_jsc_sys` due to previous error
warning: build failed, waiting for other jobs to finish...
error: could not compile `rusty_jsc_sys` due to previous error
My Cargo.toml
is simple:
[package]
name = "project"
version = "0.1.0"
edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
rusty_jsc = "0.0.2"
rusty_jsc_macros = "0.0.3"
rusty_jsc_sys = "0.0.3"
And the main.rs is just one of your examples:
use rusty_jsc::JSContext;
fn main() {
let mut context = JSContext::default();
let value = context.evaluate_script("'hello, world'", 1);
if let Some(value) = value {
println!("{}", value.to_string(&context));
}
}
Any ideas? I'm new to the world of WASI so hopefully its something I just don't understand
The build script for rusty-jsc-sys
doesn't include a main()
function on Windows, which means builds will fail with the following error on Windows:
error[E0601]: `main` function not found in crate `build_script_build`
--> C:\Users\Work\.cargo\registry\src\github.com-1ecc6299db9ec823\rusty_jsc_sys-0.1.0\build.rs:9:2
|
9 | }
| ^ consider adding a `main` function to `C:\Users\Work\.cargo\registry\src\github.com-1ecc6299db9ec823\rusty_jsc_sys-0.1.0\build.rs`
I suspect we'll need to do a bit more to make things link than just stubbing out the main()
function, but I've never built JavaScriptCore from source so I'm not sure how to go about it.
Is there a way to run JS with timeouts?
Hi! Thank you for this impressive work! When searching for rust javascriptcore libs I found also this https://github.com/tauri-apps/javascriptcore-rs. How your library differentiate from theirs?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.