highlight.js

Tuesday, April 27, 2021

What's Wrong with GLIBCXX_3.4.26?

If you met the following error, please check this post out for a solution.

java.lang.UnsatisfiedLinkError: /tmp/libjavet-v8-linux-x86_64.v.0.8.4.so: /usr/lib/x86_64-linux-gnu/libstdc++.so.6: version `GLIBCXX_3.4.26' not found (required by /tmp/libjavet-v8-linux-x86_64.v.0.8.4.so)

Saturday, April 24, 2021

Tuesday, April 13, 2021

Javet v0.8.3 is released

  • Added V8Runtime.lowMemoryNotification() and V8Runtime.idleNotificationDeadline()
  • Added V8Host.setMemoryUsageThresholdRatio(), V8Host.enableGCNotification(), and V8Host.disableGCNotification()
  • Updated JavetEnginePool to be lock free
  • Added autoSendGCNotification to JavetEngineConfig
  • Moved JavetCallbackContext management from V8ValueFunction to V8
  • Added JavetPromiseRejectCallback for V8 mode

https://github.com/caoccao/Javet/

Sunday, April 4, 2021

Javet v.0.8.1 is released.

  • Enabled declarative function interception
  • Enabled custom object converter in function callback
  • Added allowEval to JavetEngineConfig
  • Refactored built-in module API for Node.js mode

Saturday, April 3, 2021

What does Embedding Node.js and V8 Development Really Mean?

I've been asked quite a few times on how long I spent embedding Node.js. Well, it took almost 3 weeks to unlock Node.js v14.16.0 for Linux and Windows.

I started from the Windows one and it was quite hard. After settling down the Windows version, I jumped into the Linux one. It was a journey full of desperation that would almost kill this project. Finally, I made it. That's Javet.

That may partially explain why I don't intend to support MacOS / Android by myself. Any volunteers?

Tuesday, March 30, 2021

Javet v0.8.0 with V8 and Node.js in JVM

I'm pleased to announce Javet v0.8.0 is released. Javet is an awesome way of embedding V8 and Node.js in Java.

The new release brings Node.js v14.16.0 + V8 v8.9.255😀

Now, Javet supports both Node.js mode and V8 mode both of which can co-exist in one JVM. In other words, they can run side by side and don't interfere with each other.

As the diagram shows, Javet loads V8 v8.9+ in the default classloader as an out-of-box solution. Node.js is lazy loaded in a custom classloader. Detailed comparisons are as following.

FeatureNode.js ModeV8 Mode
Built-inNoYes
CustomizationHighHigh
Node.js EcosystemCompleteNo
SecurityLowHigh
UnloadPotentially YesNo
V8 EcosystemCompleteComplete
V8 VersionLowHigh

One of the beauties of Javet is all the features in V8 mode can be applied to Node.js mode. Here are some examples.

  • Virtualization - All Node.js modules can be virtualized. E.g. console, fs, HTTP, Net, OS, etc.
  • Zero-copy - JVM can share the same byte buffer with Node.js and V8 to achieve zero-copy.
  • Multi-threading - Multiple Java threads can host multiple Node.js runtime instances with only one copy of V8 objects visible to those instances.
  • Beyond Node.js - Javet allows explicit await() so that applications can take more control over async execution.



Saturday, March 27, 2021

Embedding Node.js or V8

It used to be quite hard to embed Node.js or V8 in C++ development. Good news! I have prepared pre-built Node.js and V8. Just download them from this drive.

For sample C++ project, please visit Javet - An awesome Java project that embeds Node.js and V8 in JVM.



Cue Club 2 on Apple Silicon

It's been quite a long time for me not to play a decent snooker game since I replaced my Windows laptop with an Apple Silicon one. To be...