#cplusplus#artificial_intelligence#cloud#cloud_native#cncf#container#docker#edge_computing#ewasm#hacktoberfest#hacktoberfest2023#kubernetes#rust_lang#serverless#wasm#webassembly
WasmEdge is a fast, lightweight, and secure WebAssembly runtime that lets you run programs safely on your devices, servers, or the cloud. It supports many programming languages like C++, Rust, and JavaScript, and can run AI models, microservices, and smart contracts efficiently. WasmEdge offers strong security by isolating programs, making it great for extending software safely. It works well on edge devices, smart devices, and cloud environments, and supports easy integration with tools like Kubernetes and Docker. Using WasmEdge helps you run powerful applications faster, safer, and more flexibly on various platforms[1][2][3][4][5].
https://github.com/WasmEdge/WasmEdge
🚀 Вышел стабильный JavaScript движок от Google для Android
Новая стабильная библиотека Jetpack JavaScript Engine позволит разработчикам выполнять JS код в изолированной и ограниченной среде.
class MainActivity : ComponentActivity() {
// Теперь nullable, без lateinit
private var jsSandbox: JavaScriptSandbox? = null
private var jsIsolate: JavaScriptIsolate? = null
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
if (!JavaScriptSandbox.isSupported()) {
Log.e("JS", "JavaScriptSandbox не поддерживается")
return
}
lifecycleScope.launch {
// Создаём и сохраняем в nullable-поле
jsSandbox = JavaScriptSandbox
.createConnectedInstanceAsync(applicationContext)
.await()
jsIsolate = jsSandbox?.createIsolate()
// При выполнении гарантируем, что jsIsolate != null
val result: String = jsIsolate
?.evaluateJavaScriptAsync(JS_SCRIPT_SCRING)
?.await()
?: "Ошибка: isolate не инициализирован"
Log.d("JS", "Результат выполнения: $result")
}
}
override fun onDestroy() {
super.onDestroy()
// Закрываем только если не null
jsIsolate?.close()
jsSandbox?.close()
}
}
#jetpack#js