当前位置:网站首页>Rhai - rust's embedded scripting engine
Rhai - rust's embedded scripting engine
2022-06-30 23:58:00 【ruonou. com】
be based on Rust The richness and innovation of language , And ultra-high performance execution efficiency , Currently in the open source community , Produced many Rust Language embedded script engine .Rhai It's new , But the one with higher innovation .Rhai Provides a security 、 Add to any application in a simple way Rust Syntax script , But it kept Rust Language “ Zero cost ” Efficiency of execution .
Rhai Is in Rust Language features , have no-std characteristic , And dynamic types . Compile time overhead is very low , But the execution efficiency is considerable : In a single core 2.3 GHz Of Linux Virtual machine ,0.3 Seconds , It has reached over a million iterations .
In detail ,Rhai Has the following characteristics ( Only a few are listed below ):
- Easy to Be similar to Rust + JavaScript, And has a dynamic type . And Rust Functions and types are tightly integrated . Through the external scope , take Rust Variable / Constants are passed losslessly into the script , There is no need to implement any special features . from Rust In code , Easily call script defined functions . Few dependencies , What you actually have to have is 2 A third party Rust crate.
- Extremely fast
Very low compile time overhead .
After the evaluation , In a single core 2.3 GHz Of Linux Virtual machine ,0.3 Seconds , iteration 100 Ten thousand times .
Script optimization .
- dynamic function overloading . Operator overload . With dynamically loadable modules , To organize the code base . Function pointers can be dynamically scheduled . Closures that capture shared variables . Support for object-oriented programming (OOP).
- flexible The script engine can be set to send + Sync ( Through the synchronization function ). adopt serde crate Provide serialization 、 Deserialization supports . By excluding unwanted language features , To support minimal build . Support most build goals , Include no-std、WASM. You can disable keywords accurately by yourself 、 Operator , To restrict language . It can be used as DSL.
Rhai stay github Open source , After a period of trial by the author , The experience effect is very good . at present , In specific projects , The author is carrying out in-depth application : It mainly focuses on the auxiliary aspect of template rendering .
After the author's in-depth experience , Therefore, it is recommended , Interested friends can visit the website :https://rhai.budshome.com, For a detailed understanding .
边栏推荐
- Shell multitasking to download video at the same time
- 女朋友说:你要搞懂了MySQL三大日志,我就让你嘿嘿嘿!
- Arthas debugging problem determination Toolkit
- shell 同时执行多任务下载视频
- When is it appropriate to replace a virtual machine with a virtual machine?
- Repetition is the mother of skill
- Vmware16 installing win11 virtual machine (the most complete step + stepping on the pit)
- One revolution, two forces and three links: the "carbon reduction" road map behind the industrial energy efficiency improvement action plan
- 如何关闭一个开放的DNS解析器
- 需求评审,测试人员应该发挥怎样的价值?两分钟让你不再懵逼
猜你喜欢

Gateway service gateway

conv2d详解--在数组和图像中的使用

Prospects of world digitalization and machine intelligence in the next decade

How to edit special effects in VR panorama? How to display detailed functions?

shell 同时执行多任务下载视频
![[NLP] [textcnn] text classification](/img/bb/c8fd9f1ed458a88a17b8d5c70d9ce2.png)
[NLP] [textcnn] text classification

深入理解 Jetpack Compose 内核:SlotTable 系统

Software engineering best practices - project requirements analysis

ABAQUS 2022 latest edition - perfect realistic simulation solution

ABAQUS 2022 software installation package and installation tutorial
随机推荐
Design e-commerce seckill system
What is SRM system and how to standardize the internal procurement process of the company
Random ball size, random motion collision
New trend of embedded software development: Devops
35家巨头科技公司联合组成元宇宙标准论坛组织
2022-06-30: what does the following golang code output? A:0; B:2; C: Running error. package main import “fmt“ func main()
深入理解 Jetpack Compose 内核:SlotTable 系统
conv2d详解--在数组和图像中的使用
1175. 质数排列 / 剑指 Offer II 104. 排列的数目
How do it outsourcing resident personnel position their pain points?
Fastjson V2 simple user manual
76页智慧物流园区综合解决方案2022(附下载)
What does project management really manage?
异步过渡方案—Generator
leetcode 474. Ones and zeroes (medium)
[UML] UML class diagram
To tell you the truth, ThreadLocal is really not an advanced thing
How to open a stock account? Is it safe to open a mobile account
Dataloader source code_ DataLoader
8253A寄存器浅析