Compact JavaScript execution?

Looking for a compact version of Javascript written in C that prioritizes code size and memory usage over speed. Must be in ANSI C with the possibility of GCC extensions. Preferably runs on a VM for compiler compatibility. Any recommendations?

UPDATE: Two suggestions have been noted, but:

SpiderMonkey is focused on speed, which is not important to me.
Quad-Wheel seems promising, but lacks activity and detailed code comments (will need to port to another architecture).

Open to other suggestions or considering developing my own simplified JS version (though not ideal).

Answer №1

Duktape, a programming language created in C, prioritizes adaptability and efficiency:

Answer №2

Just stumbled upon this gem: https://github.com/gfwilliams/tiny-js

I've been on the hunt for a lightweight solution like this for quite some time. Spidermonkey and V8 can be quite hefty with all their dependencies. Tiny-js offers a portable 'run make and you're good to go' experience in a Linux environment. Ideal for those who only need simple bindings and prefer JavaScript/C syntax over Lua or other scripting languages.

Answer №3

If you're looking for an ANSI-C engine compatible with ECMA-262 standards, check out this link.

Alternatively, you can explore Mozilla SpiderMonkey, another C-written engine which may be too complex and extensive for your needs.

Answer №4

SpiderMonkey is the official implementation of JavaScript by Mozilla.

For more information, visit the SpiderMonkey website

Answer №5

Express.js by Artifex Software could be a great alternative for incorporating JS/ES into embedded systems.

Answer №6

Have you checked out Jsi, the latest programming language on the block? It's incredibly compact, based on a subset of javascript, and developed in C (originating from quadwheel).

Answer №7

The jsi he mentioned can be found at this link:

(Don't blame it, it's not... hehe)

Answer №8

Clicking on will take you to the main website.

Answer №10

What are your thoughts on JerryScript?

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

I'm encountering an issue where I receive an error when attempting to read or write more than 3 bytes when using libusb to communicate with a PIC 18F2550

Currently, I am utilizing libusb within the Qt framework to interact with a PIC microcontroller, specifically the 18F2550 model. Everything seems to be functioning correctly until I attempt to transmit or receive more than three bytes at once. Why does thi ...

An issue has been encountered with the Vue Router within the Micro Front End/Web Components setup, displaying the error message: "Uncaught TypeError:

I encountered an issue that I need help with. Here is the scenario: I have built a Vue application called my-admin micro app consisting of 4-5 screens/components (manage user, manage notifications, manage roles, etc.). I created a router.js file where I d ...

Find the highest value in a MySQL column

Currently, I am working with a mysql table in NodeJs where there is a column called packageId. My goal is to fetch the highest value from that particular column. For instance, if the values in the column are 2,3,4,5, I only want to retrieve 5. I attempted ...

What is the method for exiting full screen mode in NextJS?

'use client' const App = () => { const [isFScreen, setIsFScreen] = useState(false) useEffect(() => { const down = (e: KeyboardEvent) => { if (e.key === "Escape"){ setIsFScreen(false) } } docu ...

What is the best way to limit the size of a file being uploaded using JavaScript (or Java) without needing to transmit the entire file?

Is it possible to validate the size of a file being uploaded from a JSP page on the client-side browser without requiring the user to upload the entire file first and then realizing it exceeds the size limit? I prefer avoiding proprietary controls such as ...

How to bypass middleware in Nest.js based on the header value

I am working on an application that utilizes nestjs and MiddlewareConsumer. Is there a way to skip a middleware based on a specific header value? I have reviewed the documentation and it appears that I can only skip middleware based on path or method, but ...

What is the reason I am able to read a dereferenced pointer in C, but unable to write it, while in C++ I can?

When I needed to patch a program, I created a DLL for injecting and patching one byte of the instruction. I decided to write the code in C this time instead of C++ out of curiosity. However, upon loading my DLL, the thread crashes instead of writing to the ...

What are some strategies for breaking down large components in React?

Picture yourself working on a complex component, with multiple methods to handle a specific task. As you continue developing this component, you may consider refactoring it by breaking it down into smaller parts, resembling molecules composed of atoms (it ...

Obtain the selected dropdown value and transfer it to the controller seamlessly without the need to reload the page

Currently, I am facing an issue with two dropdown lists in a bootstrap modal - CATEGORY and SUBCATEGORY. The values in the SUBCATEGORY list depend on the selection made in the CATEGORY list. My goal is to retrieve the selected value ID and pass it to my co ...

Hide the selection box when hovering over the Div

Looking for a quick solution. I want the option drop down to close when another div element is hovered over. First, open the drop down and hover over the red element on the right side. When hovering over the red element, I would like the drop down to clos ...

Node.js does not support MongoDB projection

Here is the code I am working with: result = await mongoDBO.collection(collectionName).find({id: data.id},{projection : {'_id' : 0}}).toArray(); Unfortunately, I encountered the error below: Unsupported projection option: projection: { _id: 0 } ...

Optimal row settings for different reports using Material-UI table pagination

Recently, I've been exploring an example involving material-ui's TablePagination. In this scenario, they present a useTable component with the following code snippet: import React, { useState } from 'react' import { Table, TableHead, Ta ...

Transition the background image into view upon hover

I'm looking to enhance my jQuery code that changes the background image when hovering over text by adding a fade-in effect. Here's the current code I have: $(document).ready(function(){ $("#anatomyNow").hover(function(){ $("#bg").cs ...

Tips for minimizing react-redux boilerplate - I attempted implementing a ComponentFactory solution but encountered issues with react-redux validation errors

I had an idea to streamline the process in react-redux by creating a factory function called createScreen. Here's how it looks: ParentScreenFactory.js export default function createScreen(stateActions = []) { class ParentScreen extends React.Comp ...

The Django/Python function, toDataURL, outputs a response containing the string retrieved from the toDataURL method

I recently stored a string in a database that was returned by a javascript method called toDataURL. An example of the string can be found here: http://pastebin.com/0Qu8rngD My goal is to retrieve the image in a Django response. I've attempted various ...

Tips for automatically redirecting a webpage to another webpage upon submission of form elements:

I'm currently working on a website where I want to integrate radio buttons as part of a form. Below is the code snippet I've been using... <form action="glitter.php" method="post"> <input type="radio" name="font" value="fonts/darkcrysta ...

Display pop-up message in JavaScript

Having trouble with my homework assignment... I can't figure out what's going wrong in my code.. the task is to create a basic math learning tool with level selection feature... I implemented a drop-down menu for selecting the level and arithmeti ...

Put the code inside a function. I'm new to this

My goal is to encapsulate this code: if($(window).width() > 980) { $(window).on("scroll", function() { if($(window).scrollTop() > 20) { //add black background $(".x-navbar").addClass("active"); $(".x-navbar .desktop ...

Assign the returned auth2 value to an Angular variable

I've been searching for a solution to my issue without much success, even though it seems like it should be an easy fix. Currently, I am using AngularJS and Google auth2 for authentication to fetch the logged in user's information. My goal is to ...

Instruction on updating the browser URL from navigating within an iframe

Is it possible to change the URL in the browser based on iframe navigation like this: **[URL at navigator: http://localhost/]** <html> <body> <iframe src="http://localhost/?loadiframe=true"> <!-- this is at the code retrieved by t ...