squirrel VS Duktape

Compare squirrel vs Duktape and see what are their differences.

squirrel

Official repository for the programming language Squirrel (by albertodemichelis)

Duktape

Duktape - embeddable Javascript engine with a focus on portability and compact footprint (by svaarala)
Our great sponsors
  • Scout APM - Less time debugging, more time building
  • SonarLint - Clean code begins in your IDE with SonarLint
  • SaaSHub - Software Alternatives and Reviews
squirrel Duktape
6 3
719 5,332
- -
4.2 8.3
about 2 months ago 3 days ago
C++ JavaScript
MIT License MIT License
The number of mentions indicates the total number of mentions that we've tracked plus the number of user suggested alternatives.
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.

squirrel

Posts with mentions or reviews of squirrel. We have used some of these posts to build our list of alternatives and similar projects. The last one was on 2021-08-05.
  • if you woke up and had to live a life nirn tomorrow (think outlander).. what would be your theory on what earth was in TES universe?
    1 project | reddit.com/r/teslore | 6 Jul 2022
    Not that hard, actually: http://www.squirrel-lang.org/
  • A very interesting error I just had...
    1 project | reddit.com/r/enlistedgame | 3 Jun 2022
  • Squirrel
    1 project | reddit.com/r/learnprogramming | 15 Jan 2022
    I just downloaded it last night I learned on Lua and it's still my favorite language this is kinda based on it from.what I've read anyone try it yet any anythingjust in case y'all think I'm crazy there's the link to there home page I'm not playing with roadkill calling it programming or training squirrels or at least that's not what this is about
  • LÖVR – An open source framework for rapidly building immersive 3D experiences
    11 projects | news.ycombinator.com | 5 Aug 2021
    A question: would it be too much work to port Love2D to a different embedding language? (I'm currently having looks at Squirrel (http://www.squirrel-lang.org/) I always thought Lua was tightly coupled with the framework, but what you've mentioned seems to imply that's not the case.
    11 projects | news.ycombinator.com | 5 Aug 2021
    Lua is a language that I started programming with, and has a special place in my heart even if has some crappy parts.

    The main issue I have with the language is with table accesses and 'nil'. Tables in Lua are the most fundamental type of objects in the language, it can be either an array (1-based index) or a hashtable. In this language objects are basically just tables with fields in them, and with metatables you can basically emulate all the features in a typical OOP language (classes, inheritance, traits, operator overloading, etc.) Field access in objects are just table accesses (like what you can imagine with Javascript).

    However, when you try to access a field in a table that doesn't exist (such as 'print(table.key_that_doesnt_exist)'): no errors or exceptions are explicitly raised, it just silently returns nil. This is such a dealbreaker that makes the language much harder to debug than other languages (at least Javascript returns undefined, which is different from null! Oh well, that actually has problems of its own though....) Some more horror: global variables are also implemented as tables (imagine that there's a table _G at the top of the scope). This means that any spelling mistakes with variables will also just silently return nil, since if it doesn't find any variable names at the local scope, it tries to find at the global scope.

    The global variable thing was actually such a big problem that people came up with some voodoo metatable trickery script that prevents this from happening (a showcase of the language's power, but probably not its proudest). I'm sure you could also do this with table creation (make a wrapper function tbl() that automatically adds metatables to prevent invalid field access, so every time you need to do things like 'pos = tbl({x = 1, y = 2})') But still, there isn't a solution baked into the language, and it's cumbersome to do this.

    Right now I'm trying to integrate Squirrel (http://www.squirrel-lang.org/) instead of Lua as a scripting language into my game. Squirrel is an embedded scripting language that's hugely inspired from Lua, but also fixes this shortcoming of the language by making invalid table accesses runtime errors. And when you want to add new fields to a table you need to explicitly do so via the <- operator:

        table = {}
  • What language(s) pair well with Rust (learning, using, etc.)? Also, what other languages did you learn before learning Rust?
    7 projects | reddit.com/r/rust | 4 Aug 2021
    The second one that comes to mind is Squirrel, which is a compiled language designed to be embedded into other programs. It’s similar to lua in concept, but closer to C in syntax. I never did a lot with it, but I did learn it.

Duktape

Posts with mentions or reviews of Duktape. We have used some of these posts to build our list of alternatives and similar projects. The last one was on 2021-03-30.
  • Optimizations Enabled by -ffast-Math
    1 project | news.ycombinator.com | 20 Oct 2021
    Fast math optimizations can break code like this by breaking isNaN.

    I was porting a C++ project to a certain platform - and that platform enabled a -ffast-math equivalent by default in Release (but not Debug) builds! This broke duktape, a JS engine said project embedded, in some nasty and subtle ways. Instead of storing a number/pointer/??? (8 bytes) + type tag (4? bytes) for each dynamically typed JS value, duktape can bit-pack values into a single 8 byte "double" value by storing object/string handles as NaN values - this isn't an uncommon trick for dynamically typed scripting stuff:

    https://github.com/svaarala/duktape/blob/c3722054ea4a4e50f48...

    Naturally, the -ffast-math equivalent broke isNaN checks, which caused random object/string handles to be mistakenly reinterpreted as "numbers" - but only in Release builds, for this one particular platform, in one rarely taken branch, so neither QA nor CI caught it, leading to hours of manufacturing a repro case, stepping through an absurd amount of code, and then finally looking at the default build rules and facepalming.

    Cursing the platform vendor under my breath, I overrode the defaults to align with the defaults of every other config x platform combination we already had: no fast math. If you want those optimizations, use SSE-friendly NaN-avoiding intrinsics - or, if you must use the compiler flags, ensure you do so consistently across build configs and platforms, perhaps limited to a few TUs or modules if possible. This allows you to have a chance at using your Debug builds to debug the resulting "optimizations".

  • Can C++ and JS be used together?
    1 project | reddit.com/r/learnprogramming | 27 Apr 2021
    Sure. For example, DukTape is an implementation of Javascript designed to be embedded in other projects. Google's V8 Javascript engine (used in Chrome), can also be embedded, see Node.Js for example.
  • [AskJS] Do you use JavaScript on Microcontrollers? Which engine / interpreter?
    5 projects | reddit.com/r/javascript | 30 Mar 2021
    - Duktape (4.8k stars)

What are some alternatives?

When comparing squirrel and Duktape you can also consider the following projects:

V8 - The official mirror of the V8 Git repository

Lua - Lua is a powerful, efficient, lightweight, embeddable scripting language. It supports procedural programming, object-oriented programming, functional programming, data-driven programming, and data description.

quickjs - Public repository of the QuickJS Javascript Engine. Pull requests are not accepted. Use the mailing list to submit patches.

jerryscript - Ultra-lightweight JavaScript engine for the Internet of Things.

ChaiScript - Embedded Scripting Language Designed for C++

V7 - Embedded JavaScript engine for C/C++

SWIG - SWIG is a software development tool that connects programs written in C and C++ with a variety of high-level programming languages.

ChakraCore - ChakraCore is an open source Javascript engine with a C API. [Moved to: https://github.com/chakra-core/ChakraCore]

Wren - The Wren Programming Language. Wren is a small, fast, class-based concurrent scripting language.

v8pp - Bind C++ functions and classes into V8 JavaScript engine

Godot - Godot Engine – Multi-platform 2D and 3D game engine